Skip to content

[bootctl] Regression: Silent failure to create EFI boot entry from within chroot #36174

@kjkent

Description

@kjkent

systemd version the issue has been seen with

257.2-2-arch

Used distribution

Arch Linux

Linux kernel version used

6.12.7-arch1-1

CPU architectures issue was seen on

x86_64

Component

bootctl

Expected behaviour you didn't see

  1. bootctl {install,update} creates an entry in the EFI.

  2. If this fails, it should produce a warning.

Unexpected behaviour you saw

Finalising a new Arch Linux install (within a chroot from live installation media), running bootctl install appears to succeed, with no warnings generated.

However, bootctl does not identify the EFI in this circumstance, leading to no boot entry being created.

A user on the Arch forums reproduced this from within a chroot on their running system. It's possible that the common use of arch-chroot could be implicated; however, manually creating the entry with efibootmgr succeeds, suggesting that the EFI vars are accessible in the chroot. /sys/firmware is mounted from the host.

Steps to reproduce the problem

  1. From an Arch live media or installed system, use arch-chroot to chroot into a mounted root partition, with a boot partition mounted within.
  2. bootctl install or bootctl update produces normal output (with the omission of the line Created EFI boot entry "Linux Boot Manager" in the case of the former).
  3. bootctl status reports "Not booted with EFI"

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

There's a thread with others experiencing a similar issue on the Arch Linux Forums.

Here's console output from the initial first post there, first illustrating a successful EFI boot entry install, and then a failed one from within a chroot:

[root@saymonz-pc mnt]# bootctl install # Running on my installed system
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/systemd/systemd-bootx64.efi".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/BOOT/BOOTX64.EFI".
⚠ Mount point '/boot' which backs the random seed file is world accessible, which is a security hole! ⚠
⚠ Random seed file '/boot/loader/random-seed' is world accessible, which is a security hole! ⚠
Random seed file /boot/loader/random-seed successfully refreshed (32 bytes).
Created EFI boot entry "Linux Boot Manager".

[root@saymonz-pc mnt]# mount /dev/nvme2n1p5 /mnt/test/ # Mount installed system root partition
[root@saymonz-pc mnt]# mount /dev/nvme2n1p1 /mnt/test/boot/ # Mount ESP partition
[root@saymonz-pc mnt]# arch-chroot /mnt/test/     
[root@saymonz-pc /]# ls /sys/firmware/efi/
config_table  efivars  esrt  fw_platform_size  fw_vendor  runtime  runtime-map  systab
[root@saymonz-pc /]# bootctl install # Bootctl silently no creating EFI boot entry in arch-chroot
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/systemd/systemd-bootx64.efi".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/EFI/BOOT/BOOTX64.EFI".
⚠ Mount point '/boot' which backs the random seed file is world accessible, which is a security hole! ⚠
⚠ Random seed file '/boot/loader/random-seed' is world accessible, which is a security hole! ⚠
Random seed file /boot/loader/random-seed successfully refreshed (32 bytes).
[root@saymonz-pc /]# bootctl set-oneshot auto-windows 
Not booted with UEFI.

Thanks for all the hard work 🙏🏻

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions