Files
BlackAngelTV eadd5c2815 feat(installer): show each install phase on the progress screen
The progress screen sat on "Running post-installation scripts" for the whole
%post with a bar that never moved, so a slow desktop install looked like a
hang. The kickstart phases now publish what they are doing through
fws-install-step, the scripts task turns those percentages into one step per
phase with a message naming the running script, and the boss reserves the same
number of steps so the bar actually follows them. A title is taken from each
script's "# FWS-TITLE:" line, and progress stays cosmetic: a missing file or a
D-Bus failure falls back to the previous single step.
2026-10-29 21:09:47 +01:00

34 lines
1.2 KiB
Bash

#!/bin/sh
# FWS — publie l'avancement de l'installation pour l'écran de progression
# d'Anaconda (pyanaconda/modules/runtime/scripts/runtime.py lit ce fichier et
# le transforme en « Script 2/3 · Installation du bureau — 62 % »).
#
# Usage : fws-install-step <pourcentage 0-100> "<ce qui est en cours>"
#
# Le fichier est toujours écrit dans le rootfs COURANT (/var/log/…) : dans le
# %post chrooté c'est le système installé (que l'installeur lit via
# /mnt/sysroot), dans les %post --nochroot c'est le live. Écriture atomique
# (fichier temporaire + mv) pour que l'installeur ne lise jamais une ligne à
# moitié écrite.
#
# Best-effort : le code retour est toujours 0 — un souci de progression ne doit
# jamais faire échouer l'installation (les %post sont en `set -x`, pas en
# `set -e`, mais autant ne pas tenter le diable).
set -u
FILE=/var/log/fws-install-progress
[ "$#" -ge 2 ] || exit 0
PERCENT="$1"
shift
case "$PERCENT" in
''|*[!0-9]*) exit 0 ;;
esac
[ "$PERCENT" -le 100 ] || PERCENT=100
mkdir -p "${FILE%/*}" 2>/dev/null || exit 0
if printf '%s|%s\n' "$PERCENT" "$*" > "$FILE.tmp" 2>/dev/null; then
mv -f "$FILE.tmp" "$FILE" 2>/dev/null || rm -f "$FILE.tmp" 2>/dev/null
fi
exit 0