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.
This commit is contained in:
+38
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user