From 4add95c6b1b6570fd5e0c69cf7d5d70f14170057 Mon Sep 17 00:00:00 2001 From: jacob Date: Fri, 29 Jul 2005 23:54:32 +0000 Subject: [PATCH] update patches and scripts for SLES 9 SP2 --- build/lbuild | 2 +- build/lustre-kernel-2.4.spec.in | 3 +++ build/suse-post.sh | 34 +++++++++++++++++++++----------- build/suse-postun.sh | 43 ++++++++++++++++++++++++++++------------- 4 files changed, 57 insertions(+), 25 deletions(-) diff --git a/build/lbuild b/build/lbuild index 2f9bc0f..52807a8 100755 --- a/build/lbuild +++ b/build/lbuild @@ -204,7 +204,7 @@ check_options() CANONICAL_TARGET="rhel-2.6" ;; 2.6-suse) - CANONICAL_TARGET="suse-2.6" + CANONICAL_TARGET="sles-2.6" ;; hp_pnnl-2.4) CANONICAL_TARGET="hp-pnnl-2.4" diff --git a/build/lustre-kernel-2.4.spec.in b/build/lustre-kernel-2.4.spec.in index 5066ea6..e3fa2fe 100644 --- a/build/lustre-kernel-2.4.spec.in +++ b/build/lustre-kernel-2.4.spec.in @@ -402,6 +402,9 @@ for flavor in "" smp bigmem bigsmp pseries64 BOOT jensen ; do echo "fi" >> ${script} ;; post) + # /sbin/update-modules.dep compares when the modules were built, rather + # than installed, so force modules.dep to be recreated + echo "rm -f /lib/modules/%{KVERREL}${flavor}/modules.dep" >> ${script} echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script} sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE26} >> ${script} diff --git a/build/suse-post.sh b/build/suse-post.sh index ec38664..869fa40 100644 --- a/build/suse-post.sh +++ b/build/suse-post.sh @@ -9,28 +9,40 @@ else exit 0 fi +case %ver_str in + (*xen*|*um*) + NOBOOTSPLASH="-s off" + SHORTNM=%ver_str + SHORTNM=-${SHORTNM##*-} + ;; + (*) + unset NOBOOTSPLASH + unset SHORTNM + ;; +esac + # If we have old symlinks, rename them to *.previous -if [ -L /boot/$image -a -L /boot/initrd -a \ - "$(readlink /boot/$image)" != $image-%ver_str -a \ - "$(readlink /boot/initrd)" != initrd-%ver_str ]; then - mv /boot/$image /boot/$image.previous - mv /boot/initrd /boot/initrd.previous +if [ -L /boot/$image$SHORTNM -a \ + "$(readlink /boot/$image$SHORTNM)" != $image-%ver_str ]; then + mv /boot/$image$SHORTNM /boot/$image$SHORTNM.previous fi - -# update /boot/vmlinuz symlink -relink $image-%ver_str /boot/$image +relink $image-%ver_str /boot/$image$SHORTNM if test "$YAST_IS_RUNNING" != instsys ; then if [ -f /etc/fstab ]; then echo Setting up /lib/modules/%ver_str /sbin/update-modules.dep -v %ver_str cd /boot - /sbin/mkinitrd -k $image-%ver_str -i initrd-%ver_str + /sbin/mkinitrd -k $image-%ver_str -i initrd-%ver_str $NOBOOTSPLASH + if [ -L /boot/initrd$SHORTNM -a \ + "$(readlink /boot/initrd)" != initrd-%ver_str ]; then + mv /boot/initrd$SHORTNM /boot/initrd$SHORTNM.previous + fi if [ -e /boot/initrd-%ver_str ]; then - relink initrd-%ver_str /boot/initrd + relink initrd-%ver_str /boot/initrd$SHORTNM else - rm -f /boot/initrd + rm -f /boot/initrd$SHORTNM fi else echo "please run mkinitrd as soon as your system is complete" diff --git a/build/suse-postun.sh b/build/suse-postun.sh index eb86d03..44c8798 100644 --- a/build/suse-postun.sh +++ b/build/suse-postun.sh @@ -9,7 +9,17 @@ else exit 0 fi -if [ "$(readlink /boot/$image)" = $image-%ver_str ]; then +case %ver_str in + (*xen*|*um*) + SHORTNM=%ver_str + SHORTNM=-${SHORTNM##*-} + ;; + (*) + unset SHORTNM + ;; +esac + +if [ "$(readlink /boot/$image$SHORTNM)" = $image-%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. Only if this kernel @@ -19,25 +29,32 @@ if [ "$(readlink /boot/$image)" = $image-%ver_str ]; then # manager will always have a kernel to boot in its default # configuration. shopt -s nullglob - for image in $(cd /boot ; ls -dt $image-*); do - initrd=initrd-${image#*-} - if [ -f /boot/$image -a -f /boot/$initrd ]; then - relink $image /boot/${image%%%%-*} - relink $initrd /boot/${initrd%%%%-*} + for img in $(cd /boot ; ls -dt $image-*$SHORTNM); do + initrd=initrd-${img#*-} + if [ -f /boot/$img -a -f /boot/$initrd ]; then + relink $img /boot/${img%%%%-*}$SHORTNM + relink $initrd /boot/${initrd%%%%-*}$SHORTNM + + # Notify the boot loader that a new kernel image is active. + if [ -x /sbin/new-kernel-pkg ]; then + /sbin/new-kernel-pkg $(/sbin/get_kernel_version /boot/$img) + fi break fi done shopt -u nullglob fi -# Created in the other kernel's %post -case "$(readlink /boot/$image.previous)" in -$image-%ver_str|$(readlink /boot/$image)) - rm -f /boot/$image.previous ;; +# Check whether there is a .previous link to the image we're about +# to remove or to the image we point the new symlink to (so .previous +# would be identical to the current symlink) +case "$(readlink /boot/$image$SHORTNM.previous)" in +$image-%ver_str|$(readlink /boot/$image$SHORTNM)) + rm -f /boot/$image$SHORTNM.previous ;; esac -case "$(readlink /boot/initrd.previous)" in -initrd-%ver_str|$(readlink /boot/initrd)) - rm -f /boot/initrd.previous ;; +case "$(readlink /boot/initrd$SHORTNM.previous)" in +initrd-%ver_str|$(readlink /boot/initrd$SHORTNM)) + rm -f /boot/initrd$SHORTNM.previous ;; esac # created in %post rm -f /boot/initrd-%ver_str -- 1.8.3.1