fix(installer): improve bootloader installation and debug logging
- 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.
This commit is contained in:
@@ -29,12 +29,41 @@ if command -v liveinst >/dev/null 2>&1; then
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user