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"

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1515513

Title:
  /boot/initrd.img-*.old-dkms files left behind

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dkms/+bug/1515513/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to