Hi folks!
Every time when I just want to remove/purge a old linux kernel, update-initramfs is called to recreate a initrd just before it will be removed from file system.
Take a look:
-----------
root@srvXY:/# dpkg -P linux-image-2.6.24-19-server linux-ubuntu-modules-2.6.24-19-server
(Reading database ... 30175 files and directories currently installed.)
Removing linux-ubuntu-modules-2.6.24-19-server ...
update-initramfs: Generating /boot/initrd.img-2.6.24-19-server
Purging configuration files for linux-ubuntu-modules-2.6.24-19-server ...
Removing linux-image-2.6.24-19-server ...
Running postrm hook script /sbin/update-grub.
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found Xen hypervisor 3.2, kernel: /vmlinuz-2.6.24-20-xen
Found Xen hypervisor 3.2, kernel: /vmlinuz-2.6.24-19-xen
Found Xen hypervisor 3.2, kernel: /vmlinuz-2.6.22-15-xen
Found kernel: /vmlinuz-2.6.24-20-server
Found kernel: /memtest86+.bin
Replacing config file /var/run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done
-----------
Has all can see, update-initramfs recreate the file "/boot/initrd.img-2.6.24-19-server" but it's going to be removed on the next step!
So, why you do this if it will be removed?
I think is a some kind of missing "if condition" in someplace, telling the script that's if I want remove the linux-image, it can skip a "update-initramfs" step!
Regards,
Thiago