installer: show dashboard during ISO install
This commit is contained in:
5 files changed
+628
-6
No files matched your search
@@ -23,10 +23,21 @@ class PhaseError(Exception):
|
||||
def run(ctx: InstallContext, phases: list[tuple[str, PhaseFn]]) -> None:
|
||||
ctx.state_dir.mkdir(parents=True, exist_ok=True)
|
||||
state_path = ctx.state_dir / "state.json"
|
||||
state = {"started_at": time.time(), "phases": []}
|
||||
state = {
|
||||
"started_at": time.time(),
|
||||
"total_phases": len(phases),
|
||||
"current_index": 0,
|
||||
"current_phase": "Starting installation",
|
||||
"phases": [],
|
||||
}
|
||||
_write_state(state_path, state)
|
||||
|
||||
for name, fn in phases:
|
||||
for index, (name, fn) in enumerate(phases):
|
||||
state["current_index"] = index
|
||||
state["current_phase"] = name
|
||||
state["phase_started_at"] = time.time()
|
||||
_write_state(state_path, state)
|
||||
|
||||
info(f"› {name}")
|
||||
started = time.time()
|
||||
try:
|
||||
@@ -49,6 +60,8 @@ def run(ctx: InstallContext, phases: list[tuple[str, PhaseFn]]) -> None:
|
||||
state["phases"].append({"name": name, "status": "ok", "elapsed": elapsed})
|
||||
_write_state(state_path, state)
|
||||
|
||||
state["current_index"] = max(len(phases) - 1, 0)
|
||||
state["current_phase"] = "Installation complete"
|
||||
state["finished_at"] = time.time()
|
||||
_write_state(state_path, state)
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ Phase ordering (protected / pre-mounted):
|
||||
arch_install_base → archinstall used as pacstrap + users +
|
||||
packages driver only; no bootloader,
|
||||
no fstab, no mkinitcpio
|
||||
configure_protected_boot → Omarchy-owned fstab/crypttab/mkinitcpio/
|
||||
bootloader — implemented in Step 8
|
||||
configure_protected_boot → protected fstab/crypttab + Limine EFI handoff;
|
||||
final UKI build still happens in finalizer
|
||||
run_chroot_finalizer → same
|
||||
configure_login → same
|
||||
validate_boot_protected → implemented in Step 8
|
||||
@@ -1047,7 +1047,26 @@ def cleanup_protected_state(ctx: InstallContext) -> None:
|
||||
# finish: prompt for reboot. Bind mounts are unwound in main()'s finally.
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
def _stop_install_dashboard() -> None:
|
||||
pid = os.environ.get("OMARCHY_INSTALL_DASHBOARD_PID")
|
||||
if not pid:
|
||||
return
|
||||
try:
|
||||
os.kill(int(pid), 15)
|
||||
except (OSError, ValueError):
|
||||
pass
|
||||
# Give the shell dashboard a moment to restore the cursor before gum draws.
|
||||
time.sleep(0.1)
|
||||
try:
|
||||
with open("/dev/tty", "w", encoding="utf-8") as tty:
|
||||
tty.write("\033[?25h\033[H\033[2J")
|
||||
tty.flush()
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
def finish(ctx: InstallContext) -> None:
|
||||
_stop_install_dashboard()
|
||||
info("Installation finished. Reboot when ready.")
|
||||
if confirm("Reboot now?", default=True):
|
||||
os.system("reboot")
|
||||
Reference in new issue
Block a user