3dcdbea9a1
Copy from Kernel:HEAD/kernel-source based on submit request 25554 from user michal-m OBS-URL: https://build.opensuse.org/request/show/25554 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kernel-source?expand=0&rev=82
40 lines
1.2 KiB
Bash
40 lines
1.2 KiB
Bash
wm2=/usr/lib/module-init-tools/weak-modules2
|
|
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
|
|
|
|
if [ @BASE_PACKAGE@ = 0 ]; then
|
|
if [ -x $wm2 ]; then
|
|
/bin/bash -${-/e/} $wm2 --remove-kernel-modules @KERNELRELEASE@-@FLAVOR@ < /var/run/rpm-$nvr-modules
|
|
fi
|
|
rm -f /var/run/rpm-$nvr-modules
|
|
exit 0
|
|
fi
|
|
# Remove symlinks from /lib/modules/$krel/weak-updates/.
|
|
if [ -x $wm2 ]; then
|
|
/bin/bash -${-/e/} $wm2 --remove-kernel @KERNELRELEASE@-@FLAVOR@
|
|
fi
|
|
|
|
# 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
|
|
|
|
# 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@ \
|
|
@KERNELRELEASE@-@FLAVOR@ \
|
|
@IMAGE@-@KERNELRELEASE@-@FLAVOR@ \
|
|
initrd-@KERNELRELEASE@-@FLAVOR@
|
|
fi
|
|
fi
|