From b2031eae4b600758394d99b877080b748bc76b00 Mon Sep 17 00:00:00 2001 From: Stefan Strobl Date: Wed, 24 Dec 2025 20:45:07 +0100 Subject: [PATCH] feat(main): integrate new modules and remove installer phase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove dependency on void-installer by integrating new modules: - Source packages.sh, locale.sh, users.sh, services.sh - Remove installer.sh sourcing - Add 4 new phases after mounts: packages, locale, users, services - Remove run_installer() phase - Remove SKIP_INSTALLER flag and --skip-installer option Decision: Execute new phases in logical order. Packages must install before locale (needs glibc-locales package). Locale before users (user shell may depend on locale). Users before services (services may need user context). Workflow change: Before: Mounts → void-installer (manual) → Post-Install After: Mounts → Packages → Locale → Users → Services → Post-Install Alternative considered: Keep installer.sh as optional fallback rejected. Clean break eliminates maintenance burden and reduces complexity. Users who need custom package selection can modify packages.sh directly. Trade-off: Removes flexibility of void-installer's package selection UI. Accepted because: 1. Requirements explicitly exclude GUI/TUI components 2. Config file support (future) will provide customization 3. Simpler codebase easier to maintain and debug Module sourcing order preserves dependency chain: logging → config → sanity → disk ops → installation → rollback --- src/installer.sh | 71 ------------------------------------------------ src/main.sh | 25 ++++++++++------- 2 files changed, 15 insertions(+), 81 deletions(-) delete mode 100644 src/installer.sh diff --git a/src/installer.sh b/src/installer.sh deleted file mode 100644 index 3dc24e5..0000000 --- a/src/installer.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash - -# === Motivation === -# Keep the official installer as the configuration authority. - -# === Problem Statement === -# We need a clean handoff so the installer uses existing mounts without reformatting. - -# === Scope === -# In scope: instructions and guardrails for the user during the installer run. -# Out of scope: automated installer configuration. - -# === Concepts === -# Handoff: a pause where the wrapper delegates to the installer. - -# === Decisions === -# Provide clear, minimal guidance to avoid overriding prepared filesystems. -# Support only CLI installer flow to keep guidance consistent. - -# === Alternatives Considered === -# Fully scripted installation rejected for this phase. - -# === Constraints === -# The wrapper must not hide or alter installer behavior. - -# === Open Questions === -# Should we provide a checklist or step-by-step guide during the installer handoff? -# How do we detect if the installer reformatted filesystems against our intent? -# Should we monitor the installer process, or fully delegate control? - -# === Success Criteria === -# The installer completes using the prepared mounts without reformatting. - -run_installer() { - : "${MOUNT_ROOT:?Mount root is required}" - : "${ESP_MOUNT:?ESP mount path is required}" - if ! findmnt "$MOUNT_ROOT" >/dev/null 2>&1; then - die "Mount root not found: $MOUNT_ROOT" - fi - if ! findmnt "$ESP_MOUNT" >/dev/null 2>&1; then - die "ESP mount not found: $ESP_MOUNT" - fi - - log_info "Installer handoff: use the prepared mounts without formatting." - log_info "In the installer: choose manual partitioning and only set mountpoints." - - if [[ "${SKIP_INSTALLER:-0}" -eq 1 ]]; then - log_warn "Skipping installer per request." - return 0 - fi - - read -r -p "Press Enter to launch void-installer..." _ - - if command -v void-installer >/dev/null 2>&1; then - void-installer - else - log_warn "void-installer not found. Run it manually in another shell." - fi - - read -r -p "Press Enter once the installer is complete..." _ - - # Verify critical mounts are still intact after installer - if ! findmnt "$MOUNT_ROOT" >/dev/null 2>&1; then - die "Root mount disappeared after installer. The installer may have reformatted the filesystem." - fi - if ! findmnt "$ESP_MOUNT" >/dev/null 2>&1; then - die "ESP mount disappeared after installer. The installer may have reformatted the filesystem." - fi - - log_info "Mount verification passed." -} diff --git a/src/main.sh b/src/main.sh index 49be21f..cf7e8cf 100644 --- a/src/main.sh +++ b/src/main.sh @@ -72,23 +72,27 @@ source "$SCRIPT_DIR/encryption.sh" source "$SCRIPT_DIR/filesystems.sh" # shellcheck source=src/mounts.sh source "$SCRIPT_DIR/mounts.sh" -# shellcheck source=src/installer.sh -source "$SCRIPT_DIR/installer.sh" +# shellcheck source=src/packages.sh +source "$SCRIPT_DIR/packages.sh" +# shellcheck source=src/locale.sh +source "$SCRIPT_DIR/locale.sh" +# shellcheck source=src/users.sh +source "$SCRIPT_DIR/users.sh" +# shellcheck source=src/services.sh +source "$SCRIPT_DIR/services.sh" # shellcheck source=src/postinstall.sh source "$SCRIPT_DIR/postinstall.sh" # shellcheck source=src/rollback.sh source "$SCRIPT_DIR/rollback.sh" DRY_RUN=0 -SKIP_INSTALLER=0 CURRENT_PHASE="" usage() { cat <