From 6a1ce741694fa0d5db29ac6ff82286d3355efc61 Mon Sep 17 00:00:00 2001 From: nocode Date: Thu, 9 Jul 2026 14:40:35 +0200 Subject: [PATCH] feat(fws_recap): add windows dual-boot configuration display section Add _windows_dualboot_lines() function to read and parse /tmp/fws-windows configuration file. Display dual-boot status, disk allocation, ISO information, and conflict warnings when the selected Windows disk overlaps with FWS installation targets. Integrate the windows dual-boot section into the installation summary output. --- .../pyanaconda/ui/gui/spokes/fws_recap.py | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/configs/baseline/airootfs/usr/lib/python3.14/site-packages/pyanaconda/ui/gui/spokes/fws_recap.py b/configs/baseline/airootfs/usr/lib/python3.14/site-packages/pyanaconda/ui/gui/spokes/fws_recap.py index b2ceb8a..81a692c 100644 --- a/configs/baseline/airootfs/usr/lib/python3.14/site-packages/pyanaconda/ui/gui/spokes/fws_recap.py +++ b/configs/baseline/airootfs/usr/lib/python3.14/site-packages/pyanaconda/ui/gui/spokes/fws_recap.py @@ -165,6 +165,38 @@ def _config_lines(): return lines, desk, method +def _windows_dualboot_lines(selected): + """Section dual-boot Windows : lit /tmp/fws-windows (parse LITTÉRAL, jamais + sourcé), montre le disque qui SERA EFFACÉ et ALERTE en cas de conflit avec la + cible d'installation FWS (même disque choisi pour les deux).""" + state = {} + try: + with open("/tmp/fws-windows") as fh: + for line in fh: + if "=" in line and not line.lstrip().startswith("#"): + key, _, val = line.partition("=") + state[key.strip()] = val.strip() + except OSError: + return [] + if state.get("enabled") != "1": + return [" • Dual-boot Windows : désactivé (FWS uniquement)"] + disk = state.get("disk", "?") + size = state.get("size_gib", "?") + iso = state.get("iso", "") + iso_name = iso.rsplit("/", 1)[-1] if iso else "(aucune ISO fournie)" + lines = [ + f" • Dual-boot Windows : ACTIVÉ — {disk} ({size} GiO NTFS)", + f" ISO : {iso_name}", + f" ⚠ TOUT le disque {disk} sera EFFACÉ et dédié à Windows.", + ] + base = disk.rsplit("/", 1)[-1] + if base and base in selected: + lines.append( + f" ⛔ CONFLIT : {disk} est AUSSI une cible d'installation FWS —" + " choisissez des disques DIFFÉRENTS (sinon l'un écrase l'autre).") + return lines + + def _build_summary(): config_lines, desk, method = _config_lines() config_text = "\n".join(config_lines) \ @@ -214,6 +246,9 @@ def _build_summary(): extras = ("Steam, Wine, VR (Monado/OpenXR), winboat-bin" if desk != "cli" else "rien de plus (choix CLI)") + win_text = "\n".join(_windows_dualboot_lines(selected)) \ + or " • Dual-boot Windows : désactivé (FWS uniquement)" + return f"""\ ══════════════════════════════════════════════════════════ FWS — RÉCAPITULATIF AVANT INSTALLATION @@ -226,6 +261,9 @@ DISQUES {disk_warn} {disk_text} +DUAL-BOOT WINDOWS (gaming — Valorant/LoL) +{win_text} + MATÉRIEL DÉTECTÉ • Virtualisation : {virt} • Réseau : {net}