Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel-install 90-uki-copy.install fails with ... is missing .efi suffix. #26477

Closed
05storm26 opened this issue Feb 18, 2023 · 9 comments
Closed

Comments

@05storm26
Copy link

05storm26 commented Feb 18, 2023

systemd version the issue has been seen with

core/systemd 253-1 [installed]

Used distribution

Arch

Linux kernel version used

6.1.12-arch1-1

CPU architectures issue was seen on

x86_64

Component

kernel-install

Expected behaviour you didn't see

90-uki-copy.install shouldn't fail when the mkinitcpio hook generates the uki image to the proper place.

Unexpected behaviour you saw

$ sudo kernel-install -v add 6.1.11-hardened1-1-hardened /usr/lib/modules/6.1.11-hardened1-1-hardened/vmlinuz /boot/intel-ucode.img
[...]
+ mkinitcpio -k '6.1.11-hardened1-1-hardened' --kernelimage /usr/lib/modules/6.1.11-hardened1-1-hardened/vmlinuz --microcode /boot/intel-ucode.img -U '/efi/EFI/Linux/46e5b7b51f69426fade60fe0cc165d7a-6.1.11-hardened1-1-hardened.efi'
==> Starting build: 6.1.11-hardened1-1-hardened
  -> Running build hook: [base]
  -> Running build hook: [systemd]
  -> Running build hook: [sd-vconsole]
  -> Running build hook: [kms]
==> WARNING: Possibly missing firmware for module: ast
  -> Running build hook: [sd-plymouth]
  -> Running build hook: [btrfs]
  -> Running build hook: [autodetect]
  -> Running build hook: [keyboard]
==> WARNING: Possibly missing firmware for module: xhci_pci
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [lvm2]
  -> Running build hook: [sd-encrypt]
==> WARNING: Possibly missing firmware for module: qat_4xxx
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
  -> Running build hook: [sd-shutdown]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: /tmp/mkinitcpio.yhhdte
==> Image generation successful
==> Creating unified kernel image: /efi/EFI/Linux/46e5b7b51f69426fade60fe0cc165d7a-6.1.11-hardened1-1-hardened.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
+/usr/lib/kernel/install.d/90-loaderentry.install add 6.1.11-hardened1-1-hardened /efi/46e5b7b51f69426fade60fe0cc165d7a/6.1.11-hardened1-1-hardened /usr/lib/modules/6.1.11-hardened1-1-hardened/vmlinuz /boot/intel-ucode.img
+/usr/lib/kernel/install.d/90-uki-copy.install add 6.1.11-hardened1-1-hardened /efi/46e5b7b51f69426fade60fe0cc165d7a/6.1.11-hardened1-1-hardened /usr/lib/modules/6.1.11-hardened1-1-hardened/vmlinuz /boot/intel-ucode.img
Error: /usr/lib/modules/6.1.11-hardened1-1-hardened/vmlinuz is missing .efi suffix.

Steps to reproduce the problem

When the layout is set to uki the 90-uki-copy.install fails with Error: /usr/lib/modules/6.1.11-hardened1-1-hardened/vmlinuz is missing .efi suffix., when the initramfs generation generates the uki image directly to the destination <esp>/EFI/Linux/<target>. 90-uki-copy shouldn't fail when the mkinitcpio hook generates the uki image to the proper place, and there is nothing to be copied by 90-uki-copy.

Additional program output to the terminal or log subsystem illustrating the issue

No response

@05storm26 05storm26 added the bug 🐛 Programming errors, that need preferential fixing label Feb 18, 2023
@05storm26
Copy link
Author

cc @behrmann

@YHNdnzj
Copy link
Member

YHNdnzj commented Feb 18, 2023

IIUC isn't this a mkinitcpio issue? The resulting files should be stored in $KERNEL_INSTALL_STAGING_AREA rather than being installed to esp/EFI/Linux directly.

@05storm26
Copy link
Author

I was under the impression that that is only optional and that the initrd generator can do whatever they want including installing the image to where they wish.

@behrmann
Copy link
Contributor

This is something to be fixed in mkinitcpio and is mostly an artifact that we reused the name uki for the layout before a systemd version with 90-uki-copy.install was released, which maybe wasn't the greatest idea, so putting the file into $KERNEL_INSTALL_STAGING_AREA didn't make sense, because from there it wouldn't get anywhere. As a workaround until this is fixed I recommend masking 90-uki-copy.intall in /etc/kernel/install.d (make a symlink of the same name pointing to /dev/null).

@05storm26
Copy link
Author

05storm26 commented Feb 18, 2023

Okay that works, not sure if there is a mkinitcpio bug about this yet or not. I have added this to the wiki.

@behrmann
Copy link
Contributor

Cool, thanks! I'll submit a MR to address this to mkinitcpio on Monday.

@yuwata yuwata added not-our-bug and removed bug 🐛 Programming errors, that need preferential fixing labels Feb 18, 2023
@nougad
Copy link

nougad commented Feb 19, 2023

I just created a issue for mkinicpio: https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio/-/issues/163

@behrmann
Copy link
Contributor

I think this bug can be closed now, since this has a pending fix downstream

@poettering
Copy link
Member

Ok, let's close this then.

archlinux-github pushed a commit to archlinux/mkinitcpio that referenced this issue Feb 20, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants