Package Details: dracut-ukify 8-3

Git Clone URL: https://aur.archlinux.org/dracut-ukify.git (read-only, click to copy)
Package Base: dracut-ukify
Description: Integration layer for dracut and systemd's ukify tool for Arch Linux
Upstream URL: https://aur.archlinux.org/packages/dracut-ukify
Licenses: MIT
Conflicts: dracut-hook-uefi, dracut-uefi-hook
Provides: dracut-hook
Submitter: Prototik
Maintainer: Prototik
Last Packager: Prototik
Votes: 7
Popularity: 0.42
First Submitted: 2023-02-20 21:54 (UTC)
Last Updated: 2024-03-09 19:56 (UTC)

Latest Comments

« First ‹ Previous 1 2

jonas-w commented on 2023-07-27 19:56 (UTC)

@Prototik

Could you add a check to the set-default, so it doesn't show an error for people not using systemd-boot? Thanks.

-    if [[ "$pkgbase" == "$default_kernel_package" && "$variant" == "default" ]]; then
+    if [[ "$pkgbase" == "$default_kernel_package" && "$variant" == "default" && $(bootctl is-installed --quiet) ]]; then

jonas-w commented on 2023-07-27 19:30 (UTC)

Thanks, @BotH!

BotH commented on 2023-07-27 17:27 (UTC) (edited on 2023-07-27 17:31 (UTC) by BotH)

@Shished

--- dracut-ukify       2023-07-27 20:24:07.571779869 +0300
+++ /usr/bin/dracut-ukify       2023-07-27 20:24:46.065818807 +0300
@@ -218,12 +218,10 @@
     ukify_args+=(--uname "$version")
     ukify_args+=(--os-release "@$os_release")
     ukify_args+=(--output "$image")
-    ukify_args+=(--linux "$vmlinuz")
-    ukify_args+=(--initrd "$initrd")

     echo "==> Ukify image $kernel ($version_name)"

-    /usr/lib/systemd/ukify build "${ukify_args[@]}"
+    /usr/lib/systemd/ukify "$vmlinuz" "$initrd" "${ukify_args[@]}"

     # Remove temporary files
     rm "$initrd"

Shished commented on 2023-07-27 17:15 (UTC)

After updating to 6-1 it fails to execute the ukify commands

ukify: error: unrecognized arguments: --linux /usr/lib/modules/6.4.6-zen1-1-zen/vmlinuz --initrd /tmp/tmp.HUGrFK1HHj

Shished commented on 2023-07-09 14:32 (UTC)

Can you add an option to use xbootldr partition instead for esp for installation? If it is mounted, its path can be shown with bootctl -x command.

myles commented on 2023-06-18 00:23 (UTC) (edited on 2023-06-18 00:24 (UTC) by myles)

I had to do mkdir /efi/EFI/Linux

BotH commented on 2023-05-02 18:46 (UTC) (edited on 2023-05-02 18:47 (UTC) by BotH)

# Mark image as default if needed
if [[ "$pkgbase" == "$default_kernel_package" && "$variant" == "default" ]]; then
  echo "===> Mark linux image $kernel ($version) as default"
  bootctl set-default "$(basename "$image")" || {
    echo "==> Unable to mark linux image $kernel ($version) as default due to error" >&2
  }
fi

jonas-w commented on 2023-05-02 14:15 (UTC) (edited on 2023-05-02 14:15 (UTC) by jonas-w)

@Prototik Thanks for the implementation, seems to work!

One thing, bootctl set-default does not work, when someone doesn't use systemd-boot. This currently prints an error message when generating the UKI. That's why I removed it in my patch. But I don't know if there is a good non hacky way to set it automatically (if the path is dynamic).

Prototik commented on 2023-05-02 12:09 (UTC)

@jonas-w latest update adds option to customize UKI image location, now you can use this package without custom patches to store UKI for UEFI default location, can you try it and give some feedback if you wish?

jonas-w commented on 2023-04-15 13:44 (UTC)

If someone wants to use the EFI directly without systemd-boot, I created a patch which installs the efi to EFI/BOOT/BOOTX64.efi if you set it as default kernel package otherwise to EFI/BOOT/BOOTX64-$pkgname.efi. Feel free to use this, but with no warranty.

--- /usr/bin/dracut-ukify   2023-04-15 13:49:56.000000000 +0200
+++ dracut-ukify    2023-04-15 15:43:31.073418694 +0200
@@ -79,7 +79,13 @@
           path="$(grep -lE "^${pkgbase}\$" /usr/lib/modules/*/pkgbase)"
           version=$(basename "${path%/pkgbase}")
           for variant in "${!ukify_variants[@]}"; do
-            IMAGE="${ESP_PATH}/EFI/Linux/$(variant_name "linux-$version-$MACHINE_ID-$BUILD_ID" "$variant").efi"
+
+            if [[ "$pkgbase" == "$default_kernel_package" ]]; then
+              IMAGE="${ESP_PATH}/EFI/BOOT/BOOTX64.efi"
+            else
+              IMAGE="${ESP_PATH}/EFI/BOOT/BOOTX64-${pkgbase}.efi"
+            fi
+            #IMAGE="${ESP_PATH}/EFI/Linux/$(variant_name "linux-$version-$MACHINE_ID-$BUILD_ID" "$variant").efi"
             if [ -f "$IMAGE" ]; then
               echo "==> Removing $IMAGE..."
               rm -f "$IMAGE"
@@ -127,7 +133,14 @@
   vmlinuz="/usr/lib/modules/${version}/vmlinuz"

   for variant in "${!ukify_variants[@]}"; do
-    image="${ESP_PATH}/EFI/Linux/$(variant_name "linux-${version}-${MACHINE_ID}-${BUILD_ID}" "$variant").efi"
+
+
+    if [[ "$pkgbase" == "$default_kernel_package" ]]; then
+      image="${ESP_PATH}/EFI/BOOT/BOOTX64.efi"
+    else
+      image="${ESP_PATH}/EFI/BOOT/BOOTX64-${pkgbase}.efi"
+    fi
+    #image="${ESP_PATH}/EFI/Linux/$(variant_name "linux-${version}-${MACHINE_ID}-${BUILD_ID}" "$variant").efi"
     version_name=$(variant_name "$version" "$variant")

     read -r pkgbase < "$path"
@@ -135,7 +148,7 @@
     initrd=$(mktemp)

     echo "==> Building initrd image $kernel ($version_name)"
-    dracut -q -f --no-hostonly-cmdline --kver "${version}" ${ukify_variants[$variant]} "$initrd"
+    dracut -f --no-hostonly-cmdline --kver "${version}" ${ukify_variants[$variant]} "$initrd"

     os_release=$(mktemp)
     grep -v '^BUILD_ID=' /etc/os-release > "$os_release"
@@ -156,14 +169,6 @@
     rm "$initrd"
     rm "$os_release"
   done
-
-  # Mark image as default if needed
-  if [[ "$pkgbase" == "$default_kernel_package" ]]; then
-    echo "===> Mark linux image $kernel ($version) as default"
-    bootctl set-default "linux-${version}-${MACHINE_ID}-${BUILD_ID}.efi" || {
-       echo "==> Unable to mark linux image $kernel ($version) as default due to error" >&2
-    }
-  fi
 }

 for kernel in "${!kernels[@]}"; do