Comment 6 for bug 1515513

Revision history for this message
Jarno Suni (jarnos) wrote :

The Bourne shell script code to remove the backups could be added in kernel_prerm.d_dkms (or currently non-existing kernel_postrm.d_dkms) in dkms package source, but if the package was removed, there would be no code to remove the backups in conjunction with kernel removing. Thus, the code could be added to kernel/postrm.d/initramfs-tools (or currently non-existing kernel/prerm.d/initramfs-tools) in initramfs-tools package source, too:

# This is applied from make_initrd function in dkms command, which
# creates the possible initrd backup file.
remove_initrd_backup() {
 for initrd in "initrd-$1.img" "initramfs-$1.img" "initrd.img-$1" "initrd-$1"; do
  rm -fv /boot/"${initrd}".old-dkms \
   /boot/efi/efi/redhat/"${initrd}".old-dkms
 done
}

remove_initrd_backup "$1"