fix(boot): never write NVRAM on Intel RST machines
Seen on real RST hardware: the installed system boots once, then never again, the firmware no longer finding a bootable disk. What is established. In the installer's chroot efivars is not reachable, so nothing is written to NVRAM and the firmware boots EFI/BOOT/BOOTX64.EFI, which it finds by scanning the ESP. That first boot works. Then fws-grub-finalize runs grub-install again, and this time efivars answers: it creates a "FWS" entry and puts it first in the boot order. That is the only thing this chain changes at firmware level between the two boots, and firmware level is where the second one fails. What is assumed, not verified for lack of a VMD machine: why that entry is unusable. Under VMD, Linux sees the NVMe in a synthetic PCI domain (10000:...) that the vmd module creates and the firmware knows nothing about, so a device path computed from that view resolves to nothing. "efibootmgr -v" on an affected machine would settle it. On any machine with an Intel VMD controller, FWS now relies solely on the --removable path, which the first boot proves works. Detection goes through fws-intel-rst (exit codes 10/11/12), the project's single VMD logic. Machines without VMD are untouched and keep their NVRAM entry. There were three NVRAM writers, and all three are gated: - the kickstart %post, where the write fails anyway today but would break even the first boot in an environment that exposed efivars to the chroot; - fws-grub-finalize, both grub-install and the efibootmgr -c fallback; - fws-recovery, which was the worst of them. It goes through arch-chroot, and unlike Anaconda's chroot, arch-chroot mounts efivars, so the write succeeded there, from the ISO as well as from the installed system. A user whose RST machine would not boot would run "Réparer FWS", and the repair would recreate exactly the entry that stops it from booting. Also in fws-grub-finalize: two lsblk calls took the disk from "lsblk -s", which draws a tree, and got "└─/dev/nvme0n1" (checked on a real NVMe). The efibootmgr fallback therefore always received a garbage device and never created its entry, and the ESP search could fall back to the first ESP on the system, Windows' on a dual-boot. The kickstart had already fixed this very trap in its BIOS branch; the UEFI branch here had been missed. Fixing it alone would have re-armed the efibootmgr writer on VMD, which is why it lands together with the gate. Tested by replacing the system tools with recording stubs: fws-grub-finalize and fws-recovery each over five cases (no VMD, VMD in its three states, engine missing), plus the engine's six detection cases. In every case the --removable path is still installed, since on these machines it becomes the only way in. Signed-off-by: nocode <suzuku295@gmail.com>
This commit is contained in:
3 files changed
+73
-7
No files matched your search
@@ -394,9 +394,19 @@ install_grub() {
|
||||
echo "[FWS] aucune ESP accessible dans le chroot — le 1er démarrage finalisera GRUB"
|
||||
return 1
|
||||
fi
|
||||
# (a) Entrée NVRAM dédiée (best effort, si efibootmgr dispo) :
|
||||
# (a) Entrée NVRAM dédiée (best effort, si efibootmgr dispo) — SAUF sur
|
||||
# Intel VMD/RST : le chemin écrit depuis Linux vise un domaine PCI
|
||||
# que le firmware ne connaît pas (cf. fws-grub-finalize). Dans ce
|
||||
# chroot efivars est normalement inaccessible et l'écriture échoue
|
||||
# de toute façon ; --no-nvram garantit qu'un environnement où il le
|
||||
# serait ne casse pas dès le 1er démarrage.
|
||||
_nvram=""
|
||||
if [ -x /usr/local/bin/fws-intel-rst ]; then
|
||||
/usr/local/bin/fws-intel-rst --detect >/dev/null 2>&1
|
||||
case $? in 10|11|12) _nvram="--no-nvram" ;; esac
|
||||
fi
|
||||
grub-install --target=x86_64-efi --efi-directory=/boot/efi \
|
||||
--bootloader-id=FWS --recheck || true
|
||||
--bootloader-id=FWS $_nvram --recheck || true
|
||||
# (b) Chemin de SECOURS EFI/BOOT/BOOTX64.EFI (--removable) : boote SANS
|
||||
# aucune entrée NVRAM. INDISPENSABLE en VM / sans réseau / firmware
|
||||
# qui « oublie » l'entrée — c'est lui qui garantit le 1er boot UEFI.
|
||||
|
||||
Reference in new issue
Block a user