Skip to content

Commit

Permalink
feat(install.d): allow using dracut in combination with ukify
Browse files Browse the repository at this point in the history
This can be simply accomplished with the KERNEL_INSTALL_INITRD_GENERATOR
and KERNEL_INSTALL_UKI_GENERATOR variables. `60-ukify.install` looks for
the initrd in the KERNEL_INSTALL_STAGING_AREA and then takes care of building
the uki.

This change makes it possible to use a configuration like this:
/etc/kernel/install.conf
layout=uki
uki_generator=ukify
initrd_generator=dracut

Without this change this configuration will fail since dracut would also
generate an uki instead of initrd, which will cause a problem in
`60-ukify.install` since it can't find an initrd to use.

Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
  • Loading branch information
AndrewAmmerlaan authored and LaszloGombos committed Aug 22, 2023
1 parent 6f78e5d commit 1664563
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions install.d/50-dracut.install
Expand Up @@ -14,12 +14,25 @@ fi
# Mismatching the install layout and the --uefi/--no-uefi opts just creates a mess.
if [[ $KERNEL_INSTALL_LAYOUT == "uki" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then
BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA"
IMAGE="uki.efi"
UEFI_OPTS="--uefi"
if [[ -z $KERNEL_INSTALL_UKI_GENERATOR || $KERNEL_INSTALL_UKI_GENERATOR == "dracut" ]]; then
# No uki generator preference set or we have been chosen
IMAGE="uki.efi"
UEFI_OPTS="--uefi"
elif [[ -z $KERNEL_INSTALL_INITRD_GENERATOR || $KERNEL_INSTALL_INITRD_GENERATOR == "dracut" ]]; then
# We aren't the uki generator, but we have been requested to make the initrd
IMAGE="initrd"
UEFI_OPTS="--no-uefi"
else
exit 0
fi
elif [[ $KERNEL_INSTALL_LAYOUT == "bls" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then
BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA"
IMAGE="initrd"
UEFI_OPTS="--no-uefi"
if [[ -z $KERNEL_INSTALL_INITRD_GENERATOR || $KERNEL_INSTALL_INITRD_GENERATOR == "dracut" ]]; then
IMAGE="initrd"
UEFI_OPTS="--no-uefi"
else
exit 0
fi
else
# No layout information, use users --uefi/--no-uefi preference
UEFI_OPTS=""
Expand Down

0 comments on commit 1664563

Please sign in to comment.