From: Andrew Ammerlaan Date: Sun, 20 Aug 2023 10:19:10 +0000 (+0200) Subject: feat(install.d): allow using dracut in combination with ukify X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=166456331d55cdc23946c11315dc2c88aab15911;p=thirdparty%2Fdracut.git feat(install.d): allow using dracut in combination with ukify 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 --- diff --git a/install.d/50-dracut.install b/install.d/50-dracut.install index 1caa2d7ca..476506052 100755 --- a/install.d/50-dracut.install +++ b/install.d/50-dracut.install @@ -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=""