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)

This commit is contained in:
theupriser committed 2026-09-29 17:10:15 +02:00
1 parent d325209317
commit df50367973
2 files changed
+16 -5

No files matched your search

+3 -2
View File
@@ -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 (`\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), 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. 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; `steamify-install` now registers it with `efibootmgr` from the live system, with the ESP's real
the output is in `/var/log/steamify-bootentry.log` 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 * **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 `%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 * **Build:** finishes cleanly as root and reports no error after a successful build; the Steamify page's
@@ -22,10 +22,20 @@ for id in ${choice//,/ }; do
done done
# systemd-boot: cachyos-installer runs `bootctl install` in a chroot, and bootctl leaves the EFI # 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 # 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 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 fi
log="$root/var/log/steamify-install.log" log="$root/var/log/steamify-install.log"
rule="$root/etc/sudoers.d/zz-steamify-install" rule="$root/etc/sudoers.d/zz-steamify-install"