Remove kdump-specific initrd images when the kernel is uninstalled

This commit is contained in:
Evgenii Shatokhin 2017-03-13 18:10:33 +03:00
parent c33d032207
commit 8fca6a536d

View file

@ -871,7 +871,7 @@ done
# uninstalled, initrd has been regenerated for the given kernel. However,
# the kernel itself might have been uninstalled before, so that (defunct)
# initrd image files would be left behind. Remove them if the kernel itself
# is no longer installed. Should work if they are ininstalled in parallel
# is no longer installed. Should work if they are uninstalled in parallel
# too.
if ! test -f /boot/vmlinuz-${KernelVer}; then
rm -f /boot/initrd-${KernelVer}.img
@ -998,6 +998,9 @@ EOF
cat > $kernel_files-postun <<EOF
rm -f /boot/initrd-${KernelVer}.img
rm -f /boot/initrd-${KernelVer}_old.img
rm -f /boot/initrd-${KernelVer}kdump.img
rm -f /boot/initramfs-${KernelVer}kdump.img
# Third-party modules might have left something in /lib/modules/.../kernel/.
rm -rf /lib/modules/${KernelVer}/kernel/
rm -rf /lib/modules/${KernelVer}/modules*