]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
feat(dracut): add support for --ukify, --no-ukify
authorJo Zzsi <jozzsicsataban@gmail.com>
Fri, 19 Dec 2025 01:53:05 +0000 (20:53 -0500)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Tue, 23 Dec 2025 12:11:34 +0000 (07:11 -0500)
Introduce a dracut option to enable/disable using ukify to
create UKI even if ukify is installed.

Fixes: https://github.com/dracut-ng/dracut-ng/issues/1592
dracut.sh
man/dracut.8.adoc
shell-completion/bash/dracut

index 9448f1317f1c3209b848d1a444fa562cf6ccdd18..374659b034706284bf87d2839da377331a151edc 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -294,7 +294,9 @@ Creates initial ramdisk images for preloading modules
   --loginstall [DIR]    Log all files installed from the host to [DIR].
   --uefi                Create an UEFI executable with the kernel cmdline and
                          kernel combined.
+  --ukify               Enables ukify.
   --no-uefi             Disables UEFI mode.
+  --no-ukify            Disables ukify.
   --no-machineid        Affects the default output filename of the UEFI
                          executable, discarding the <MACHINE_ID> part.
   --uefi-stub [FILE]    Use the UEFI stub [FILE] to create an UEFI executable.
@@ -489,7 +491,9 @@ rearrange_params() {
             --long no-reproducible \
             --long loginstall: \
             --long uefi \
+            --long ukify \
             --long no-uefi \
+            --long no-ukify \
             --long uefi-stub: \
             --long uefi-splash-image: \
             --long kernel-image: \
@@ -906,7 +910,9 @@ while :; do
         --reproducible) reproducible_l="yes" ;;
         --no-reproducible) reproducible_l="no" ;;
         --uefi) uefi_l="yes" ;;
+        --ukify) ukify_l="yes" ;;
         --no-uefi) uefi_l="no" ;;
+        --no-ukify) ukify_l="no" ;;
         --uefi-stub)
             uefi_stub_l="$2"
             PARMS_TO_STORE+=" '$2'"
@@ -1194,6 +1200,7 @@ drivers_dir="${drivers_dir%"${drivers_dir##*[!/]}"}"
 [[ $reproducible_l ]] && reproducible="$reproducible_l"
 [[ $loginstall_l ]] && loginstall="$loginstall_l"
 [[ $uefi_l ]] && uefi=$uefi_l
+[[ $ukify_l ]] && ukify=$ukify_l
 [[ $uefi_stub_l ]] && uefi_stub=$(path_rel_to_abs "$uefi_stub_l")
 [[ $uefi_splash_image_l ]] && uefi_splash_image=$(path_rel_to_abs "$uefi_splash_image_l")
 [[ $kernel_image_l ]] && kernel_image=$(path_rel_to_abs "$kernel_image_l")
@@ -3520,7 +3527,7 @@ if [[ $uefi == yes ]]; then
     cp "$uefi_stub" "$tmp_uefi_stub"
     "${OBJCOPY:-objcopy}" --remove-section .sbat "$tmp_uefi_stub" &> /dev/null
 
-    if command -v ukify &> /dev/null; then
+    if command -v ukify &> /dev/null && [[ $ukify != 'no' ]]; then
         dinfo "*** Using ukify to create UKI ***"
         if ukify build \
             --linux "$kernel_image" \
index 45d638b5d81bea954b30cd1f700698ba39cf5c0b..2caea320bac4b7c78573e583d032c662f82ee6a9 100644 (file)
@@ -627,9 +627,15 @@ and no /etc/cmdline/*.conf will be generated into the initramfs.
     _/usr/lib/os-release_ or if it exists _/etc/os-release_ and is left out,
     if BUILD_ID is non-existent or empty.
 
+**--ukify**::
+    Enables using ukify to create UKI (default).
+
 **--no-uefi**::
     Disables UEFI mode.
 
+**--no-ukify**::
+    Disables using ukify to create UKI even if ukify is installed.
+
 **--no-machineid**::
     Affects the default output filename of **--uefi** and will discard the
     <MACHINE_ID> part.
index 0ef38e54e63f50f4ebf0bd6d1d90cea3dcbf6283..c1388abcf1d2aede55d5bd923d25ea428d534add 100644 (file)
@@ -33,11 +33,11 @@ _dracut() {
             --local --hostonly --no-hostonly --fstab --help --bzip2 --lzma
             --xz --zstd --no-compress --gzip --list-modules --show-modules --keep
             --printsize --regenerate-all --noimageifnotneeded --early-microcode
-            --no-early-microcode --print-cmdline --reproducible --uefi
+            --no-early-microcode --print-cmdline --reproducible --uefi --ukify
             --enhanced-cpio --rebuild --aggressive-strip --hostonly-cmdline
             --no-hostonly-cmdline --no-hostonly-default-device --nofscks
             --hostonly-i18n --no-hostonly-i18n --lzo --lz4 --no-reproducible
-            --no-uefi --no-machineid --version --parallel --printconfig
+            --no-uefi --no-ukify --no-machineid --version --parallel --printconfig
             '
         [ARG]='-a -m -o -d -I -k -c -L -r -i
             --kver --add --force-add --add-drivers --force-drivers