2011-06-18 07:03:05 +02:00
|
|
|
# If a kernel package is removed before the next reboot, we assume that the
|
|
|
|
# multiversion variable in /etc/zypp/zypp.conf is not configured and we delete
|
|
|
|
# the flag again (fate#312018)
|
|
|
|
rm -f /boot/do_purge_kernels
|
|
|
|
|
2008-10-14 18:16:00 +02:00
|
|
|
wm2=/usr/lib/module-init-tools/weak-modules2
|
2009-09-28 17:23:22 +02:00
|
|
|
nvr=@SUBPACKAGE@-@RPM_VERSION_RELEASE@
|
|
|
|
|
|
|
|
if [ -e /boot/System.map-@KERNELRELEASE@-@FLAVOR@ ]; then
|
|
|
|
# the same package was reinstalled or just rebuilt, otherwise the files
|
|
|
|
# would have been deleted by now
|
|
|
|
# do not remove anything in this case (bnc#533766)
|
|
|
|
rm -f /var/run/rpm-$nvr-modules
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2008-10-14 18:16:00 +02:00
|
|
|
if [ @BASE_PACKAGE@ = 0 ]; then
|
|
|
|
if [ -x $wm2 ]; then
|
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@
|
2008-07-18 12:15:21 +02:00
|
|
|
fi
|
|
|
|
|
2009-12-04 12:15:16 +01:00
|
|
|
# exit out early for Moblin as we don't want to touch the bootloader menu
|
|
|
|
if [ -f /etc/SuSE-moblin-release ] ; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
# remove fstab check once perl-Bootloader can cope with it
|
|
|
|
if [ -f /etc/fstab ]; then
|
|
|
|
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
|
|
|
fi
|
|
|
|
fi
|