InitramfsUpdates

Summary

Programs need to be able to cause initramfs to be built without the need for the kernel package initiating it.

Rationale

From time to time, various packages are updated which affect the initramfs build process (initramfs-tools, usplash, etc.). These changes currently have no effect until the user either upgrades their kernel or manually runs mkinitramfs or equivalent from the command line.

We want these changes to propagate immediately, because they often incorporate bugfixes, and it is better to make the changes up front than to have them happen later unexpectedly during a kernel upgrade (such as a security update).

This process should also notify the user that they need to reboot.

Use cases

  • USplash is upgraded and should cause the initramfs to be rebuilt.
  • Initramfs is upgraded, and changes need to be available on reboot.
  • Billy installs an initramfs add-on enabling crypto loop, and it should work without intervention.

Design

update-initramfs already exists, and should be called by packages.

Implementation

Packages that need this should do the following:

  • Depend on initramfs-tools.

MattZimmerman: shouldn't this be a versioned dependency?

  • Packages need to call update-initramfs -u in the postinst.

  • Kernel packages should call update-initramfs -c -k <kver> in postinst and update-initramfs -d <kver> in postrm.

  • initramfs-tools needs to call update-initramfs -u as well.

  • update-initramfs needs to call /usr/share/update-notified/notify-reboot-required for all creation and update actions, but nothing else.

  • Kernel-package alse needs to call the notify-reboot-required script in order to support non-initramfs kernel images. The script will only send one notifications.

The change for the kernel-package needs to show up in a linux-image during an ABI bump.

Code

initramfs-tools already contains the update-initramfs script.

MattZimmerman: I'm concerned about the relative complexity of this script. It's hundreds of lines of shell, and relies on sorting versions to infer the "current" kernel in use. I suggest using the default kernel and initrd symlinks where available, and exiting with a warning if the user has disabled them for whatever reason.

JeffBailey: The sorting code is only used if there's no linked in version. (See the update function). The shell code that's used for sorting was taken directly from the update-grub script to ensure that in the absence of symlinks, the same kernel would get chosen. Perhaps the right thing to do is to refactor that out to a common script?

Packages needing this tool need to be identified. Currently only usplash needs this. New packages will need to make use of the script aswell.

kernel-package needs its postinst/postrm scripts for kernel-images updated to use the described invocation of update-initramfs.


CategorySpec

InitramfsUpdates (last edited 2008-08-06 16:31:32 by localhost)