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.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -138,6 +138,11 @@ echo "/sbin/installkernel $KERNELRELEASE /boot/.vmlinuz-$KERNELRELEASE-rpm /boot · 137 unmodified lines | ||
| 138 | 138 | echo "rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm /boot/.System.map-$KERNELRELEASE-rpm" |
| 139 | 139 | echo "fi" |
| 140 | 140 | 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 "" | |
| 141 | 146 | echo "%files" |
| 142 | 147 | echo '%defattr (-, root, root)' |
| 143 | 148 | echo "/lib/modules/$KERNELRELEASE" |