feat(installer): show the real sub-steps of GRUB, initramfs, desktop and drivers

The progress screen only knew twelve coarse phases: "Installing GRUB" then
nothing until "Keyboard and language", and a bar stuck for minutes while
pacman pulled a whole desktop. Nobody could tell a slow mirror from a hang,
and a failure (no ESP, no initramfs) only existed in the log.

Every real action now publishes a line: kernel copy, mkinitcpio and its
result, each GRUB step (ESP found and mounted or missing, UEFI entry with
the VMD no-NVRAM note, EFI/BOOT fallback, BIOS MBR, menu generation,
first-boot check), desktop activation. For pacman, fws-install-step gains a
--pacman filter that reads the transaction output and turns it into
"download i/N — package", "install i/N — package", hooks, download size and
errors, moving the bar per package. fws-setup-hardware uses the same filter
when the kickstart hands it a FWS_PROGRESS range, and stays silent when run
from fws-drivers or a terminal.

The duplicated Wi-Fi profile copy left by the Main merge is folded into one.
This commit is contained in:
nocode committed 2026-11-03 21:07:18 +01:00
1 parent d720d56f8e
commit dadd46fe3c
5 files changed
+177 -30

No files matched your search

@@ -48,6 +48,20 @@ while [ $# -gt 0 ]; do
done
log() { echo "[FWS-hw] $*"; }
# Écran de progression de l'installateur. Actif SEULEMENT quand le kickstart
# passe FWS_PROGRESS="<de> <à>" (plage de pourcentage réservée à cette phase) :
# depuis fws-drivers ou un terminal il n'y a pas d'écran à nourrir. Best
# effort, jamais bloquant.
P_FROM=""; P_TO=""
case "${FWS_PROGRESS:-}" in
[0-9]*\ [0-9]*) P_FROM="${FWS_PROGRESS%% *}"; P_TO="${FWS_PROGRESS##* }" ;;
esac
progress() {
[ -n "$P_FROM" ] && command -v fws-install-step >/dev/null 2>&1 \
&& fws-install-step "$1" "Pilotes : $2"
return 0
}
ok() { echo " ✔ $*"; }
ko() { echo " ✘ $*"; }
@@ -360,8 +374,11 @@ if [ "${#SELECTED[@]}" -gt 0 ]; then
log "groupe « ${G_LABEL[$id]} »"
WANTED_PKGS="$WANTED_PKGS ${G_PKGS[$id]}"
done
progress "$P_FROM" "détecté — $(for id in "${SELECTED[@]}"; do printf '%s, ' "${G_LABEL[$id]%% —*}"; done | sed 's/, $//')"
progress "$P_FROM" "synchronisation des dépôts (réseau)"
pacman -Sy --noconfirm || log "synchro pacman échouée (réseau ?)"
progress "$P_FROM" "vérification des paquets disponibles"
# Filtre aux paquets RÉELLEMENT existants : un nom manquant ou renommé ne
# doit pas faire échouer toute la transaction. Les absents sont NOMMÉS —
@@ -377,7 +394,17 @@ if [ "${#SELECTED[@]}" -gt 0 ]; then
[ -n "$MISSING" ] && log "AVERTISSEMENT : paquets introuvables dans les dépôts :$MISSING"
if [ -n "$VALID" ]; then
log "installation :$VALID"
if pacman -S --noconfirm --needed $VALID; then
if [ -n "$P_FROM" ]; then
# Sortie filtrée pour l'écran de progression ; le code retour de
# pacman est dans PIPESTATUS, le filtre sort toujours en 0.
pacman -S --noconfirm --needed $VALID 2>&1 \
| fws-install-step --pacman "$P_FROM" "$((P_TO - 1))" "Pilotes"
_PACMAN_RC=${PIPESTATUS[0]}
else
pacman -S --noconfirm --needed $VALID
_PACMAN_RC=$?
fi
if [ "$_PACMAN_RC" -eq 0 ]; then
# polices : le cache fontconfig doit inclure la police emoji qui
# vient d'être installée, sinon les applications déjà lancées ne la
# voient qu'au prochain démarrage de session.
@@ -456,6 +483,7 @@ fi
# idempotent : on peut la relancer autant de fois qu'on veut.
echo
log "vérification des services et des connexions"
progress "$P_TO" "vérification et réparation des services (réseau, son, Bluetooth…)"
# --- Réseau -----------------------------------------------------------------
if systemctl is-enabled NetworkManager.service >/dev/null 2>&1; then