The kernel-install plugin removed the "${BOOT_DIR_ABS%/*}" directory that
was created unconditionally by the kernel-install script. Since the other
plugins used the existence of this directory as the indication on whether
systemd-boot was used or not.
But now the kernel-install script doesn't unconditionally create this dir
anymore and if $BOOT/$MACHINE_ID exists, so there's no need anymore to do
any cleanup.
The kernel-install script created unconditionally a $BOOT_DIR_ABS directory
that was used by the sd-boot bootloader. The kernel-install plugins checked
the existence of that directory to decide whether the BLS snippets would be
created in the path expected by sd-boot or the one expected by zipl.
But the $BOOT_DIR_ABS contains the machine ID that's set in the environment
variable $KERNEL_INSTALL_MACHINE_ID. If there's no machine ID set, then the
$BOOT_DIR_ABS is set to a temporary directory that's removed after all the
kernel-install plugins exit.
The $KERNEL_INSTALL_MACHINE_ID isn't set for example when kernel-install is
executed in a container since there won't be an /etc/machine-id file. This
causes 20-zipl-kernel.install script to wrongly remove the /tmp directory.
So if $KERNEL_INSTALL_MACHINE_ID isn't set, just exit the script since the
BLS snippets can't be installed anyways since their filename also contain
the machine ID.
Also, don't attempt to remove $BOOT_DIR_ABS because kernel-install doesn't
create this directory anymore and instead is created only when sd-boot is
installed.
The 91-zipl.install kernel-install script attempts to execute zipl when a
kernel is installed, but this will fail if there isn't a zipl confg file.
Also, the kernel-install scripts are using ',' as the sed delimiter when
updating the kernel command line options in the BLS fragment file. But it
is valid to have that character in a cmdline so instead use '#' for that.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Add patches to support population IPL sections using BootLoaderSpec files
instead of having them defined in the zipl.conf file. This allows to have
a static zipl.conf file, and update the boot entries by just dropping BLS
fragments files in a directory.
In this configuration the grubby tool isn't used, and instead all needed
tasks (copy kernel, generate an initramfs, copy BLS configs, etc) should
be made by kernel-install scripts.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>