Skip to content

Commit 6ef41e2

Browse files
Paolo AbeniMichal Marek
Paolo Abeni
authored and
Michal Marek
committed
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 <[email protected]> Signed-off-by: Michal Marek <[email protected]>
1 parent c8b08ca commit 6ef41e2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/package/mkspec

+5
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ echo "/sbin/installkernel $KERNELRELEASE /boot/.vmlinuz-$KERNELRELEASE-rpm /boot
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"

0 commit comments

Comments
 (0)