]> git.ipfire.org Git - thirdparty/systemd.git/commit
kernel-install: replace 00-entry-directory with K_I_LAYOUT in k-i 19006/head
authorнаб <nabijaczleweli@nabijaczleweli.xyz>
Tue, 16 Mar 2021 15:47:34 +0000 (16:47 +0100)
committerнаб <nabijaczleweli@nabijaczleweli.xyz>
Thu, 16 Dec 2021 13:00:46 +0000 (14:00 +0100)
commitd6bce6e2244dd3dd6f9e21b184f85a0649d399ff
treee569ee49c688b82b1e223cc5316d1c87faa9a36d
parent0c0bb433db6b82bf9301e6614cb3e7d3272a2cdd
kernel-install: replace 00-entry-directory with K_I_LAYOUT in k-i

341890de866f2ee34919a47ce3fc6c8cd3c1924c made "bootctl install" create
ESP\MID, in preparation of cf73f650890b56a59bfb713c4c82b4e29daa7316 that
followed it and created 00-entry-directory.install to make ESP\MID\KVER
if ESP\MID existed ‒ this meant that "bootctl install" followed by
"kernel-install $(uname -r) /boot/vml*$(uname -r) /boot/ini*$(uname -r)"
actually installed the kernel correctly.

Later, 31e57550b552e113bd3d44355b237c41e42beb58 reverted the first
commit, meaning, that now running those two commands first installs
sd-boot, but then does nothing. Everything appears to work right,
nothing errors out, but no changes are actually done. To the untrained
eye (all of them), even running with -v appears to work:
all the hooks are run, as is depmod, but, again, nothing happens.

This is horrible. Nothing in either manpage suggests what to do
(nor should it, really), but the user is left with a bootloader that
appears fully funxional, since nothing suggests a failure in the output,
but with an unbootable machine, /no way to boot it/, even if they drop
to an EFI shell, since the boot bundle isn't present on the ESP,
and no real recourse even if they boot into a recovery system,
apart from installing like GRUB or whatever.

00- is purely instrumentation for 90-,
and separating one from the other has led to downstream dissatisfaxion
(indeed, the last mentioned commit cited cited exactly that as the
 reversion reason), while creating $ENTRY_DIR_ABS is only required
for bootloaders using the BLS, and shouldn't itself toggle anything.

To that end, introduce an /{e,l}/k/install.conf file that allows
overriding the detected layout, and detect it as "bls" if
$BOOT_ROOT/$MACHINE_ID ($ENTRY_DIR_ABS/..) exists, otherwise "other" ‒
if a user wishes to select a different bootloader,
like GRUB, they (or, indeed, the postinst script) can specify
layout=grub. This disables 90- and $ENTRY_DIR_ABS manipulation.
man/kernel-install.xml
meson.build
src/kernel-install/00-entry-directory.install [deleted file]
src/kernel-install/90-loaderentry.install
src/kernel-install/install.conf [new file with mode: 0644]
src/kernel-install/kernel-install
src/kernel-install/meson.build