summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2016-03-02 15:28:00 +0100
committerMichal Marek <mmarek@suse.com>2016-03-04 22:59:09 +0100
commit6ef41e22a320d95a246d45b673aa7247cc1bbf7b (patch)
tree215c0dff0e72f9574c3775064e9f277e01465404 /scripts
parentc8b08ca558c0067bc9e15ce3f1e70af260410bb2 (diff)
downloadlinux-6ef41e22a320d95a246d45b673aa7247cc1bbf7b.tar.bz2
kbuild/mkspec: clean boot loader configuration on rpm removal
This patch add a rpm preuninstall scriptlet to cleanup the boot loader configuration on kernel package uninstall. The initrd for the to-be-removed kernel is deleted, too. Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/package/mkspec5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index fe44d68e9344..b6de63cb3f23 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -138,6 +138,11 @@ echo "/sbin/installkernel $KERNELRELEASE /boot/.vmlinuz-$KERNELRELEASE-rpm /boot
echo "rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm /boot/.System.map-$KERNELRELEASE-rpm"
echo "fi"
echo ""
+echo "%preun"
+echo "if [ -x /sbin/new-kernel-pkg ]; then"
+echo "new-kernel-pkg --remove $KERNELRELEASE --rminitrd --initrdfile=/boot/initramfs-$KERNELRELEASE.img"
+echo "fi"
+echo ""
echo "%files"
echo '%defattr (-, root, root)'
echo "/lib/modules/$KERNELRELEASE"