kernel-install: add "$KERNEL_INSTALL_STAGING_AREA" directory
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 19 Jan 2022 11:20:22 +0000 (12:20 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 28 Jan 2022 15:17:47 +0000 (16:17 +0100)
commit367165a4069ac0c04882a05a8a80f6afb1e42760
tree3228c2bfea3b4388bc3204c5c1ebe2c31a07f2cf
parent680cec6b4ddb356d7dd087b197718712cb5c1662
kernel-install: add "$KERNEL_INSTALL_STAGING_AREA" directory

The general approach of kernel-install was that each plugin would drop in some
files into the entry directory. But this doesn't scale well, because if we have
multiple initrd generators, or multiple initrds, each generator would need to
recreate the logic to put the generated files in the right place.

Also, effective cleanup is impossible if anything goes wrong on the way, so we
could end up with unused files in $BOOT.

So let's invert the process: plugins drop files into $KERNEL_INSTALL_STAGING_AREA,
and at the end 90-loaderentry.install DTRT with those files.

This allow new plugins like 50-mkosi-initrd.install to be significantly simpler.
man/kernel-install.xml
src/kernel-install/90-loaderentry.install
src/kernel-install/kernel-install