Skip to content
Snippets Groups Projects
Commit 3fa8545b authored by jacob's avatar jacob
Browse files

add support for sles 8:

 - new target for sles 8 kernel
 - post(un) scripts for kernel rpms
 - fixup quota build on sles 8 and sles 9
 - update patches for a more recent sles 8 kernel
parent 2f07d63b
No related branches found
No related tags found
No related merge requests found
EXTRA_DIST := Makefile Makefile.in.toplevel autoMakefile.am.toplevel \
lbuild linux-merge-config.awk \
linux-merge-modules.awk linux-rhconfig.h lmake \
lustre-kernel-2.4.spec.in lustre.spec lustre.spec \
suse-functions.sh suse-post.sh suse-postun.sh \
suse-trigger-script.sh.in README.kernel-source
EXTRA_DIST := Makefile Makefile.in.toplevel \
autoMakefile.am.toplevel lbuild linux-merge-config.awk \
linux-merge-modules.awk linux-rhconfig.h lmake \
lustre-kernel-2.4.spec.in lustre.spec lustre.spec \
suse-functions.sh suse-post.sh suse-postun.sh \
suse-trigger-script.sh.in README.kernel-source \
sles8-post.sh sles8-postun.sh sles8-pre.sh \
sles8-update_INITRD_MODULES.sh \
sles8-update_rcfile_setting.sh
CONFIG_CLEAN_FILES := lustre.spec
......
......@@ -42,6 +42,18 @@ RPMBUILD=
export CC=${CC:-gcc}
# Readlink is not present on some older distributions: emulate it.
readlink() {
local path=$1 ll
if [ -L "$path" ]; then
ll="$(LC_ALL=C ls -l "$path" 2> /dev/null)" &&
echo "${ll/* -> }"
else
return 1
fi
}
cleanup()
{
true
......@@ -369,11 +381,7 @@ clean_linux()
prep_build()
{
# make .spec file
if [ -f /etc/init.d/functions -a -f /etc/sysconfig/network ] ; then
ENABLE_INIT_SCRIPTS=""
else
ENABLE_INIT_SCRIPTS="# "
fi
ENABLE_INIT_SCRIPTS=""
sed \
-e "s^@BASE_ARCHS@^$BASE_ARCHS^g" \
-e "s^@BIGMEM_ARCHS@^$BIGMEM_ARCHS^g" \
......@@ -402,7 +410,8 @@ prep_build()
[ -d BUILD ] || mkdir BUILD
[ -d SOURCES ] || mkdir SOURCES
for script in linux-{rhconfig.h,merge-config.awk,merge-modules.awk} \
suse-{functions.sh,post.sh,postun.sh,trigger-script.sh.in} ; do
suse-{functions.sh,post.sh,postun.sh,trigger-script.sh.in} \
sles8-{pre,post,postun,update_{INITRD_MODULES,rcfile_setting}}.sh ; do
cp $TOPDIR/lustre/build/$script SOURCES
done
cp "$LUSTRE" "$KERNEL_FILE" SOURCES
......@@ -433,7 +442,7 @@ build()
--define "_topdir $TOPDIR" || \
fatal 1 "Error building rpms for $arch."
if (( $DO_SRC )) ; then
if false && (( $DO_SRC )) ; then
$RPMBUILD -bs lustre-kernel-2.4.spec \
--define "_topdir $TOPDIR" || \
fatal 1 "Error building .src.rpm."
......
......@@ -185,6 +185,11 @@ Source25: suse-functions.sh
Source26: suse-post.sh
Source27: suse-postun.sh
Source28: suse-trigger-script.sh.in
Source29: sles8-post.sh
Source30: sles8-postun.sh
Source31: sles8-pre.sh
Source32: sles8-update_INITRD_MODULES.sh
Source33: sles8-update_rcfile_setting.sh
%package source
Summary: The source code for the Linux kernel.
......@@ -387,15 +392,30 @@ popd >/dev/null
for flavor in "" smp bigmem bigsmp pseries64 BOOT jensen ; do
for when in pre preun post postun ; do
script="${when}${flavor}.sh"
echo "if [ -f /etc/SuSE-release ] ; then" > ${script}
cat %{SOURCE25} %{SOURCE32} %{SOURCE33} > ${script}
echo "if [ -d /etc/susehelp.d ] ; then" >> ${script}
sed -e "s/@when@/$when/g" -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE28} >> ${script}
cat %{SOURCE25} >> ${script}
case $when in
pre)
echo "if [ ! -f /etc/modprobe.conf ] ; then" >> ${script}
cat %{SOURCE31} >> ${script}
echo "fi" >> ${script}
;;
post)
echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script}
sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE26} >> ${script}
echo "else" >> ${script}
sed -e "s^%ver_str^%{KVERREL}${flavor}^g" -e "s^%%{cfg_name}^${flavor}^g" %{SOURCE29} >> ${script}
echo "fi" >> ${script}
;;
postun)
echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script}
sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE27} >> ${script}
echo "else" >> ${script}
sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE30} >> ${script}
echo "fi" >> ${script}
;;
esac
echo "exit 0; fi" >> ${script}
......@@ -960,7 +980,7 @@ fi
%files -n lustre-lite-utils
%defattr(-, root, root)
%doc lustre/COPYING lustre/lustre/BUGS lustre/ChangeLog lustre/README lustre/lustre/doc/lustre.pdf
%doc lustre/COPYING lustre/lustre/BUGS lustre/ChangeLog lustre/README
/sbin/*
/usr/sbin/*
/usr/bin/*
......
# Replace fake symlinks with the real ones
relink vmlinuz-%ver_str /boot/vmlinuz
relink initrd-%ver_str /boot/initrd
if [ -e /etc/sysconfig/kernel ]; then
update_rcfile_setting /etc/sysconfig/kernel INITRD_MODULES 2>&1
elif [ -e /etc/rc.config ]; then
update_rcfile_setting /etc/rc.config INITRD_MODULES 2>&1
fi
# If any trigger scripts have created additional modules, we need to
# run depmod.
run_depmod=
if [ -x /sbin/depmod ]; then
for module in $(find /lib/modules/%ver_str \
/lib/modules/%{version}-override-%{cfg_name} \
-type f) ; do
if [ $module -nt /lib/modules/%ver_str/modules.dep ]; then
run_depmod=1
break
fi
done
fi
if [ -n "$run_depmod" ]; then
depmod -ae %ver_str
fi
if [ -f /etc/fstab -a -x /sbin/mkinitrd ]; then
cd /boot && \
/sbin/mkinitrd -k "vmlinuz-%ver_str" -i "initrd-%ver_str"
elif [ -f /etc/fstab -a -x /sbin/mk_initrd ]; then
cd /boot && \
/sbin/mk_initrd -k "vmlinuz-%ver_str" -i "initrd-%ver_str"
else
echo "please run mkinitrd as soon as your system is complete"
fi
# Only call new-kernel-pkg during package updates: Otherwise we might
# call this during an initial installation, with a half-initialized
# boot loader. ($1 = number of instances of this package currently
# installed.)
if [ "$1" -gt 1 ]; then
# Notify boot loader that a new kernel image has been installed.
if [ -x /sbin/new-kernel-pkg ]; then
/sbin/new-kernel-pkg %ver_str
elif [ -e /etc/lilo.conf -a -x /sbin/lilo ]; then
/sbin/lilo
fi
fi
rm -f /boot/initrd-%ver_str # created in %post -- clean up.
if [ "$(readlink /boot/vmlinuz)" = "vmlinuz-%ver_str" -o \
"$(readlink /boot/initrd)" = "initrd-%ver_str" ]; then
# This may be the last kernel RPM on the system, or it may
# be an update. In both of those cases the symlinks will
# eventually be correct. On the other hand, if this kernel
# is removed and other kernel rpms remain installed,
# find the most recent of the remaining kernels, and make
# the symlinks point to it. This makes sure that the boot
# manager will always have a kernel to boot in its default
# configuration.
for vmlinuz in $(cd /boot ; ls -dt vmlinuz-*); do
version="${vmlinuz#vmlinuz-}"
initrd="initrd-$version"
if [ -f "/boot/$vmlinuz" -a -f "/boot/$initrd" ]; then
relink "$vmlinuz" /boot/vmlinuz
relink "$initrd" /boot/initrd
break
fi
done
fi
rm -f /boot/vmlinuz.suse
rm -f /boot/initrd.suse
# Check if $1 is equal to any argument in $1 .. $*.
#
contains() {
local x=$1
shift
case " $@ " in
*" $x "*) return 0 ;;
*) return 1 ;;
esac
}
# Check the old value of INITRD_MODULES:
# - Remove modules that no longer exist.
# - Add modules that were built into the kernel before.
#
update_INITRD_MODULES() {
# MD_MODS is the list of modules that require md.o.
local MD_MODS="linear multipath raid0 raid1 raid5"
# NON_SCSI is a whitelist of modules that are no scsi drivers. Any
# module not listed here is assumed to be a scsi driver, and the
# low-level scsi modules are added to INITRD_MODULES.
local NON_SCSI="jbd ext3 jfs xfs reiserfs $MD_MODS md"
local result maybe_scsi need_md have_md have_scsi have_sd m
for m in "$@" ; do
m="${m%.o}" ; m="${m%.ko}"
contains "$m" $NON_SCSI || maybe_scsi=1
contains "$m" $MD_MODS && need_md=1
[ "$m" == md ] && have_md=1
if contains "$m" scsi_mod sd_mod ; then
eval have_${m%_mod}=1
continue
fi
if contains "$m" xfs_dmapi xfs_support ; then
echo "Module $m no longer exists, and was removed from" \
"INITRD_MODULES." >&2
continue
fi
result[${#result[@]}]="$m"
done
if [ -n "$maybe_scsi" -o -n "$have_scsi" -o -n "$have_sd" ]; then
[ -z "$have_scsi" -o -z "$have_sd" ] \
&& echo "Adding SCSI disk modules to INITRD_MODULES" >&2
result=(scsi_mod sd_mod ${result[@]})
fi
if [ -n "$need_md" -a -z "$have_md" ]; then
echo "Adding RAID support module to INITRD_MODULES" >&2
result=(md ${result[@]})
fi
echo ${result[@]}
}
# Update the variable $var in $rcfile: The function update_$VAR must
# exist. It is called with the old value of $var, and must return the
# new value.
#
update_rcfile_setting() {
local rcfile=$1 var=$2
# The characters $, `, ", and \ have special meaning inside double
# quoted shell variables. The characters " and \ have special meaning
# inside awk double-quoted variables.
local old=$(source "$rcfile" ;
eval echo \$$var \
| sed -e 's/\([$`"\\]\)/\\\1/g')
local new=$(eval update_$var "$old" \
| sed -e 's/\([$`"\\]\)/\\\1/g' \
-e 's/\(["\\]\)/\\\1/g')
local tmp=$(mktemp /tmp/${rcfile##/*}.XXXXXX)
# This script breaks for multi-line varables -- I don't think
# we need to handle this special case.
awk '
function replace() {
if (!done)
print "'"$var"'=\"'"$new"'\""
done=1
}
/^'"$var"'=/ { replace() ; next }
{ print }
' < $rcfile > $tmp &&
cat $tmp > $rcfile
rm -f $tmp
}
......@@ -564,9 +564,7 @@ fi
# Portals linux kernel checks
#
AC_DEFUN([LP_PROG_LINUX],
[LP_CHECK_GCC_VERSION
LP_CONFIG_ZEROCOPY
[LP_CONFIG_ZEROCOPY
LP_CONFIG_AFFINITY
LP_CONFIG_QUADRICS
LP_CONFIG_GM
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment