From df50367973f682161d36c9f5d7f3c7be4cb7b15f Mon Sep 17 00:00:00 2001 From: rickpeters Date: Tue, 29 Sep 2026 17:10:15 +0200 Subject: [PATCH] fix: the systemd-boot entry is made with efibootmgr from the live system (bootctl in the chroot wrote HD(0,GPT,0000...), which the firmware can't load) --- CHANGELOG.md | 5 +++-- archiso/airootfs/usr/local/bin/steamify-install | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8c95f5..d8ce8ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,8 +53,9 @@ CachyOS 26.08 with Steamify built in: install CachyOS and turn the PC into a Ste (`\EFI\BOOT\BOOTX64.EFI`). Most PCs find it early and boot normally, but firmware that tries the network first waits minutes on every boot (QEMU/OVMF: PXE, HTTP boot and the EFI shell come first), and anything else that writes the fallback file (another OS) takes the boot over. - `steamify-install` now runs `bootctl --variables=yes install` from the live system; - the output is in `/var/log/steamify-bootentry.log` + `steamify-install` now registers it with `efibootmgr` from the live system, with the ESP's real + disk and partition (bootctl in the chroot writes an entry without a partition, which the firmware + can't load); the output is in `/var/log/steamify-bootentry.log` * **Installer:** Steamify's setup never asks for a password (its sudo rule is read after CachyOS's `%wheel` rule); Calamares starts with the Boost version it was linked against * **Build:** finishes cleanly as root and reports no error after a successful build; the Steamify page's diff --git a/archiso/airootfs/usr/local/bin/steamify-install b/archiso/airootfs/usr/local/bin/steamify-install index 38db51c..748dd60 100755 --- a/archiso/airootfs/usr/local/bin/steamify-install +++ b/archiso/airootfs/usr/local/bin/steamify-install @@ -22,10 +22,20 @@ for id in ${choice//,/ }; do done # systemd-boot: cachyos-installer runs `bootctl install` in a chroot, and bootctl leaves the EFI # variables alone there: no "Linux Boot Manager" boot entry, so the firmware tries the network and -# its other entries first and finds the disk's fallback path last (or never). Register it now. +# its other entries first and finds the disk's fallback path last (or never). bootctl can't be made +# to do it from the chroot either (it writes the entry without the partition: HD(0,GPT,0000...)). +# So register it from the live system, with the ESP's real disk and partition; efibootmgr puts it first. if [[ -n "$root" && -f "$root/boot/EFI/systemd/systemd-bootx64.efi" && -d /sys/firmware/efi/efivars ]]; then - arch-chroot "$root" bootctl --esp-path=/boot --variables=yes install > "$root/var/log/steamify-bootentry.log" 2>&1 - arch-chroot "$root" efibootmgr >> "$root/var/log/steamify-bootentry.log" 2>&1 + { + esp="$(findmnt -no SOURCE "$root/boot")" + disk="/dev/$(lsblk -no PKNAME "$esp" | head -n 1)" + part="$(cat "/sys/class/block/${esp##*/}/partition")" + echo "ESP: $esp (disk $disk, partition $part)" + for n in $(efibootmgr | sed -n 's/^Boot\([0-9A-Fa-f]\{4\}\)\*\{0,1\} \(Fallback \)\{0,1\}Linux Boot Manager.*/\1/p'); do + efibootmgr -q -b "$n" -B + done + efibootmgr --create --disk "$disk" --part "$part" --label "Linux Boot Manager" --loader '\EFI\systemd\systemd-bootx64.efi' + } > "$root/var/log/steamify-bootentry.log" 2>&1 fi log="$root/var/log/steamify-install.log" rule="$root/etc/sudoers.d/zz-steamify-install"