diff --git a/firstboot/firstboot.sh b/firstboot/firstboot.sh index 4e06fa9a..e615bfb5 100644 --- a/firstboot/firstboot.sh +++ b/firstboot/firstboot.sh @@ -50,15 +50,18 @@ run_step() { _step="$1" _fn="$2" _desc="${3:-$_fn}" + _step_num="${4:-0}" # Optional: step number for progress tracking if step_completed "$_step"; then log_msg "[firstboot] Skipping $_step (already completed)" + [ "$_step_num" -gt 0 ] && echo "PROGRESS=$_step_num" >> "$PROGRESS_FILE" return 0 fi log_msg "[firstboot] Running: $_desc" "$_fn" step_done "$_step" + [ "$_step_num" -gt 0 ] && echo "PROGRESS=$_step_num" >> "$PROGRESS_FILE" } # ── Set package path to bundled packages on HDD ────────────────────────────── @@ -247,16 +250,16 @@ export USB_LLM_MODELS_PATH # ── Run modules ──────────────────────────────────────────────────────────── log_msg "[firstboot] Running modules..." -run_step "gpu" clawdie_shell_gpu_detect "GPU driver detection" -run_step "nvidia" clawdie_shell_nvidia_detect "NVIDIA version selection" -run_step "pkg" clawdie_shell_pkg_setup "Package repo configuration" -run_step "ssh" clawdie_shell_ssh_setup "SSH keys + system passwords" -run_step "env" clawdie_shell_env_generate "Generate .env with secrets" -run_step "system" clawdie_shell_system_config "Hostname, rc.conf, services" -run_step "desktop" clawdie_shell_desktop_detect "Desktop enablement" -run_step "pf" clawdie_shell_pf "PF firewall + jail NAT" -run_step "tailscale" clawdie_shell_tailscale_setup "Tailscale remote access" -run_step "deploy" clawdie_shell_deploy "Extract tarball + npm install-all" +run_step "gpu" clawdie_shell_gpu_detect "GPU driver detection" 1 +run_step "nvidia" clawdie_shell_nvidia_detect "NVIDIA version selection" 2 +run_step "pkg" clawdie_shell_pkg_setup "Package repo configuration" 3 +run_step "ssh" clawdie_shell_ssh_setup "SSH keys + system passwords" 4 +run_step "env" clawdie_shell_env_generate "Generate .env with secrets" 5 +run_step "system" clawdie_shell_system_config "Hostname, rc.conf, services" 6 +run_step "desktop" clawdie_shell_desktop_detect "Desktop enablement" 7 +run_step "pf" clawdie_shell_pf "PF firewall + jail NAT" 8 +run_step "tailscale" clawdie_shell_tailscale_setup "Tailscale remote access" 8 +run_step "deploy" clawdie_shell_deploy "Extract tarball + npm install-all" 8 log_msg "[firstboot] Complete." log_msg "[firstboot] Codex CLI (headless): codex login --device-auth" diff --git a/firstboot/gui/qml-installer/main.cpp b/firstboot/gui/qml-installer/main.cpp index 8db24e2e..848fc4cf 100644 --- a/firstboot/gui/qml-installer/main.cpp +++ b/firstboot/gui/qml-installer/main.cpp @@ -435,6 +435,17 @@ public: configFile.close(); + // Detect firstboot.sh path (live ISO vs development) + QString firstbootPath; + if (QFile::exists("/usr/local/share/clawdie-iso/firstboot/firstboot.sh")) { + firstbootPath = "/usr/local/share/clawdie-iso/firstboot/firstboot.sh"; + } else if (QFile::exists("/home/clawdie/clawdie-iso/firstboot/firstboot.sh")) { + firstbootPath = "/home/clawdie/clawdie-iso/firstboot/firstboot.sh"; + } else { + qWarning() << "Error: firstboot.sh not found in any expected location"; + return false; + } + QProcess *installProcess = new QProcess(this); connect(installProcess, QOverload::of(&QProcess::finished), this, [this](int exitCode, QProcess::ExitStatus exitStatus) { @@ -444,9 +455,9 @@ public: } }); - installProcess->start("/bin/sh", QStringList() << "-c" + installProcess->start("/bin/sh", QStringList() << "-c" << "export $(cat /tmp/clawdie-install.conf | xargs) && " - "/usr/local/share/clawdie-iso/firstboot/firstboot.sh"); + "sudo -p '[sudo] password: ' " + firstbootPath); m_installationStarted = true; emit installationStartedChanged();