2008-10-16 14:49:50 +02:00
|
|
|
wm=/usr/lib/module-init-tools/weak-modules
|
2008-10-14 18:16:00 +02:00
|
|
|
wm2=/usr/lib/module-init-tools/weak-modules2
|
|
|
|
if [ @BASE_PACKAGE@ = 0 ]; then
|
|
|
|
if [ -x $wm2 ]; then
|
|
|
|
nvr=@SUBPACKAGE@-@RPM_VERSION_RELEASE@
|
2009-05-20 10:59:36 +02:00
|
|
|
/bin/bash -${-/e/} $wm2 --remove-kernel-modules @KERNELRELEASE@-@FLAVOR@ < /var/run/rpm-$nvr-modules
|
2008-10-14 18:16:00 +02:00
|
|
|
fi
|
|
|
|
rm -f /var/run/rpm-$nvr-modules
|
|
|
|
exit 0
|
|
|
|
fi
|
2008-07-18 12:15:21 +02:00
|
|
|
# Remove symlinks from /lib/modules/$krel/weak-updates/.
|
2008-10-14 18:16:00 +02:00
|
|
|
if [ -x $wm2 ]; then
|
2009-05-20 10:59:36 +02:00
|
|
|
/bin/bash -${-/e/} $wm2 --remove-kernel @KERNELRELEASE@-@FLAVOR@
|
2009-02-16 18:56:32 +01:00
|
|
|
elif [ -x $wm ]; then
|
2008-10-16 14:49:50 +02:00
|
|
|
# pre CODE11 compatibility
|
2009-05-20 10:59:36 +02:00
|
|
|
$wm --remove-kernel @KERNELRELEASE@-@FLAVOR@
|
2008-07-18 12:15:21 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# remove /boot/@IMAGE@.previous entry on a 10.1 and SLES10 GA system
|
|
|
|
# when going back from 10.2 or SLES10 SP1 kernel to the original kernel
|
|
|
|
remove_previos_entry=no
|
|
|
|
suffix=
|
|
|
|
case @FLAVOR@ in
|
2008-11-28 15:25:51 +01:00
|
|
|
kdump|ps3|xen*|vanilla)
|
2008-07-18 12:15:21 +02:00
|
|
|
suffix=-@FLAVOR@
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Created in %post of old kernels
|
|
|
|
case "$(readlink /boot/@IMAGE@$suffix.previous)" in
|
2009-05-20 10:59:36 +02:00
|
|
|
@IMAGE@-@KERNELRELEASE@-@FLAVOR@|$(readlink /boot/@IMAGE@$suffix))
|
2008-07-18 12:15:21 +02:00
|
|
|
remove_previos_entry=yes
|
|
|
|
rm -f /boot/@IMAGE@$suffix.previous
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
case "$(readlink /boot/initrd$suffix.previous)" in
|
2009-05-20 10:59:36 +02:00
|
|
|
initrd-@KERNELRELEASE@-@FLAVOR@|$(readlink /boot/initrd$suffix))
|
2008-07-18 12:15:21 +02:00
|
|
|
rm -f /boot/initrd$suffix.previous
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# remove fstab check once perl-Bootloader can cope with it
|
|
|
|
if [ -f /etc/fstab ]; then
|
|
|
|
# handle 10.2 and SLES10 SP1
|
|
|
|
if [ -x /usr/lib/bootloader/bootloader_entry ]; then
|
|
|
|
/usr/lib/bootloader/bootloader_entry \
|
|
|
|
remove \
|
|
|
|
@FLAVOR@ \
|
2009-05-20 10:59:36 +02:00
|
|
|
@KERNELRELEASE@-@FLAVOR@ \
|
|
|
|
@IMAGE@-@KERNELRELEASE@-@FLAVOR@ \
|
|
|
|
initrd-@KERNELRELEASE@-@FLAVOR@
|
2008-07-18 12:15:21 +02:00
|
|
|
|
|
|
|
# handle 10.1 and SLES10 GA
|
|
|
|
elif [ -x /sbin/update-bootloader ]; then
|
|
|
|
if [ "$remove_previos_entry" = "yes" ] ; then
|
|
|
|
/sbin/update-bootloader --image /boot/@IMAGE@$suffix.previous \
|
|
|
|
--initrd /boot/initrd$suffix.previous \
|
|
|
|
--remove --force
|
|
|
|
fi
|
|
|
|
/sbin/update-bootloader --refresh
|
|
|
|
fi
|
|
|
|
fi
|