feat(installer): install on disks hidden behind Intel RST

On most recent laptops the BIOS ships set to "RST" (also called "Optane" or
"RAID") rather than AHCI: the NVMe drive is no longer on the PCIe bus
directly, it sits behind an Intel VMD controller which creates its own PCI
domain. FWS could not install on those machines.

The advice found everywhere -- switch the BIOS to AHCI -- is both unnecessary
and often impossible. Unnecessary because the kernel has read those drives
through the vmd module since 4.5, and it is in Arch's kernel. Impossible
because plenty of BIOSes expose no such toggle at all, and because on a
dual-boot machine the change stops Windows from booting. FWS therefore never
asks for it first; it is the last resort, and the Windows consequence is
spelled out when it comes to that.

Where this really bit was the reboot, not the install. The live medium sees
the drive because its kernel loads vmd, the install runs to completion, and
then the installed machine does not come up: the initramfs has no vmd, so the
root device cannot be found before it is mounted. A silent failure, invisible
during the install itself.

fws-intel-rst holds all the logic, the way fws-setup-hardware holds the driver
logic, so there is only one detection to keep correct. It reads sysfs rather
than lspci: always present, works inside the %post chroot, and it is the only
source that gives the PCI domain, which is what proves an NVMe really is
behind the VMD rather than plugged in directly. Controllers are matched on
class plus vendor, not on device IDs, which change every generation.

The %pre loads the module before anything else, and that is the step that
makes the whole thing automatic. run_pre_scripts() is called by
/usr/bin/anaconda before the kickstart is even parsed, so before the disk
inventory and long before the UI. Without it the lsblk just below found no
drive, the target fell back to its /dev/sda default, a disk that does not
exist on these machines, and clearpart aimed at nothing, leaving no safe
default. The --ensure mode returns immediately on a machine with no VMD: no
PCI rescan, no waiting, since this sits on the startup path of every install.

The %post writes vmd and nvme into the target's MODULES before mkinitcpio
runs, and adds the mdadm_udev hook for firmware RAID volumes. Both modules are
declared explicitly instead of being left to autodetect, which works from the
modules loaded at image build time: missing vmd there shows up only at reboot,
on a machine that no longer starts.

The new installer screen, fws_rst.py, is the fallback for when even that
failed. It never shows on an ordinary machine: completed returns True as soon
as the engine says there is nothing to do, and _instantiateAction destroys any
completed standalone without displaying it. Machines with no VMD controller,
or with a working one, see nothing, so there is no extra box to understand for
the majority that needs none. When it does show, it explains the situation in
plain French with one button, and no VMD, initramfs or modprobe in any visible
string. Continue stays enabled and Précédent leads back to the network screen,
so the chain back to the keyboard choice stays whole; the wizard now resolves
that chain to the last standalone actually on the stack instead of a fixed
name.

Verified on synthetic sysfs trees, 27 cases: the four hardware states, both
false-positive guards (an Intel audio controller and a non-Intel RAID
controller), initramfs rewriting including idempotence, and the display
decision with Anaconda stubbed out. A missing engine or an unexpected exit
code shows nothing rather than worrying the user. The modprobe and PCI rescan
themselves are untested, there being no VMD controller on this machine.

Signed-off-by: nocode <suzuku295@gmail.com>
This commit is contained in:
nocode committed 2026-09-14 10:57:47 +02:00
1 parent 75ae6d4885
commit 042d6b6df6
8 files changed
+891 -8

No files matched your search

@@ -47,10 +47,34 @@
# le %post installe GRUB x86_64-efi + --removable) ; BIOS → MBR (core.img
# dans l'espace post-MBR, pas besoin de partition BIOS Boot).
# • zerombr : réinitialise toute table INVALIDE au lieu de bloquer dessus.
# • Intel RST / VMD : le module vmd est chargé AVANT le lsblk, sinon un SSD
# caché derrière le contrôleur Intel n'apparaît pas et la cible retombe sur
# son défaut /dev/sda, qui n'existe pas.
# L'utilisateur garde la main dans le GUI (il peut repasser en manuel ou
# choisir un autre disque) — c'est le DÉFAUT qui est désormais sûr.
%pre --log=/tmp/fws-pre.log
set -x
# Intel RST / VMD — À FAIRE AVANT TOUT LE RESTE. Sur un portable réglé sur
# « RST » au BIOS, le SSD est caché derrière un contrôleur Intel VMD et
# n'apparaît PAS dans lsblk tant que le module vmd n'est pas chargé. Le
# « TARGET » calculé juste en dessous retomberait alors sur son défaut /dev/sda
# — un disque qui n'existe pas — et le clearpart ne viserait rien : plus de
# défaut sûr, et l'utilisateur devrait partitionner à la main.
#
# C'est le bon endroit et le seul : run_pre_scripts() est appelé par
# /usr/bin/anaconda AVANT même l'analyse du kickstart, donc avant l'inventaire
# des disques et bien avant l'interface. Rendre le disque visible ici le rend
# visible pour TOUTE la suite — ce %pre, l'inventaire d'Anaconda, puis l'écran
# « Destination de l'installation ».
#
# « --ensure » ne fait RIEN sur une machine sans VMD : il rend la main tout de
# suite, sans rescan PCI ni attente. L'écran graphique « Prise en charge du
# disque » (fws_rst.py) ne sert donc que de RATTRAPAGE, si même ça a échoué.
if [ -x /usr/local/bin/fws-intel-rst ]; then
/usr/local/bin/fws-intel-rst --ensure 2>&1 || true
fi
EFI=0
[ -d /sys/firmware/efi ] && EFI=1
TARGET="$(lsblk -drbno NAME,SIZE,TYPE,RM 2>/dev/null \
@@ -234,6 +258,21 @@ if ! grep -q '^HOOKS=' /etc/mkinitcpio.conf 2>/dev/null; then
echo "[FWS] CRITIQUE : /etc/mkinitcpio.conf illisible/absent — initramfs NON généré"
fi
# Intel RST / VMD : sur les portables réglés sur « RST » (ou « Optane », ou
# « RAID ») au BIOS, le SSD est caché derrière un contrôleur Intel VMD. Le live
# le voit (son noyau charge vmd) et l'installation se déroule normalement —
# puis la machine installée NE DÉMARRE PAS : l'initramfs ne contient pas vmd,
# donc la racine est introuvable avant même d'être montée. C'est un échec
# silencieux, invisible à l'installation, et c'est pour ça que ça passe ici et
# PAS plus loin : un hook pacman peut lancer « mkinitcpio -P » dès l'étape 1.
# Le script ne touche à rien si la machine n'a pas de VMD.
if [ -x /usr/local/bin/fws-intel-rst ]; then
/usr/local/bin/fws-intel-rst --persist / 2>&1 || true
else
echo "[FWS] AVERTISSEMENT : fws-intel-rst absent — sur une machine Intel RST,"
echo "[FWS] le disque installé pourrait ne pas démarrer."
fi
# --- 1) Purge des résidus « live » (modèle Sabayon = live copié tel quel) ----
# Ce qui est propre au live casserait ou pollue le système installé.
rm -f /etc/systemd/system/getty@tty1.service.d/autologin.conf