From 910e5d149946311c1ca649ee0be75b89a8ba8f3c Mon Sep 17 00:00:00 2001 From: Jino Jose Date: Tue, 30 Jun 2026 16:01:59 +0530 Subject: [PATCH] Quiet first boot installer output --- autoinstall/firstboot-setup.sh | 25 +++++++++++++++++-------- install.sh | 4 ++-- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/autoinstall/firstboot-setup.sh b/autoinstall/firstboot-setup.sh index 98bec2e..33c6a53 100644 --- a/autoinstall/firstboot-setup.sh +++ b/autoinstall/firstboot-setup.sh @@ -8,8 +8,10 @@ set -e AIPACKAGE_DIR="/opt/aipackage" LOG_FILE="/var/log/cezen-setup.log" +INSTALL_LOG_FILE="/var/log/cezen-install.log" export TERM="${TERM:-linux}" -exec > >(tee -a "$LOG_FILE") 2>&1 +touch "$LOG_FILE" "$INSTALL_LOG_FILE" +chmod 0644 "$LOG_FILE" "$INSTALL_LOG_FILE" detect_iface() { ip route show default 2>/dev/null | awk '/default/ {print $5; exit}' @@ -254,12 +256,19 @@ PY chown root:cezen /opt/cezen/license.json 2>/dev/null || true chmod 0640 /opt/cezen/license.json -# Mark as configured so this wizard doesn't run again -touch /opt/cezen/.setup-done - -# Run the installer -bash "$AIPACKAGE_DIR/install.sh" --tier="$TIER" - whiptail --title "$TITLE" \ - --msgbox "\nInstaller command finished.\n\nFor detailed logs, run:\n sudo journalctl -u cezen-phase2.service -f\n sudo tail -f /var/log/cezen-install.log" \ + --infobox "\nInstalling Nexus One AI stack...\n\nThis can take several minutes.\n\nLogs are being written to:\n $INSTALL_LOG_FILE" \ $H $W + +if bash "$AIPACKAGE_DIR/install.sh" --tier="$TIER" >> "$INSTALL_LOG_FILE" 2>&1; then + # Mark as configured only after the installer finishes successfully. + touch /opt/cezen/.setup-done + whiptail --title "$TITLE" \ + --msgbox "\nInstaller command finished successfully.\n\nPortal:\n http://localhost\n\nFor detailed logs, run:\n sudo tail -f $INSTALL_LOG_FILE" \ + $H $W +else + whiptail --title "$TITLE" \ + --msgbox "\nInstaller command failed.\n\nThe setup wizard will run again on next boot.\n\nCheck the log with:\n sudo tail -n 120 $INSTALL_LOG_FILE" \ + $H $W + exit 1 +fi diff --git a/install.sh b/install.sh index d72e4c2..f3458ad 100644 --- a/install.sh +++ b/install.sh @@ -222,8 +222,8 @@ Wants=network-online.target Type=oneshot ExecStart=/bin/bash -lc 'set -o pipefail; /bin/bash ${SCRIPT_DIR}/install.sh --phase=2 --tier=${TIER} 2>&1 | tee -a /var/log/cezen-install.log' RemainAfterExit=yes -StandardOutput=journal+console -StandardError=journal+console +StandardOutput=journal +StandardError=journal [Install] WantedBy=multi-user.target