commit:     9a940c3f3c5411d170cd0f575ab87790326cf7c6
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  3 10:31:15 2024 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Sun Jan  7 17:28:59 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a940c3f

kernel-build.eclass: allow overriding UKI cmdline

Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 eclass/kernel-build.eclass | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index f3a59559d104..391a99ceffce 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -1,4 +1,4 @@
-# Copyright 2020-2023 Gentoo Authors
+# Copyright 2020-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: kernel-build.eclass
@@ -96,6 +96,14 @@ IUSE="+strip"
 # key in PEM format to use. Must be specified if MODULES_SIGN_KEY
 # is set to a path of a file that only contains the private key.
 
+# @ECLASS_VARIABLE: KERNEL_GENERIC_UKI_CMDLINE
+# @USER_VARIABLE
+# @DESCRIPTION:
+# If KERNEL_IUSE_GENERIC_UKI is set, this variable allows setting the
+# built-in kernel command line for the UKI. If unset, the default is
+# root=/dev/gpt-auto-root ro
+: "${KERNEL_GENERIC_UKI_CMDLINE:="root=/dev/gpt-auto-root ro"}"
+
 if [[ ${KERNEL_IUSE_MODULES_SIGN} ]]; then
        IUSE+=" modules-sign"
        REQUIRED_USE="secureboot? ( modules-sign )"
@@ -432,7 +440,7 @@ kernel-build_src_install() {
                        local ukify_args=(
                                --linux="${image}"
                                --initrd="${image%/*}/initrd"
-                               --cmdline="root=/dev/gpt-auto-root ro"
+                               --cmdline="${KERNEL_GENERIC_UKI_CMDLINE}"
                                --uname="${dir_ver}"
                                --output="${image%/*}/uki.efi"
                        )

Reply via email to