An annoying kernel packaging bug.

The kernel rpm package creates an initramfs file that gets dropped in /boot at install time. Creation of this file is the responsibility of dracut (or mkinitrd in older releases), called from the kernels %post script. Because we want removal of a kernel to also remove its associated initrd file (or else /boot would fill up), we used to list the initramfs file in rpms database as a %ghost file owned by the kernel.

For a long time, this hasn’t been a problem. Now that dracut creates more feature-heavy initramfs files, people were noticing that they were running out of space in /boot during the installation of the kernel rpm. People were asking “why doesn’t rpm check for sufficient diskspace before it tries to install ?” Well, it does. The problem is that for %ghost files, it has no way of knowing how big they are going to be.

So for Fedora 12, we ended up with an ugly hack. Instead of listing the file as a ghost, we create a 20MB empty file, owned by the kernel, which gets overwritten during %post by dracut with the real initramfs.

The big problem with this, is that it destroys the possibility for deltarpms to work. (It also guarantees that signature verification using rpm’s database will fail)

Something better needs to happen, but at this stage, I’m not entirely sure what that will be.

One thought on “An annoying kernel packaging bug.

  1. yaneti

    err. I thought the plan was to dracut generate a generic initramfs on kernel rpm build time. include it in the rpm and stop the %post mucking ?

Comments are closed.