9e3cca8efc
- Add fallback GRUB installation for UEFI systems using --removable flag to ensure boot without NVRAM entries - Fix BIOS disk detection for LVM root partitions by using lsblk with proper filtering instead of pkname - Enhance debug logging to include %post chroot phase logs (fws-post.log) which indicate bootloader success - Automatically mount and retrieve installation logs from the installed disk to verify bootloader installation - Add detailed comments explaining UEFI/BIOS fallback strategies and LVM-aware disk detection These changes ensure the system can boot even when NVRAM entries are missing or forgotten by firmware, and provide better visibility into bootloader installation success during the debug phase.
85 lines
3.4 KiB
Bash
85 lines
3.4 KiB
Bash
#!/bin/sh
|
|
# Lancé par startx (cf. /root/.zprofile), uniquement dans le live FWS.
|
|
if [ ! -d /run/archiso ]; then
|
|
exit 0
|
|
fi
|
|
|
|
xsetroot -solid "#1a1a2e"
|
|
|
|
# Openbox en arrière-plan : gestionnaire de fenêtres pour l'installateur.
|
|
openbox &
|
|
_OB_PID=$!
|
|
|
|
# Chantier C : lance l'installateur Anaconda en mode live s'il est présent.
|
|
# « liveinst » re-exécute anaconda (ici on est déjà root → pas de pkexec/polkit).
|
|
#
|
|
# DEBUG (premier run réel) : on CAPTURE stdout+stderr — un plantage d'import
|
|
# précoce de Python n'apparaît QUE là, pas dans /tmp/anaconda.log — et, si
|
|
# liveinst quitte en erreur, on regroupe tous les logs Anaconda et on les AFFICHE
|
|
# (zenity) au lieu de laisser startx rendre la main → .zprofile relancerait X en
|
|
# boucle (symptôme « fond bleu qui clignote/reboote »). On NE rend jamais la main
|
|
# à startx : on reste sur Openbox pour lire les logs / rebooter proprement.
|
|
if command -v liveinst >/dev/null 2>&1; then
|
|
LIVEINST_LOG=/tmp/fws-liveinst.log
|
|
liveinst >"$LIVEINST_LOG" 2>&1
|
|
rc=$?
|
|
|
|
# ATTENTION : liveinst NE propage PAS le code de sortie d'anaconda — il
|
|
# enchaîne son propre nettoyage et sort souvent 0 même quand anaconda a
|
|
# planté. On ne se fie donc PAS à $rc : en phase debug on regroupe TOUS les
|
|
# logs et on les affiche systématiquement (zenity). Le traceback Python d'un
|
|
# crash d'import précoce n'est QUE dans $LIVEINST_LOG (stderr capturé).
|
|
# Le %post chrooté (grub-install / mkinitcpio = ce qui rend le disque
|
|
# BOOTABLE) écrit /var/log/fws-post.log SUR LE DISQUE INSTALLÉ, qu'Anaconda
|
|
# a démonté. On réactive le LVM et on remonte (lecture seule) le 1er système
|
|
# qui contient ce log : c'est LUI qui dit si le bootloader a bien été posé.
|
|
FWS_POST=""
|
|
vgchange -ay >/dev/null 2>&1 || true
|
|
udevadm settle --timeout=10 >/dev/null 2>&1 || true
|
|
mkdir -p /run/fws-installed
|
|
for _dev in /dev/mapper/*-root /dev/mapper/* /dev/sd*[0-9] /dev/vd*[0-9] /dev/nvme*n*p*; do
|
|
[ -b "$_dev" ] || continue
|
|
mount -o ro "$_dev" /run/fws-installed 2>/dev/null || continue
|
|
if [ -f /run/fws-installed/var/log/fws-post.log ]; then
|
|
FWS_POST=/run/fws-installed/var/log/fws-post.log
|
|
break
|
|
fi
|
|
umount /run/fws-installed 2>/dev/null || true
|
|
done
|
|
|
|
DBG=/tmp/fws-debug.txt
|
|
{
|
|
echo "===== liveinst sorti (code $rc) — logs Anaconda ====="
|
|
echo
|
|
echo "########## sortie liveinst (stdout+stderr) ##########"
|
|
cat "$LIVEINST_LOG" 2>/dev/null
|
|
echo
|
|
echo "########## %post chrooté = grub-install / mkinitcpio (/var/log/fws-post.log) ##########"
|
|
echo "########## >>> C'EST CE BLOC QUI DIT SI LE DISQUE VA BOOTER <<< ##########"
|
|
if [ -n "$FWS_POST" ]; then
|
|
cat "$FWS_POST" 2>/dev/null
|
|
else
|
|
echo "(log introuvable — disque installé non remonté)"
|
|
fi
|
|
echo
|
|
echo "########## %post --nochroot (/tmp/fws-post-nochroot.log) ##########"
|
|
cat /tmp/fws-post-nochroot.log 2>/dev/null || echo "(absent)"
|
|
for f in /tmp/anaconda.log /tmp/syslog /tmp/program.log \
|
|
/tmp/storage.log /tmp/dbus.log /tmp/packaging.log /tmp/X.log; do
|
|
echo
|
|
echo "########## $f ##########"
|
|
tail -n 200 "$f" 2>/dev/null || echo "(absent)"
|
|
done
|
|
} >"$DBG" 2>&1
|
|
|
|
if command -v zenity >/dev/null 2>&1; then
|
|
zenity --text-info --title="FWS — logs Anaconda (sortie $rc)" \
|
|
--filename="$DBG" --width=1100 --height=720 2>/dev/null &
|
|
fi
|
|
|
|
wait "$_OB_PID"
|
|
else
|
|
echo "[FWS] Anaconda absent de l'ISO — à builder (setup-aur.sh) + ajouter à packages.x86_64." >&2
|
|
exec openbox
|
|
fi
|