History

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.

Paolo Abeni committed 10 years ago

Commit 6ef41e21 parent c8b08ca1 file · +5 −0Browse files

Unified · Split

scripts/package/mkspec+5−0
@@ -138,6 +138,11 @@ echo "/sbin/installkernel $KERNELRELEASE /boot/.vmlinuz-$KERNELRELEASE-rpm /boot · 137 unmodified lines
138138 echo "rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm /boot/.System.map-$KERNELRELEASE-rpm"
139139 echo "fi"
140140 echo ""
141+echo "%preun"
142+echo "if [ -x /sbin/new-kernel-pkg ]; then"
143+echo "new-kernel-pkg --remove $KERNELRELEASE --rminitrd --initrdfile=/boot/initramfs-$KERNELRELEASE.img"
144+echo "fi"
145+echo ""
141146 echo "%files"
142147 echo '%defattr (-, root, root)'
143148 echo "/lib/modules/$KERNELRELEASE"