From 600362aa11af5af90125aacc8ad7612a5cb80a68 Mon Sep 17 00:00:00 2001
From: Gertalitec <97767846+Gertalitec@users.noreply.github.com>
Date: Thu, 23 Mar 2023 01:09:10 +0400
Subject: [PATCH] Define $KERNEL_INSTALL_UKI_GENERATOR
Define $KERNEL_INSTALL_UKI_GENERATOR in case one wants it to be different from $KERNEL_INSTALL_INITRD_GENERATOR. This can be useful if one wants to use mkinitcpio / Dracut to generate the initrd, but without creating the UKI so this can be left for e.g. ukify or something else. Right now these initrd generators will read /etc/kernel/install.conf and generate the UKI
---
man/kernel-install.xml | 6 +++---
src/kernel-install/install.conf | 1 +
src/kernel-install/kernel-install.in | 7 ++++++-
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/man/kernel-install.xml b/man/kernel-install.xml
index e1fc4e0b493..3d5aebf2e0b 100644
--- a/man/kernel-install.xml
+++ b/man/kernel-install.xml
@@ -286,9 +286,9 @@
- $KERNEL_INSTALL_INITRD_GENERATOR is set for plugins to select the initrd
- generator. This may be configured as initrd_generator= in
- install.conf, see below.
+ $KERNEL_INSTALL_INITRD_GENERATOR and $KERNEL_INSTALL_UKI_GENERATOR
+ are set for plugins to select the initrd and/or UKI generator. This may be configured as
+ initrd_generator= and uki_generator= in install.conf, see below.
$KERNEL_INSTALL_STAGING_AREA is set for plugins to a path to a directory.
Plugins may drop files in that directory, and they will be installed as part of the loader entry, based
diff --git a/src/kernel-install/install.conf b/src/kernel-install/install.conf
index 43b6e7d7926..4520c01d72f 100644
--- a/src/kernel-install/install.conf
+++ b/src/kernel-install/install.conf
@@ -9,3 +9,4 @@
#layout=bls|other|...
#initrd_generator=dracut|...
+#uki_generator=ukify|...
diff --git a/src/kernel-install/kernel-install.in b/src/kernel-install/kernel-install.in
index a16c29d2aa5..611f67243ce 100755
--- a/src/kernel-install/kernel-install.in
+++ b/src/kernel-install/kernel-install.in
@@ -106,9 +106,10 @@ else
shift
fi
-# These two settings are only settable via install.conf
+# These three settings are only settable via install.conf
layout=
initrd_generator=
+uki_generator=
# These two settings can be inherited from the environment
_MACHINE_ID_SAVED="$MACHINE_ID"
_BOOT_ROOT_SAVED="$BOOT_ROOT"
@@ -132,6 +133,8 @@ fi
[ -n "$layout" ] && log_verbose "$install_conf configures layout=$layout"
[ -n "$initrd_generator" ] && \
log_verbose "$install_conf configures initrd_generator=$initrd_generator"
+[ -n "$uki_generator" ] && \
+ log_verbose "$install_conf configures uki_generator=$uki_generator"
if [ -n "$_MACHINE_ID_SAVED" ]; then
MACHINE_ID="$_MACHINE_ID_SAVED"
@@ -307,6 +310,7 @@ export KERNEL_INSTALL_ENTRY_TOKEN="$ENTRY_TOKEN"
export KERNEL_INSTALL_BOOT_ROOT="$BOOT_ROOT"
export KERNEL_INSTALL_LAYOUT="$layout"
export KERNEL_INSTALL_INITRD_GENERATOR="$initrd_generator"
+export KERNEL_INSTALL_UKI_GENERATOR="$uki_generator"
export KERNEL_INSTALL_STAGING_AREA
MAKE_ENTRY_DIR_ABS=0
@@ -383,6 +387,7 @@ case "$COMMAND" in
echo "KERNEL_INSTALL_BOOT_ROOT: $KERNEL_INSTALL_BOOT_ROOT"
echo "KERNEL_INSTALL_LAYOUT: $KERNEL_INSTALL_LAYOUT"
echo "KERNEL_INSTALL_INITRD_GENERATOR: $KERNEL_INSTALL_INITRD_GENERATOR"
+ echo "KERNEL_INSTALL_UKI_GENERATOR: $KERNEL_INSTALL_UKI_GENERATOR"
echo "ENTRY_DIR_ABS: $KERNEL_INSTALL_BOOT_ROOT/$ENTRY_TOKEN/\$KERNEL_VERSION"
# Assert that ENTRY_DIR_ABS actually matches what we are printing here