systemd 253 90-uki-copy.install is fails because mkinitcpio puts UKI efi image into /boot
See https://github.com/systemd/systemd/issues/26477 and https://wiki.archlinux.org/title/Unified_kernel_image#kernel-install and https://github.com/systemd/systemd/commit/0ccfd3564b2532a4da6526a9e030362c4a142b77
90-uki-copy.install, which copies a UKI "uki.efi" from the staging area or any file with the .efi extension given on the command line to
$BOOT/EFI/Linux/$ENTRY_TOKEN-$KERNEl_VERSION(+$TRIES).efi
https://github.com/systemd/systemd/blob/main/src/kernel-install/90-uki-copy.install#L82 fails with Error: /usr/lib/modules/6.1.12-arch1-1/vmlinuz is missing .efi suffix.
because it expects the uki file right next to the vmlinuz and then wants to copy it into boot while mkinitcpio directly writes to /boot/EFI/Linux/aee901b403f349d492561b8addecc2a8-6.1.12-arch1-1.efi
:
$ sudo kernel-install add 6.1.12-arch1-1 /usr/lib/modules/6.1.12-arch1-1/vmlinuz --verbose
+ mkinitcpio -k 6.1.12-arch1-1 --kernelimage /usr/lib/modules/6.1.12-arch1-1/vmlinuz --microcode /boot/intel-ucode.img -U /boot/EFI/Linux/aee901b403f349d492561b8addecc2a8-6.1.12-arch1-1.efi
==> Starting build: 6.1.12-arch1-1
-> Running build hook: [base]
-> Running build hook: [systemd]
-> Running build hook: [autodetect]
-> Running build hook: [keyboard]
==> WARNING: Possibly missing firmware for module: xhci_pci
-> Running build hook: [sd-vconsole]
-> Running build hook: [modconf]
-> Running build hook: [block]
-> Running build hook: [sd-encrypt]
==> WARNING: Possibly missing firmware for module: qat_4xxx
-> Running build hook: [filesystems]
-> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: /tmp/mkinitcpio.T3TSRG
==> Image generation successful
==> Creating unified kernel image: /boot/EFI/Linux/dead..beef-6.1.12-arch1-1.efi
-> Using UEFI stub: /usr/lib/systemd/boot/efi/linuxx64.efi.stub
-> Using cmdline file: /etc/kernel/cmdline
-> Using os-release file: /etc/os-release
-> Using microcode image: /boot/intel-ucode.img
==> Unified kernel image generation successful
Error: /usr/lib/modules/6.1.12-arch1-1/vmlinuz is missing .efi suffix.
--- a/usr/lib/kernel/install.d/50-mkinitcpio.install 2023-02-19 15:28:43.725386708 +0100
+++ b/usr/lib/kernel/install.d/50-mkinitcpio.install 2023-02-19 15:28:03.749375640 +0100
@@ -14,10 +14,7 @@
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
-
- 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
fixes the issue but breaks for systems without 90-uki-copy.install