Skip to content

Commit

Permalink
Put uki image into kernel-install staging folder
Browse files Browse the repository at this point in the history
Systemd provides a kernel-install staging directory but it was not used
because the artifacts were not automatically copied from the staging
location to the final EFI folder. Systemd 253 includes a new
[90-uki-copy.install](https://github.com/systemd/systemd/blob/main/src/kernel-install/90-uki-copy.install)
script which expects the image in the staging directory and copies it
to EFI/Linux. The uki-copy script will fail if the file does
not exist.

To fix this the uki image is now written to the staging folder and the
uki-copy script puts it afterwards in the right location. This will only
work with systemd 253 and later.

Systemd commit: systemd/systemd@0ccfd35
Systemd bug: systemd/systemd#26477

Fixes #163
  • Loading branch information
nougad committed Feb 19, 2023
1 parent 06ab2e6 commit 40ec87e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions 50-mkinitcpio.install
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ MICROCODE=()
KERNEL_IMAGE_FLAGS=()
case "$KERNEL_INSTALL_LAYOUT" in
uki)
IMAGE_PATH="$KERNEL_INSTALL_BOOT_ROOT/EFI/Linux"
install -d -- "$IMAGE_PATH" # create /<esp>/EFI/Linux if it not exists yet
# TODO: remove once https://github.com/systemd/systemd/pull/26119 is merged
# and a systemd version including it is packaged
install -d -- "$KERNEL_INSTALL_BOOT_ROOT"/EFI/Linux

IMAGE_PATH="$IMAGE_PATH/$KERNEL_INSTALL_ENTRY_TOKEN-$KERNEL_VERSION.efi"
IMAGE_PATH="$KERNEL_INSTALL_STAGING_AREA/uki.efi"
IMAGE_GENERATION_FLAG="-U"

# autodetecting microcode images by known location
Expand Down Expand Up @@ -46,7 +47,6 @@ esac
case $COMMAND in
add)
(( KERNEL_INSTALL_VERBOSE )) && echo "+ mkinitcpio -k '$KERNEL_VERSION'" "${KERNEL_IMAGE_FLAGS[@]}" "${MICROCODE[@]}" "$IMAGE_GENERATION_FLAG '$IMAGE_PATH'"
#shellcheck disable=SC2046
mkinitcpio -k "$KERNEL_VERSION" "${KERNEL_IMAGE_FLAGS[@]}" "${MICROCODE[@]}" "$IMAGE_GENERATION_FLAG" "$IMAGE_PATH"
;;
remove)
Expand Down

0 comments on commit 40ec87e

Please sign in to comment.