fix(logging): separate interactive prompts from log monitor to prevent UI conflicts
- commit
- 4fd003327dd32ee975f396334a6e7b462f58651d
- author
- bnema · · 2025-10-19 17:45 UTC
- parent
- 70dfe8f
- signature
- unsigned
27 files · +230 -182
M install.sh +9 -5
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | # archup - Fast, minimal Arch Linux auto-installer | |
| 3 | 3 | # Main installation orchestrator | |
| 4 | 4 | ||
| 5 | - | set -eEo pipefail | |
| 5 | + | set -eo pipefail | |
| 6 | 6 | ||
| 7 | 7 | # Export global paths | |
| 8 | 8 | export ARCHUP_PATH="${ARCHUP_PATH:-$HOME/.local/share/archup}" | |
| @@ -64,7 +64,7 @@ if [ ! -d "$ARCHUP_INSTALL" ]; then | |||
| 64 | 64 | echo "Downloading presets..." | |
| 65 | 65 | curl -sL "$GITHUB_RAW/install/presets/barebone.packages" -o "$ARCHUP_INSTALL/presets/barebone.packages" | |
| 66 | 66 | ||
| 67 | - | echo "✓ All files downloaded successfully" | |
| 67 | + | echo "[OK] All files downloaded successfully" | |
| 68 | 68 | echo "" | |
| 69 | 69 | fi | |
| 70 | 70 | ||
| @@ -74,17 +74,21 @@ source "$ARCHUP_INSTALL/bootstrap.sh" | |||
| 74 | 74 | # Source all helper utilities (now safe to use gum) | |
| 75 | 75 | source "$ARCHUP_INSTALL/helpers/all.sh" | |
| 76 | 76 | ||
| 77 | - | # Display logo and start installation | |
| 77 | + | # Display logo | |
| 78 | 78 | clear_logo | |
| 79 | - | start_install_log | |
| 80 | 79 | ||
| 81 | 80 | # ============================================================ | |
| 82 | 81 | # PHASE 1: BAREBONE INSTALLER - BASIC | |
| 83 | 82 | # ============================================================ | |
| 84 | 83 | ||
| 85 | - | # Preflight validation | |
| 84 | + | # Preflight validation (interactive prompts BEFORE logging starts) | |
| 86 | 85 | source "$ARCHUP_INSTALL/preflight/all.sh" | |
| 87 | 86 | ||
| 87 | + | # Start log monitor AFTER all interactive prompts | |
| 88 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing..." | |
| 89 | + | echo | |
| 90 | + | start_install_log | |
| 91 | + | ||
| 88 | 92 | # Partitioning (auto GPT, ext4, no encryption) | |
| 89 | 93 | source "$ARCHUP_INSTALL/partitioning/all.sh" | |
| 90 | 94 | ||
| @@ -2,7 +2,7 @@ | |||||
| 2 | # archup - Fast, minimal Arch Linux auto-installer | 2 | # archup - Fast, minimal Arch Linux auto-installer | ||
| 3 | # Main installation orchestrator | 3 | # Main installation orchestrator | ||
| 4 | 4 | ||||
| 5 | - | set -eEo pipefail | 5 | + | set -eo pipefail |
| 6 | 6 | ||||
| 7 | # Export global paths | 7 | # Export global paths | ||
| 8 | export ARCHUP_PATH="${ARCHUP_PATH:-$HOME/.local/share/archup}" | 8 | export ARCHUP_PATH="${ARCHUP_PATH:-$HOME/.local/share/archup}" | ||
| @@ -64,7 +64,7 @@ if [ ! -d "$ARCHUP_INSTALL" ]; then | |||||
| 64 | echo "Downloading presets..." | 64 | echo "Downloading presets..." | ||
| 65 | curl -sL "$GITHUB_RAW/install/presets/barebone.packages" -o "$ARCHUP_INSTALL/presets/barebone.packages" | 65 | curl -sL "$GITHUB_RAW/install/presets/barebone.packages" -o "$ARCHUP_INSTALL/presets/barebone.packages" | ||
| 66 | 66 | ||||
| 67 | - | echo "✓ All files downloaded successfully" | 67 | + | echo "[OK] All files downloaded successfully" |
| 68 | echo "" | 68 | echo "" | ||
| 69 | fi | 69 | fi | ||
| 70 | 70 | ||||
| @@ -74,17 +74,21 @@ source "$ARCHUP_INSTALL/bootstrap.sh" | |||||
| 74 | # Source all helper utilities (now safe to use gum) | 74 | # Source all helper utilities (now safe to use gum) | ||
| 75 | source "$ARCHUP_INSTALL/helpers/all.sh" | 75 | source "$ARCHUP_INSTALL/helpers/all.sh" | ||
| 76 | 76 | ||||
| 77 | - | # Display logo and start installation | 77 | + | # Display logo |
| 78 | clear_logo | 78 | clear_logo | ||
| 79 | - | start_install_log | |||
| 80 | 79 | ||||
| 81 | # ============================================================ | 80 | # ============================================================ | ||
| 82 | # PHASE 1: BAREBONE INSTALLER - BASIC | 81 | # PHASE 1: BAREBONE INSTALLER - BASIC | ||
| 83 | # ============================================================ | 82 | # ============================================================ | ||
| 84 | 83 | ||||
| 85 | - | # Preflight validation | 84 | + | # Preflight validation (interactive prompts BEFORE logging starts) |
| 86 | source "$ARCHUP_INSTALL/preflight/all.sh" | 85 | source "$ARCHUP_INSTALL/preflight/all.sh" | ||
| 87 | 86 | ||||
| 87 | + | # Start log monitor AFTER all interactive prompts | |||
| 88 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing..." | |||
| 89 | + | echo | |||
| 90 | + | start_install_log | |||
| 91 | + | ||||
| 88 | # Partitioning (auto GPT, ext4, no encryption) | 92 | # Partitioning (auto GPT, ext4, no encryption) | ||
| 89 | source "$ARCHUP_INSTALL/partitioning/all.sh" | 93 | source "$ARCHUP_INSTALL/partitioning/all.sh" | ||
| 90 | 94 | ||||
M install/base/all.sh +4 -4
| @@ -1,6 +1,6 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # Base installation phase orchestrator | |
| 2 | + | # Base installation phase | |
| 3 | 3 | ||
| 4 | - | run_logged "$ARCHUP_INSTALL/base/kernel.sh" | |
| 5 | - | run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" | |
| 6 | - | run_logged "$ARCHUP_INSTALL/base/fstab.sh" | |
| 4 | + | source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose) | |
| 5 | + | run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive | |
| 6 | + | run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive | |
| @@ -1,6 +1,6 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # Base installation phase orchestrator | 2 | + | # Base installation phase |
| 3 | 3 | ||||
| 4 | - | run_logged "$ARCHUP_INSTALL/base/kernel.sh" | 4 | + | source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose) |
| 5 | - | run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" | 5 | + | run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive |
| 6 | - | run_logged "$ARCHUP_INSTALL/base/fstab.sh" | 6 | + | run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive |
M install/base/fstab.sh +2 -2
| @@ -6,6 +6,6 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Generating fstab..." | |||
| 6 | 6 | # Generate fstab using UUIDs | |
| 7 | 7 | genfstab -U /mnt >> /mnt/etc/fstab | |
| 8 | 8 | ||
| 9 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ fstab generated" | |
| 9 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] fstab generated" | |
| 10 | 10 | ||
| 11 | - | echo "Generated /etc/fstab" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 11 | + | echo "Generated /etc/fstab" | |
| @@ -6,6 +6,6 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Generating fstab..." | |||||
| 6 | # Generate fstab using UUIDs | 6 | # Generate fstab using UUIDs | ||
| 7 | genfstab -U /mnt >> /mnt/etc/fstab | 7 | genfstab -U /mnt >> /mnt/etc/fstab | ||
| 8 | 8 | ||||
| 9 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ fstab generated" | 9 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] fstab generated" |
| 10 | 10 | ||||
| 11 | - | echo "Generated /etc/fstab" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 11 | + | echo "Generated /etc/fstab" |
M install/base/kernel.sh +12 -12
| @@ -15,8 +15,8 @@ echo | |||
| 15 | 15 | KERNEL_CHOICE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "linux" "linux-lts" "linux-zen") | |
| 16 | 16 | export ARCHUP_KERNEL="$KERNEL_CHOICE" | |
| 17 | 17 | ||
| 18 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Selected: $ARCHUP_KERNEL" | |
| 19 | - | echo "Kernel: $ARCHUP_KERNEL" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 18 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Selected: $ARCHUP_KERNEL" | |
| 19 | + | echo "Kernel: $ARCHUP_KERNEL" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 20 | 20 | ||
| 21 | 21 | # Detect CPU vendor | |
| 22 | 22 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Detecting CPU vendor..." | |
| @@ -32,17 +32,17 @@ elif [ "$CPU_VENDOR" = "AuthenticAMD" ]; then | |||
| 32 | 32 | else | |
| 33 | 33 | MICROCODE="" | |
| 34 | 34 | CPU_TYPE="Unknown" | |
| 35 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⚠ Unknown CPU vendor: $CPU_VENDOR" | |
| 35 | + | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[WARN] Unknown CPU vendor: $CPU_VENDOR" | |
| 36 | 36 | fi | |
| 37 | 37 | ||
| 38 | 38 | if [ -n "$MICROCODE" ]; then | |
| 39 | 39 | export ARCHUP_MICROCODE="$MICROCODE" | |
| 40 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Detected: $CPU_TYPE CPU" | |
| 40 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Detected: $CPU_TYPE CPU" | |
| 41 | 41 | gum style --padding "0 0 1 $PADDING_LEFT" " Microcode: $MICROCODE" | |
| 42 | - | echo "CPU: $CPU_TYPE, Microcode: $MICROCODE" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 42 | + | echo "CPU: $CPU_TYPE, Microcode: $MICROCODE" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 43 | 43 | else | |
| 44 | 44 | export ARCHUP_MICROCODE="" | |
| 45 | - | echo "CPU: Unknown, no microcode" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 45 | + | echo "CPU: Unknown, no microcode" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 46 | 46 | fi | |
| 47 | 47 | ||
| 48 | 48 | # AMD-specific tuning (P-State driver selection) | |
| @@ -78,13 +78,13 @@ if [ "$CPU_TYPE" = "AMD" ]; then | |||
| 78 | 78 | fi | |
| 79 | 79 | ||
| 80 | 80 | # Remove duplicates and sort | |
| 81 | - | AVAILABLE_MODES=($(printf '%s\n' "${AVAILABLE_MODES[@]}" | sort -u)) | |
| 81 | + | mapfile -t AVAILABLE_MODES < <(printf '%s\n' "${AVAILABLE_MODES[@]}" | sort -u) | |
| 82 | 82 | ||
| 83 | 83 | # Display detected modes | |
| 84 | 84 | if [ ${#AVAILABLE_MODES[@]} -gt 0 ]; then | |
| 85 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Detected ${#AVAILABLE_MODES[@]} available mode(s): ${AVAILABLE_MODES[*]}" | |
| 85 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Detected ${#AVAILABLE_MODES[@]} available mode(s): ${AVAILABLE_MODES[*]}" | |
| 86 | 86 | else | |
| 87 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⚠ Could not detect available modes, using defaults" | |
| 87 | + | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[WARN] Could not detect available modes, using defaults" | |
| 88 | 88 | AVAILABLE_MODES=("passive") | |
| 89 | 89 | fi | |
| 90 | 90 | ||
| @@ -111,8 +111,8 @@ if [ "$CPU_TYPE" = "AMD" ]; then | |||
| 111 | 111 | ||
| 112 | 112 | AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${AVAILABLE_MODES[@]}") | |
| 113 | 113 | export ARCHUP_AMD_PSTATE="$AMD_PSTATE" | |
| 114 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ P-State: $AMD_PSTATE" | |
| 115 | - | echo "AMD P-State: $AMD_PSTATE (kernel parameter)" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 114 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] P-State: $AMD_PSTATE" | |
| 115 | + | echo "AMD P-State: $AMD_PSTATE (kernel parameter)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 116 | 116 | ||
| 117 | 117 | # Prepare kernel parameters for AMD P-State | |
| 118 | 118 | export ARCHUP_AMD_KERNEL_PARAMS="amd_pstate=$AMD_PSTATE" | |
| @@ -121,4 +121,4 @@ else | |||
| 121 | 121 | export ARCHUP_AMD_KERNEL_PARAMS="" | |
| 122 | 122 | fi | |
| 123 | 123 | ||
| 124 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Kernel configuration complete" | |
| 124 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Kernel configuration complete" | |
| @@ -15,8 +15,8 @@ echo | |||||
| 15 | KERNEL_CHOICE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "linux" "linux-lts" "linux-zen") | 15 | KERNEL_CHOICE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "linux" "linux-lts" "linux-zen") | ||
| 16 | export ARCHUP_KERNEL="$KERNEL_CHOICE" | 16 | export ARCHUP_KERNEL="$KERNEL_CHOICE" | ||
| 17 | 17 | ||||
| 18 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Selected: $ARCHUP_KERNEL" | 18 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Selected: $ARCHUP_KERNEL" |
| 19 | - | echo "Kernel: $ARCHUP_KERNEL" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 19 | + | echo "Kernel: $ARCHUP_KERNEL" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 20 | 20 | ||||
| 21 | # Detect CPU vendor | 21 | # Detect CPU vendor | ||
| 22 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Detecting CPU vendor..." | 22 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Detecting CPU vendor..." | ||
| @@ -32,17 +32,17 @@ elif [ "$CPU_VENDOR" = "AuthenticAMD" ]; then | |||||
| 32 | else | 32 | else | ||
| 33 | MICROCODE="" | 33 | MICROCODE="" | ||
| 34 | CPU_TYPE="Unknown" | 34 | CPU_TYPE="Unknown" | ||
| 35 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⚠ Unknown CPU vendor: $CPU_VENDOR" | 35 | + | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[WARN] Unknown CPU vendor: $CPU_VENDOR" |
| 36 | fi | 36 | fi | ||
| 37 | 37 | ||||
| 38 | if [ -n "$MICROCODE" ]; then | 38 | if [ -n "$MICROCODE" ]; then | ||
| 39 | export ARCHUP_MICROCODE="$MICROCODE" | 39 | export ARCHUP_MICROCODE="$MICROCODE" | ||
| 40 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Detected: $CPU_TYPE CPU" | 40 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Detected: $CPU_TYPE CPU" |
| 41 | gum style --padding "0 0 1 $PADDING_LEFT" " Microcode: $MICROCODE" | 41 | gum style --padding "0 0 1 $PADDING_LEFT" " Microcode: $MICROCODE" | ||
| 42 | - | echo "CPU: $CPU_TYPE, Microcode: $MICROCODE" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 42 | + | echo "CPU: $CPU_TYPE, Microcode: $MICROCODE" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 43 | else | 43 | else | ||
| 44 | export ARCHUP_MICROCODE="" | 44 | export ARCHUP_MICROCODE="" | ||
| 45 | - | echo "CPU: Unknown, no microcode" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 45 | + | echo "CPU: Unknown, no microcode" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 46 | fi | 46 | fi | ||
| 47 | 47 | ||||
| 48 | # AMD-specific tuning (P-State driver selection) | 48 | # AMD-specific tuning (P-State driver selection) | ||
| @@ -78,13 +78,13 @@ if [ "$CPU_TYPE" = "AMD" ]; then | |||||
| 78 | fi | 78 | fi | ||
| 79 | 79 | ||||
| 80 | # Remove duplicates and sort | 80 | # Remove duplicates and sort | ||
| 81 | - | AVAILABLE_MODES=($(printf '%s\n' "${AVAILABLE_MODES[@]}" | sort -u)) | 81 | + | mapfile -t AVAILABLE_MODES < <(printf '%s\n' "${AVAILABLE_MODES[@]}" | sort -u) |
| 82 | 82 | ||||
| 83 | # Display detected modes | 83 | # Display detected modes | ||
| 84 | if [ ${#AVAILABLE_MODES[@]} -gt 0 ]; then | 84 | if [ ${#AVAILABLE_MODES[@]} -gt 0 ]; then | ||
| 85 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Detected ${#AVAILABLE_MODES[@]} available mode(s): ${AVAILABLE_MODES[*]}" | 85 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Detected ${#AVAILABLE_MODES[@]} available mode(s): ${AVAILABLE_MODES[*]}" |
| 86 | else | 86 | else | ||
| 87 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⚠ Could not detect available modes, using defaults" | 87 | + | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[WARN] Could not detect available modes, using defaults" |
| 88 | AVAILABLE_MODES=("passive") | 88 | AVAILABLE_MODES=("passive") | ||
| 89 | fi | 89 | fi | ||
| 90 | 90 | ||||
| @@ -111,8 +111,8 @@ if [ "$CPU_TYPE" = "AMD" ]; then | |||||
| 111 | 111 | ||||
| 112 | AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${AVAILABLE_MODES[@]}") | 112 | AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${AVAILABLE_MODES[@]}") | ||
| 113 | export ARCHUP_AMD_PSTATE="$AMD_PSTATE" | 113 | export ARCHUP_AMD_PSTATE="$AMD_PSTATE" | ||
| 114 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ P-State: $AMD_PSTATE" | 114 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] P-State: $AMD_PSTATE" |
| 115 | - | echo "AMD P-State: $AMD_PSTATE (kernel parameter)" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 115 | + | echo "AMD P-State: $AMD_PSTATE (kernel parameter)" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 116 | 116 | ||||
| 117 | # Prepare kernel parameters for AMD P-State | 117 | # Prepare kernel parameters for AMD P-State | ||
| 118 | export ARCHUP_AMD_KERNEL_PARAMS="amd_pstate=$AMD_PSTATE" | 118 | export ARCHUP_AMD_KERNEL_PARAMS="amd_pstate=$AMD_PSTATE" | ||
| @@ -121,4 +121,4 @@ else | |||||
| 121 | export ARCHUP_AMD_KERNEL_PARAMS="" | 121 | export ARCHUP_AMD_KERNEL_PARAMS="" | ||
| 122 | fi | 122 | fi | ||
| 123 | 123 | ||||
| 124 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Kernel configuration complete" | 124 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Kernel configuration complete" |
M install/base/pacstrap.sh +5 -5
| @@ -10,24 +10,24 @@ mapfile -t packages < <(grep -v '^#' "$ARCHUP_INSTALL/presets/barebone.packages" | |||
| 10 | 10 | # Add kernel (selected in kernel.sh) | |
| 11 | 11 | if [ -n "$ARCHUP_KERNEL" ]; then | |
| 12 | 12 | packages+=("$ARCHUP_KERNEL") | |
| 13 | - | echo "Adding kernel: $ARCHUP_KERNEL" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 13 | + | echo "Adding kernel: $ARCHUP_KERNEL" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 14 | 14 | fi | |
| 15 | 15 | ||
| 16 | 16 | # Add microcode (detected in kernel.sh) | |
| 17 | 17 | if [ -n "$ARCHUP_MICROCODE" ]; then | |
| 18 | 18 | packages+=("$ARCHUP_MICROCODE") | |
| 19 | - | echo "Adding microcode: $ARCHUP_MICROCODE" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 19 | + | echo "Adding microcode: $ARCHUP_MICROCODE" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 20 | 20 | fi | |
| 21 | 21 | ||
| 22 | 22 | # Add cryptsetup if encryption is enabled | |
| 23 | 23 | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |
| 24 | 24 | packages+=("cryptsetup") | |
| 25 | - | echo "Adding cryptsetup for LUKS encryption" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 25 | + | echo "Adding cryptsetup for LUKS encryption" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 26 | 26 | fi | |
| 27 | 27 | ||
| 28 | 28 | # Install base system | |
| 29 | 29 | pacstrap /mnt "${packages[@]}" | |
| 30 | 30 | ||
| 31 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Base system installed" | |
| 31 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Base system installed" | |
| 32 | 32 | ||
| 33 | - | echo "Installed ${#packages[@]} packages" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 33 | + | echo "Installed ${#packages[@]} packages" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -10,24 +10,24 @@ mapfile -t packages < <(grep -v '^#' "$ARCHUP_INSTALL/presets/barebone.packages" | |||||
| 10 | # Add kernel (selected in kernel.sh) | 10 | # Add kernel (selected in kernel.sh) | ||
| 11 | if [ -n "$ARCHUP_KERNEL" ]; then | 11 | if [ -n "$ARCHUP_KERNEL" ]; then | ||
| 12 | packages+=("$ARCHUP_KERNEL") | 12 | packages+=("$ARCHUP_KERNEL") | ||
| 13 | - | echo "Adding kernel: $ARCHUP_KERNEL" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 13 | + | echo "Adding kernel: $ARCHUP_KERNEL" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 14 | fi | 14 | fi | ||
| 15 | 15 | ||||
| 16 | # Add microcode (detected in kernel.sh) | 16 | # Add microcode (detected in kernel.sh) | ||
| 17 | if [ -n "$ARCHUP_MICROCODE" ]; then | 17 | if [ -n "$ARCHUP_MICROCODE" ]; then | ||
| 18 | packages+=("$ARCHUP_MICROCODE") | 18 | packages+=("$ARCHUP_MICROCODE") | ||
| 19 | - | echo "Adding microcode: $ARCHUP_MICROCODE" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 19 | + | echo "Adding microcode: $ARCHUP_MICROCODE" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 20 | fi | 20 | fi | ||
| 21 | 21 | ||||
| 22 | # Add cryptsetup if encryption is enabled | 22 | # Add cryptsetup if encryption is enabled | ||
| 23 | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | 23 | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | ||
| 24 | packages+=("cryptsetup") | 24 | packages+=("cryptsetup") | ||
| 25 | - | echo "Adding cryptsetup for LUKS encryption" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 25 | + | echo "Adding cryptsetup for LUKS encryption" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 26 | fi | 26 | fi | ||
| 27 | 27 | ||||
| 28 | # Install base system | 28 | # Install base system | ||
| 29 | pacstrap /mnt "${packages[@]}" | 29 | pacstrap /mnt "${packages[@]}" | ||
| 30 | 30 | ||||
| 31 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Base system installed" | 31 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Base system installed" |
| 32 | 32 | ||||
| 33 | - | echo "Installed ${#packages[@]} packages" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 33 | + | echo "Installed ${#packages[@]} packages" >> "$ARCHUP_INSTALL_LOG_FILE" |
M install/boot/all.sh +1 -2
| @@ -1,5 +1,4 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # Bootloader phase orchestrator | |
| 3 | - | # archup uses Limine exclusively for its superior btrfs and snapshot support | |
| 2 | + | # Bootloader installation phase | |
| 4 | 3 | ||
| 5 | 4 | run_logged "$ARCHUP_INSTALL/boot/limine.sh" | |
| @@ -1,5 +1,4 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # Bootloader phase orchestrator | 2 | + | # Bootloader installation phase |
| 3 | - | # archup uses Limine exclusively for its superior btrfs and snapshot support | |||
| 4 | 3 | ||||
| 5 | run_logged "$ARCHUP_INSTALL/boot/limine.sh" | 4 | run_logged "$ARCHUP_INSTALL/boot/limine.sh" | ||
M install/boot/limine.sh +5 -5
| @@ -17,7 +17,7 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |||
| 17 | 17 | # Regenerate initramfs | |
| 18 | 18 | arch-chroot /mnt mkinitcpio -P | |
| 19 | 19 | ||
| 20 | - | echo "Updated mkinitcpio.conf with encrypt hook" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 20 | + | echo "Updated mkinitcpio.conf with encrypt hook" | |
| 21 | 21 | ||
| 22 | 22 | # Kernel parameters for encrypted boot | |
| 23 | 23 | KERNEL_PARAMS="cryptdevice=UUID=$ROOT_UUID:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw" | |
| @@ -30,7 +30,7 @@ fi | |||
| 30 | 30 | # Add AMD-specific kernel parameters if configured | |
| 31 | 31 | if [ -n "$ARCHUP_AMD_KERNEL_PARAMS" ]; then | |
| 32 | 32 | KERNEL_PARAMS="$KERNEL_PARAMS $ARCHUP_AMD_KERNEL_PARAMS" | |
| 33 | - | echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 33 | + | echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" | |
| 34 | 34 | fi | |
| 35 | 35 | ||
| 36 | 36 | # Install Limine to the disk (UEFI) | |
| @@ -82,10 +82,10 @@ arch-chroot /mnt efibootmgr --create \ | |||
| 82 | 82 | --label "archup" \ | |
| 83 | 83 | --loader "\\EFI\\BOOT\\BOOTX64.EFI" | |
| 84 | 84 | ||
| 85 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Limine installed and configured" | |
| 85 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Limine installed and configured" | |
| 86 | 86 | ||
| 87 | 87 | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |
| 88 | - | echo "Installed Limine with encrypted root (UUID: $ROOT_UUID)" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 88 | + | echo "Installed Limine with encrypted root (UUID: $ROOT_UUID)" | |
| 89 | 89 | else | |
| 90 | - | echo "Installed Limine with root UUID: $ROOT_UUID" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 90 | + | echo "Installed Limine with root UUID: $ROOT_UUID" | |
| 91 | 91 | fi | |
| @@ -17,7 +17,7 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |||||
| 17 | # Regenerate initramfs | 17 | # Regenerate initramfs | ||
| 18 | arch-chroot /mnt mkinitcpio -P | 18 | arch-chroot /mnt mkinitcpio -P | ||
| 19 | 19 | ||||
| 20 | - | echo "Updated mkinitcpio.conf with encrypt hook" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 20 | + | echo "Updated mkinitcpio.conf with encrypt hook" |
| 21 | 21 | ||||
| 22 | # Kernel parameters for encrypted boot | 22 | # Kernel parameters for encrypted boot | ||
| 23 | KERNEL_PARAMS="cryptdevice=UUID=$ROOT_UUID:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw" | 23 | KERNEL_PARAMS="cryptdevice=UUID=$ROOT_UUID:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw" | ||
| @@ -30,7 +30,7 @@ fi | |||||
| 30 | # Add AMD-specific kernel parameters if configured | 30 | # Add AMD-specific kernel parameters if configured | ||
| 31 | if [ -n "$ARCHUP_AMD_KERNEL_PARAMS" ]; then | 31 | if [ -n "$ARCHUP_AMD_KERNEL_PARAMS" ]; then | ||
| 32 | KERNEL_PARAMS="$KERNEL_PARAMS $ARCHUP_AMD_KERNEL_PARAMS" | 32 | KERNEL_PARAMS="$KERNEL_PARAMS $ARCHUP_AMD_KERNEL_PARAMS" | ||
| 33 | - | echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 33 | + | echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" |
| 34 | fi | 34 | fi | ||
| 35 | 35 | ||||
| 36 | # Install Limine to the disk (UEFI) | 36 | # Install Limine to the disk (UEFI) | ||
| @@ -82,10 +82,10 @@ arch-chroot /mnt efibootmgr --create \ | |||||
| 82 | --label "archup" \ | 82 | --label "archup" \ | ||
| 83 | --loader "\\EFI\\BOOT\\BOOTX64.EFI" | 83 | --loader "\\EFI\\BOOT\\BOOTX64.EFI" | ||
| 84 | 84 | ||||
| 85 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Limine installed and configured" | 85 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Limine installed and configured" |
| 86 | 86 | ||||
| 87 | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | 87 | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | ||
| 88 | - | echo "Installed Limine with encrypted root (UUID: $ROOT_UUID)" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 88 | + | echo "Installed Limine with encrypted root (UUID: $ROOT_UUID)" |
| 89 | else | 89 | else | ||
| 90 | - | echo "Installed Limine with root UUID: $ROOT_UUID" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 90 | + | echo "Installed Limine with root UUID: $ROOT_UUID" |
| 91 | fi | 91 | fi | ||
M install/bootstrap.sh +9 -3
| @@ -5,6 +5,12 @@ | |||
| 5 | 5 | ||
| 6 | 6 | set -e | |
| 7 | 7 | ||
| 8 | + | # Clean up old log file to ensure fresh logs for this attempt | |
| 9 | + | if [ -f "$ARCHUP_INSTALL_LOG_FILE" ]; then | |
| 10 | + | rm -f "$ARCHUP_INSTALL_LOG_FILE" | |
| 11 | + | echo "Cleared previous installation log" | |
| 12 | + | fi | |
| 13 | + | ||
| 8 | 14 | echo "=== ArchUp Bootstrap ===" | |
| 9 | 15 | echo "Installing essential dependencies..." | |
| 10 | 16 | ||
| @@ -22,13 +28,13 @@ pacman -Sy --noconfirm | |||
| 22 | 28 | if ! command -v gum &>/dev/null; then | |
| 23 | 29 | echo "Installing gum for interactive TUI..." | |
| 24 | 30 | pacman -S --needed --noconfirm gum | |
| 25 | - | echo "✓ gum installed" | |
| 31 | + | echo "[OK] gum installed" | |
| 26 | 32 | else | |
| 27 | - | echo "✓ gum already available" | |
| 33 | + | echo "[OK] gum already available" | |
| 28 | 34 | fi | |
| 29 | 35 | ||
| 30 | 36 | # Any other critical dependencies that preflight needs can go here | |
| 31 | 37 | # Example: pacman -S --needed --noconfirm other-tool | |
| 32 | 38 | ||
| 33 | - | echo "✓ Bootstrap complete!" | |
| 39 | + | echo "[OK] Bootstrap complete!" | |
| 34 | 40 | echo | |
| @@ -5,6 +5,12 @@ | |||||
| 5 | 5 | ||||
| 6 | set -e | 6 | set -e | ||
| 7 | 7 | ||||
| 8 | + | # Clean up old log file to ensure fresh logs for this attempt | |||
| 9 | + | if [ -f "$ARCHUP_INSTALL_LOG_FILE" ]; then | |||
| 10 | + | rm -f "$ARCHUP_INSTALL_LOG_FILE" | |||
| 11 | + | echo "Cleared previous installation log" | |||
| 12 | + | fi | |||
| 13 | + | ||||
| 8 | echo "=== ArchUp Bootstrap ===" | 14 | echo "=== ArchUp Bootstrap ===" | ||
| 9 | echo "Installing essential dependencies..." | 15 | echo "Installing essential dependencies..." | ||
| 10 | 16 | ||||
| @@ -22,13 +28,13 @@ pacman -Sy --noconfirm | |||||
| 22 | if ! command -v gum &>/dev/null; then | 28 | if ! command -v gum &>/dev/null; then | ||
| 23 | echo "Installing gum for interactive TUI..." | 29 | echo "Installing gum for interactive TUI..." | ||
| 24 | pacman -S --needed --noconfirm gum | 30 | pacman -S --needed --noconfirm gum | ||
| 25 | - | echo "✓ gum installed" | 31 | + | echo "[OK] gum installed" |
| 26 | else | 32 | else | ||
| 27 | - | echo "✓ gum already available" | 33 | + | echo "[OK] gum already available" |
| 28 | fi | 34 | fi | ||
| 29 | 35 | ||||
| 30 | # Any other critical dependencies that preflight needs can go here | 36 | # Any other critical dependencies that preflight needs can go here | ||
| 31 | # Example: pacman -S --needed --noconfirm other-tool | 37 | # Example: pacman -S --needed --noconfirm other-tool | ||
| 32 | 38 | ||||
| 33 | - | echo "✓ Bootstrap complete!" | 39 | + | echo "[OK] Bootstrap complete!" |
| 34 | echo | 40 | echo | ||
M install/config/all.sh +4 -4
| @@ -1,6 +1,6 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # Configuration phase orchestrator | |
| 2 | + | # Configuration phase | |
| 3 | 3 | ||
| 4 | - | run_logged "$ARCHUP_INSTALL/config/system.sh" | |
| 5 | - | run_logged "$ARCHUP_INSTALL/config/user.sh" | |
| 6 | - | run_logged "$ARCHUP_INSTALL/config/network.sh" | |
| 4 | + | source "$ARCHUP_INSTALL/config/system.sh" # Interactive (gum input) | |
| 5 | + | source "$ARCHUP_INSTALL/config/user.sh" # Interactive (gum input) | |
| 6 | + | run_logged "$ARCHUP_INSTALL/config/network.sh" # Non-interactive | |
| @@ -1,6 +1,6 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # Configuration phase orchestrator | 2 | + | # Configuration phase |
| 3 | 3 | ||||
| 4 | - | run_logged "$ARCHUP_INSTALL/config/system.sh" | 4 | + | source "$ARCHUP_INSTALL/config/system.sh" # Interactive (gum input) |
| 5 | - | run_logged "$ARCHUP_INSTALL/config/user.sh" | 5 | + | source "$ARCHUP_INSTALL/config/user.sh" # Interactive (gum input) |
| 6 | - | run_logged "$ARCHUP_INSTALL/config/network.sh" | 6 | + | run_logged "$ARCHUP_INSTALL/config/network.sh" # Non-interactive |
M install/config/network.sh +4 -4
| @@ -45,10 +45,10 @@ PreSharedKey=$ARCHUP_WIFI_PASSPHRASE | |||
| 45 | 45 | AutoConnect=true | |
| 46 | 46 | EOF | |
| 47 | 47 | ||
| 48 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ WiFi credentials migrated: $ARCHUP_WIFI_SSID" | |
| 49 | - | echo "WiFi credentials migrated: $ARCHUP_WIFI_SSID (auto-connect enabled)" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 48 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] WiFi credentials migrated: $ARCHUP_WIFI_SSID" | |
| 49 | + | echo "WiFi credentials migrated: $ARCHUP_WIFI_SSID (auto-connect enabled)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 50 | 50 | fi | |
| 51 | 51 | ||
| 52 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Network configured (DHCP)" | |
| 52 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Network configured (DHCP)" | |
| 53 | 53 | ||
| 54 | - | echo "Enabled systemd-networkd and iwd" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 54 | + | echo "Enabled systemd-networkd and iwd" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -45,10 +45,10 @@ PreSharedKey=$ARCHUP_WIFI_PASSPHRASE | |||||
| 45 | AutoConnect=true | 45 | AutoConnect=true | ||
| 46 | EOF | 46 | EOF | ||
| 47 | 47 | ||||
| 48 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ WiFi credentials migrated: $ARCHUP_WIFI_SSID" | 48 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] WiFi credentials migrated: $ARCHUP_WIFI_SSID" |
| 49 | - | echo "WiFi credentials migrated: $ARCHUP_WIFI_SSID (auto-connect enabled)" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 49 | + | echo "WiFi credentials migrated: $ARCHUP_WIFI_SSID (auto-connect enabled)" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 50 | fi | 50 | fi | ||
| 51 | 51 | ||||
| 52 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Network configured (DHCP)" | 52 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Network configured (DHCP)" |
| 53 | 53 | ||||
| 54 | - | echo "Enabled systemd-networkd and iwd" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 54 | + | echo "Enabled systemd-networkd and iwd" >> "$ARCHUP_INSTALL_LOG_FILE" |
M install/config/system.sh +8 -8
| @@ -17,20 +17,20 @@ fi | |||
| 17 | 17 | arch-chroot /mnt ln -sf "/usr/share/zoneinfo/$ARCHUP_TIMEZONE" /etc/localtime | |
| 18 | 18 | arch-chroot /mnt hwclock --systohc | |
| 19 | 19 | ||
| 20 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Timezone set to: $ARCHUP_TIMEZONE" | |
| 20 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Timezone set to: $ARCHUP_TIMEZONE" | |
| 21 | 21 | ||
| 22 | 22 | # Set locale to en_US.UTF-8 | |
| 23 | 23 | echo "en_US.UTF-8 UTF-8" > /mnt/etc/locale.gen | |
| 24 | 24 | arch-chroot /mnt locale-gen | |
| 25 | 25 | echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf | |
| 26 | 26 | ||
| 27 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Locale set to: en_US.UTF-8" | |
| 27 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Locale set to: en_US.UTF-8" | |
| 28 | 28 | ||
| 29 | 29 | # Set console keyboard layout (detected from ISO) | |
| 30 | 30 | if [ -n "$ARCHUP_KEYMAP" ]; then | |
| 31 | 31 | echo "KEYMAP=$ARCHUP_KEYMAP" > /mnt/etc/vconsole.conf | |
| 32 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Console keymap set to: $ARCHUP_KEYMAP" | |
| 33 | - | echo "Console keymap: $ARCHUP_KEYMAP" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 32 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Console keymap set to: $ARCHUP_KEYMAP" | |
| 33 | + | echo "Console keymap: $ARCHUP_KEYMAP" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 34 | 34 | fi | |
| 35 | 35 | ||
| 36 | 36 | # Ask for hostname | |
| @@ -52,8 +52,8 @@ cat > /mnt/etc/hosts <<EOF | |||
| 52 | 52 | 127.0.1.1 $ARCHUP_HOSTNAME.localdomain $ARCHUP_HOSTNAME | |
| 53 | 53 | EOF | |
| 54 | 54 | ||
| 55 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Hostname set to: $ARCHUP_HOSTNAME" | |
| 55 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Hostname set to: $ARCHUP_HOSTNAME" | |
| 56 | 56 | ||
| 57 | - | echo "Timezone: $ARCHUP_TIMEZONE" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 58 | - | echo "Locale: en_US.UTF-8" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 59 | - | echo "Hostname: $ARCHUP_HOSTNAME" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 57 | + | echo "Timezone: $ARCHUP_TIMEZONE" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 58 | + | echo "Locale: en_US.UTF-8" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 59 | + | echo "Hostname: $ARCHUP_HOSTNAME" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -17,20 +17,20 @@ fi | |||||
| 17 | arch-chroot /mnt ln -sf "/usr/share/zoneinfo/$ARCHUP_TIMEZONE" /etc/localtime | 17 | arch-chroot /mnt ln -sf "/usr/share/zoneinfo/$ARCHUP_TIMEZONE" /etc/localtime | ||
| 18 | arch-chroot /mnt hwclock --systohc | 18 | arch-chroot /mnt hwclock --systohc | ||
| 19 | 19 | ||||
| 20 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Timezone set to: $ARCHUP_TIMEZONE" | 20 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Timezone set to: $ARCHUP_TIMEZONE" |
| 21 | 21 | ||||
| 22 | # Set locale to en_US.UTF-8 | 22 | # Set locale to en_US.UTF-8 | ||
| 23 | echo "en_US.UTF-8 UTF-8" > /mnt/etc/locale.gen | 23 | echo "en_US.UTF-8 UTF-8" > /mnt/etc/locale.gen | ||
| 24 | arch-chroot /mnt locale-gen | 24 | arch-chroot /mnt locale-gen | ||
| 25 | echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf | 25 | echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf | ||
| 26 | 26 | ||||
| 27 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Locale set to: en_US.UTF-8" | 27 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Locale set to: en_US.UTF-8" |
| 28 | 28 | ||||
| 29 | # Set console keyboard layout (detected from ISO) | 29 | # Set console keyboard layout (detected from ISO) | ||
| 30 | if [ -n "$ARCHUP_KEYMAP" ]; then | 30 | if [ -n "$ARCHUP_KEYMAP" ]; then | ||
| 31 | echo "KEYMAP=$ARCHUP_KEYMAP" > /mnt/etc/vconsole.conf | 31 | echo "KEYMAP=$ARCHUP_KEYMAP" > /mnt/etc/vconsole.conf | ||
| 32 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Console keymap set to: $ARCHUP_KEYMAP" | 32 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Console keymap set to: $ARCHUP_KEYMAP" |
| 33 | - | echo "Console keymap: $ARCHUP_KEYMAP" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 33 | + | echo "Console keymap: $ARCHUP_KEYMAP" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 34 | fi | 34 | fi | ||
| 35 | 35 | ||||
| 36 | # Ask for hostname | 36 | # Ask for hostname | ||
| @@ -52,8 +52,8 @@ cat > /mnt/etc/hosts <<EOF | |||||
| 52 | 127.0.1.1 $ARCHUP_HOSTNAME.localdomain $ARCHUP_HOSTNAME | 52 | 127.0.1.1 $ARCHUP_HOSTNAME.localdomain $ARCHUP_HOSTNAME | ||
| 53 | EOF | 53 | EOF | ||
| 54 | 54 | ||||
| 55 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Hostname set to: $ARCHUP_HOSTNAME" | 55 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Hostname set to: $ARCHUP_HOSTNAME" |
| 56 | 56 | ||||
| 57 | - | echo "Timezone: $ARCHUP_TIMEZONE" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 57 | + | echo "Timezone: $ARCHUP_TIMEZONE" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 58 | - | echo "Locale: en_US.UTF-8" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 58 | + | echo "Locale: en_US.UTF-8" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 59 | - | echo "Hostname: $ARCHUP_HOSTNAME" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 59 | + | echo "Hostname: $ARCHUP_HOSTNAME" >> "$ARCHUP_INSTALL_LOG_FILE" |
M install/config/user.sh +4 -4
| @@ -43,8 +43,8 @@ echo "$ARCHUP_USERNAME:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd | |||
| 43 | 43 | echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/etc/sudoers.d/wheel | |
| 44 | 44 | chmod 440 /mnt/etc/sudoers.d/wheel | |
| 45 | 45 | ||
| 46 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ User created: $ARCHUP_USERNAME" | |
| 47 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Sudo enabled for wheel group" | |
| 46 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] User created: $ARCHUP_USERNAME" | |
| 47 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Sudo enabled for wheel group" | |
| 48 | 48 | ||
| 49 | - | echo "Created user: $ARCHUP_USERNAME" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 50 | - | echo "Enabled sudo for wheel group" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 49 | + | echo "Created user: $ARCHUP_USERNAME" | |
| 50 | + | echo "Enabled sudo for wheel group" | |
| @@ -43,8 +43,8 @@ echo "$ARCHUP_USERNAME:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd | |||||
| 43 | echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/etc/sudoers.d/wheel | 43 | echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/etc/sudoers.d/wheel | ||
| 44 | chmod 440 /mnt/etc/sudoers.d/wheel | 44 | chmod 440 /mnt/etc/sudoers.d/wheel | ||
| 45 | 45 | ||||
| 46 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ User created: $ARCHUP_USERNAME" | 46 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] User created: $ARCHUP_USERNAME" |
| 47 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Sudo enabled for wheel group" | 47 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Sudo enabled for wheel group" |
| 48 | 48 | ||||
| 49 | - | echo "Created user: $ARCHUP_USERNAME" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 49 | + | echo "Created user: $ARCHUP_USERNAME" |
| 50 | - | echo "Enabled sudo for wheel group" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 50 | + | echo "Enabled sudo for wheel group" |
M install/helpers/errors.sh +54 -38
| @@ -1,8 +1,7 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # Error handling utilities for archup installer | |
| 3 | - | # Adapted from Omarchy errors.sh | |
| 2 | + | # Error handling for archup installer - improved with logging and interactivity | |
| 4 | 3 | ||
| 5 | - | # GitHub issue tracker for bug reports | |
| 4 | + | # QR code for GitHub issues | |
| 6 | 5 | QR_CODE=' | |
| 7 | 6 | █▀▀▀▀▀█ ▀▄██▀▄▀ █▀▀▀▀▀█ | |
| 8 | 7 | █ ███ █ ▄▀ ▀▄▄▄ █ ███ █ | |
| @@ -16,21 +15,30 @@ QR_CODE=' | |||
| 16 | 15 | █ ▀▀▀ █ ▄▀▄▄ █▄▄▀▄▀█ ▀█ | |
| 17 | 16 | ▀▀▀▀▀▀▀ ▀▀▀▀▀ ▀▀▀ ▀▀▀' | |
| 18 | 17 | ||
| 19 | - | # Track if we're already handling an error to prevent double-trapping | |
| 18 | + | # Track error handling state | |
| 20 | 19 | ERROR_HANDLING=false | |
| 21 | 20 | ||
| 22 | - | # Cursor is usually hidden while we install | |
| 21 | + | # Show cursor | |
| 23 | 22 | show_cursor() { | |
| 24 | 23 | printf "\033[?25h" | |
| 25 | 24 | } | |
| 26 | 25 | ||
| 27 | - | # Display truncated log lines from the install log | |
| 26 | + | # Hide cursor | |
| 27 | + | hide_cursor() { | |
| 28 | + | printf "\033[?25l" | |
| 29 | + | } | |
| 30 | + | ||
| 31 | + | # Display truncated log lines | |
| 28 | 32 | show_log_tail() { | |
| 29 | 33 | if [[ -f $ARCHUP_INSTALL_LOG_FILE ]]; then | |
| 30 | - | local log_lines=$(($TERM_HEIGHT - $LOGO_HEIGHT - 35)) | |
| 34 | + | local log_lines=$((TERM_HEIGHT - LOGO_HEIGHT - 35)) | |
| 31 | 35 | local max_line_width=$((LOGO_WIDTH - 4)) | |
| 32 | 36 | ||
| 33 | - | tail -n $log_lines "$ARCHUP_INSTALL_LOG_FILE" | while IFS= read -r line; do | |
| 37 | + | echo | |
| 38 | + | gum style --foreground 3 "Recent log entries:" | |
| 39 | + | echo | |
| 40 | + | ||
| 41 | + | tail -n $log_lines "$ARCHUP_INSTALL_LOG_FILE" 2>/dev/null | while IFS= read -r line; do | |
| 34 | 42 | if ((${#line} > max_line_width)); then | |
| 35 | 43 | local truncated_line="${line:0:$max_line_width}..." | |
| 36 | 44 | else | |
| @@ -44,12 +52,11 @@ show_log_tail() { | |||
| 44 | 52 | fi | |
| 45 | 53 | } | |
| 46 | 54 | ||
| 47 | - | # Display the failed command or script name | |
| 55 | + | # Display failed script or command | |
| 48 | 56 | show_failed_script_or_command() { | |
| 49 | 57 | if [[ -n ${CURRENT_SCRIPT:-} ]]; then | |
| 50 | 58 | gum style "Failed script: $CURRENT_SCRIPT" | |
| 51 | 59 | else | |
| 52 | - | # Truncate long command lines to fit the display | |
| 53 | 60 | local cmd="$BASH_COMMAND" | |
| 54 | 61 | local max_cmd_width=$((LOGO_WIDTH - 4)) | |
| 55 | 62 | ||
| @@ -57,24 +64,23 @@ show_failed_script_or_command() { | |||
| 57 | 64 | cmd="${cmd:0:$max_cmd_width}..." | |
| 58 | 65 | fi | |
| 59 | 66 | ||
| 60 | - | gum style "$cmd" | |
| 67 | + | gum style "Command: $cmd" | |
| 61 | 68 | fi | |
| 62 | 69 | } | |
| 63 | 70 | ||
| 64 | - | # Save original stdout and stderr for trap to use | |
| 71 | + | # Save original file descriptors | |
| 65 | 72 | save_original_outputs() { | |
| 66 | 73 | exec 3>&1 4>&2 | |
| 67 | 74 | } | |
| 68 | 75 | ||
| 69 | - | # Restore stdout and stderr to original (saved in FD 3 and 4) | |
| 70 | - | # This ensures output goes to screen, not log file | |
| 76 | + | # Restore original file descriptors | |
| 71 | 77 | restore_outputs() { | |
| 72 | 78 | if [ -e /proc/self/fd/3 ] && [ -e /proc/self/fd/4 ]; then | |
| 73 | 79 | exec 1>&3 2>&4 | |
| 74 | 80 | fi | |
| 75 | 81 | } | |
| 76 | 82 | ||
| 77 | - | # Error handler | |
| 83 | + | # Main error handler | |
| 78 | 84 | catch_errors() { | |
| 79 | 85 | # Prevent recursive error handling | |
| 80 | 86 | if [[ $ERROR_HANDLING == true ]]; then | |
| @@ -83,52 +89,62 @@ catch_errors() { | |||
| 83 | 89 | ERROR_HANDLING=true | |
| 84 | 90 | fi | |
| 85 | 91 | ||
| 86 | - | # Store exit code immediately before it gets overwritten | |
| 92 | + | # Store exit code immediately (BEFORE any other commands!) | |
| 87 | 93 | local exit_code=$? | |
| 94 | + | local failed_command="${BASH_COMMAND}" | |
| 95 | + | local failed_script="${CURRENT_SCRIPT:-}" | |
| 96 | + | ||
| 97 | + | # Log error to file IMMEDIATELY with direct file write | |
| 98 | + | # This must happen before any stdout/stderr restoration | |
| 99 | + | { | |
| 100 | + | echo "" | |
| 101 | + | echo "=== INSTALLATION ERROR ===" | |
| 102 | + | echo "Timestamp: $(date '+%Y-%m-%d %H:%M:%S')" | |
| 103 | + | echo "Exit Code: $exit_code" | |
| 104 | + | if [[ -n "$failed_script" ]]; then | |
| 105 | + | echo "Failed Script: $failed_script" | |
| 106 | + | fi | |
| 107 | + | echo "Failed Command: $failed_command" | |
| 108 | + | echo "=== END ERROR ===" | |
| 109 | + | echo "" | |
| 110 | + | } >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 88 | 111 | ||
| 112 | + | # Stop background log monitor | |
| 89 | 113 | stop_log_output | |
| 90 | 114 | restore_outputs | |
| 91 | 115 | ||
| 116 | + | # Clear and show error screen | |
| 92 | 117 | clear_logo | |
| 93 | 118 | show_cursor | |
| 94 | 119 | ||
| 95 | 120 | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "archup installation stopped!" | |
| 96 | 121 | show_log_tail | |
| 97 | 122 | ||
| 123 | + | echo | |
| 98 | 124 | gum style "This command halted with exit code $exit_code:" | |
| 99 | 125 | show_failed_script_or_command | |
| 126 | + | echo | |
| 100 | 127 | ||
| 101 | 128 | gum style "$QR_CODE" | |
| 102 | 129 | echo | |
| 103 | - | gum style "Report issues at ${ARCHUP_REPO_URL:-https://github.com/bnema/archup}/issues" | |
| 130 | + | gum style "Check logs: $ARCHUP_INSTALL_LOG_FILE" | |
| 131 | + | gum style "Report issues: ${ARCHUP_REPO_URL:-https://github.com/bnema/archup}/issues" | |
| 132 | + | echo | |
| 104 | 133 | ||
| 105 | - | # Offer options menu | |
| 134 | + | # Interactive menu | |
| 106 | 135 | while true; do | |
| 107 | - | options=() | |
| 108 | - | ||
| 109 | - | # Add upload option if internet is available | |
| 110 | - | if ping -c 1 -W 1 1.1.1.1 >/dev/null 2>&1; then | |
| 111 | - | options+=("Upload log for support") | |
| 112 | - | fi | |
| 113 | - | ||
| 114 | - | # Add remaining options | |
| 115 | - | options+=("View full log") | |
| 116 | - | options+=("Exit") | |
| 136 | + | options=("View full log" "Exit") | |
| 117 | 137 | ||
| 118 | - | choice=$(gum choose "${options[@]}" --header "What would you like to do?" --height 6 --padding "1 $PADDING_LEFT") | |
| 138 | + | choice=$(gum choose "${options[@]}" --header "What would you like to do?" --height 4 --padding "0 0 0 $PADDING_LEFT") | |
| 119 | 139 | ||
| 120 | 140 | case "$choice" in | |
| 121 | 141 | "View full log") | |
| 122 | 142 | if command -v less &>/dev/null; then | |
| 123 | 143 | less "$ARCHUP_INSTALL_LOG_FILE" | |
| 124 | 144 | else | |
| 125 | - | tail "$ARCHUP_INSTALL_LOG_FILE" | |
| 145 | + | cat "$ARCHUP_INSTALL_LOG_FILE" | tail -n 100 | |
| 126 | 146 | fi | |
| 127 | - | ;; | |
| 128 | - | "Upload log for support") | |
| 129 | - | # Future: implement log upload (curl to pastebin service) | |
| 130 | - | gum style --foreground 3 "Log upload not yet implemented" | |
| 131 | - | gum style "Please manually upload: $ARCHUP_INSTALL_LOG_FILE" | |
| 147 | + | clear_logo | |
| 132 | 148 | ;; | |
| 133 | 149 | "Exit" | "") | |
| 134 | 150 | exit 1 | |
| @@ -137,11 +153,11 @@ catch_errors() { | |||
| 137 | 153 | done | |
| 138 | 154 | } | |
| 139 | 155 | ||
| 140 | - | # Exit handler - ensures cleanup happens on any exit | |
| 156 | + | # Exit handler | |
| 141 | 157 | exit_handler() { | |
| 142 | 158 | local exit_code=$? | |
| 143 | 159 | ||
| 144 | - | # Only run if we're exiting with an error and haven't already handled it | |
| 160 | + | # Only run if exiting with error and not already handled | |
| 145 | 161 | if [[ $exit_code -ne 0 && $ERROR_HANDLING != true ]]; then | |
| 146 | 162 | catch_errors | |
| 147 | 163 | else | |
| @@ -154,5 +170,5 @@ exit_handler() { | |||
| 154 | 170 | trap catch_errors ERR INT TERM | |
| 155 | 171 | trap exit_handler EXIT | |
| 156 | 172 | ||
| 157 | - | # Save original outputs in case we trap | |
| 173 | + | # Save original outputs for restoration | |
| 158 | 174 | save_original_outputs | |
| @@ -1,8 +1,7 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # Error handling utilities for archup installer | 2 | + | # Error handling for archup installer - improved with logging and interactivity |
| 3 | - | # Adapted from Omarchy errors.sh | |||
| 4 | 3 | ||||
| 5 | - | # GitHub issue tracker for bug reports | 4 | + | # QR code for GitHub issues |
| 6 | QR_CODE=' | 5 | QR_CODE=' | ||
| 7 | █▀▀▀▀▀█ ▀▄██▀▄▀ █▀▀▀▀▀█ | 6 | █▀▀▀▀▀█ ▀▄██▀▄▀ █▀▀▀▀▀█ | ||
| 8 | █ ███ █ ▄▀ ▀▄▄▄ █ ███ █ | 7 | █ ███ █ ▄▀ ▀▄▄▄ █ ███ █ | ||
| @@ -16,21 +15,30 @@ QR_CODE=' | |||||
| 16 | █ ▀▀▀ █ ▄▀▄▄ █▄▄▀▄▀█ ▀█ | 15 | █ ▀▀▀ █ ▄▀▄▄ █▄▄▀▄▀█ ▀█ | ||
| 17 | ▀▀▀▀▀▀▀ ▀▀▀▀▀ ▀▀▀ ▀▀▀' | 16 | ▀▀▀▀▀▀▀ ▀▀▀▀▀ ▀▀▀ ▀▀▀' | ||
| 18 | 17 | ||||
| 19 | - | # Track if we're already handling an error to prevent double-trapping | 18 | + | # Track error handling state |
| 20 | ERROR_HANDLING=false | 19 | ERROR_HANDLING=false | ||
| 21 | 20 | ||||
| 22 | - | # Cursor is usually hidden while we install | 21 | + | # Show cursor |
| 23 | show_cursor() { | 22 | show_cursor() { | ||
| 24 | printf "\033[?25h" | 23 | printf "\033[?25h" | ||
| 25 | } | 24 | } | ||
| 26 | 25 | ||||
| 27 | - | # Display truncated log lines from the install log | 26 | + | # Hide cursor |
| 27 | + | hide_cursor() { | |||
| 28 | + | printf "\033[?25l" | |||
| 29 | + | } | |||
| 30 | + | ||||
| 31 | + | # Display truncated log lines | |||
| 28 | show_log_tail() { | 32 | show_log_tail() { | ||
| 29 | if [[ -f $ARCHUP_INSTALL_LOG_FILE ]]; then | 33 | if [[ -f $ARCHUP_INSTALL_LOG_FILE ]]; then | ||
| 30 | - | local log_lines=$(($TERM_HEIGHT - $LOGO_HEIGHT - 35)) | 34 | + | local log_lines=$((TERM_HEIGHT - LOGO_HEIGHT - 35)) |
| 31 | local max_line_width=$((LOGO_WIDTH - 4)) | 35 | local max_line_width=$((LOGO_WIDTH - 4)) | ||
| 32 | 36 | ||||
| 33 | - | tail -n $log_lines "$ARCHUP_INSTALL_LOG_FILE" | while IFS= read -r line; do | 37 | + | echo |
| 38 | + | gum style --foreground 3 "Recent log entries:" | |||
| 39 | + | echo | |||
| 40 | + | ||||
| 41 | + | tail -n $log_lines "$ARCHUP_INSTALL_LOG_FILE" 2>/dev/null | while IFS= read -r line; do | |||
| 34 | if ((${#line} > max_line_width)); then | 42 | if ((${#line} > max_line_width)); then | ||
| 35 | local truncated_line="${line:0:$max_line_width}..." | 43 | local truncated_line="${line:0:$max_line_width}..." | ||
| 36 | else | 44 | else | ||
| @@ -44,12 +52,11 @@ show_log_tail() { | |||||
| 44 | fi | 52 | fi | ||
| 45 | } | 53 | } | ||
| 46 | 54 | ||||
| 47 | - | # Display the failed command or script name | 55 | + | # Display failed script or command |
| 48 | show_failed_script_or_command() { | 56 | show_failed_script_or_command() { | ||
| 49 | if [[ -n ${CURRENT_SCRIPT:-} ]]; then | 57 | if [[ -n ${CURRENT_SCRIPT:-} ]]; then | ||
| 50 | gum style "Failed script: $CURRENT_SCRIPT" | 58 | gum style "Failed script: $CURRENT_SCRIPT" | ||
| 51 | else | 59 | else | ||
| 52 | - | # Truncate long command lines to fit the display | |||
| 53 | local cmd="$BASH_COMMAND" | 60 | local cmd="$BASH_COMMAND" | ||
| 54 | local max_cmd_width=$((LOGO_WIDTH - 4)) | 61 | local max_cmd_width=$((LOGO_WIDTH - 4)) | ||
| 55 | 62 | ||||
| @@ -57,24 +64,23 @@ show_failed_script_or_command() { | |||||
| 57 | cmd="${cmd:0:$max_cmd_width}..." | 64 | cmd="${cmd:0:$max_cmd_width}..." | ||
| 58 | fi | 65 | fi | ||
| 59 | 66 | ||||
| 60 | - | gum style "$cmd" | 67 | + | gum style "Command: $cmd" |
| 61 | fi | 68 | fi | ||
| 62 | } | 69 | } | ||
| 63 | 70 | ||||
| 64 | - | # Save original stdout and stderr for trap to use | 71 | + | # Save original file descriptors |
| 65 | save_original_outputs() { | 72 | save_original_outputs() { | ||
| 66 | exec 3>&1 4>&2 | 73 | exec 3>&1 4>&2 | ||
| 67 | } | 74 | } | ||
| 68 | 75 | ||||
| 69 | - | # Restore stdout and stderr to original (saved in FD 3 and 4) | 76 | + | # Restore original file descriptors |
| 70 | - | # This ensures output goes to screen, not log file | |||
| 71 | restore_outputs() { | 77 | restore_outputs() { | ||
| 72 | if [ -e /proc/self/fd/3 ] && [ -e /proc/self/fd/4 ]; then | 78 | if [ -e /proc/self/fd/3 ] && [ -e /proc/self/fd/4 ]; then | ||
| 73 | exec 1>&3 2>&4 | 79 | exec 1>&3 2>&4 | ||
| 74 | fi | 80 | fi | ||
| 75 | } | 81 | } | ||
| 76 | 82 | ||||
| 77 | - | # Error handler | 83 | + | # Main error handler |
| 78 | catch_errors() { | 84 | catch_errors() { | ||
| 79 | # Prevent recursive error handling | 85 | # Prevent recursive error handling | ||
| 80 | if [[ $ERROR_HANDLING == true ]]; then | 86 | if [[ $ERROR_HANDLING == true ]]; then | ||
| @@ -83,52 +89,62 @@ catch_errors() { | |||||
| 83 | ERROR_HANDLING=true | 89 | ERROR_HANDLING=true | ||
| 84 | fi | 90 | fi | ||
| 85 | 91 | ||||
| 86 | - | # Store exit code immediately before it gets overwritten | 92 | + | # Store exit code immediately (BEFORE any other commands!) |
| 87 | local exit_code=$? | 93 | local exit_code=$? | ||
| 94 | + | local failed_command="${BASH_COMMAND}" | |||
| 95 | + | local failed_script="${CURRENT_SCRIPT:-}" | |||
| 96 | + | ||||
| 97 | + | # Log error to file IMMEDIATELY with direct file write | |||
| 98 | + | # This must happen before any stdout/stderr restoration | |||
| 99 | + | { | |||
| 100 | + | echo "" | |||
| 101 | + | echo "=== INSTALLATION ERROR ===" | |||
| 102 | + | echo "Timestamp: $(date '+%Y-%m-%d %H:%M:%S')" | |||
| 103 | + | echo "Exit Code: $exit_code" | |||
| 104 | + | if [[ -n "$failed_script" ]]; then | |||
| 105 | + | echo "Failed Script: $failed_script" | |||
| 106 | + | fi | |||
| 107 | + | echo "Failed Command: $failed_command" | |||
| 108 | + | echo "=== END ERROR ===" | |||
| 109 | + | echo "" | |||
| 110 | + | } >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 88 | 111 | ||||
| 112 | + | # Stop background log monitor | |||
| 89 | stop_log_output | 113 | stop_log_output | ||
| 90 | restore_outputs | 114 | restore_outputs | ||
| 91 | 115 | ||||
| 116 | + | # Clear and show error screen | |||
| 92 | clear_logo | 117 | clear_logo | ||
| 93 | show_cursor | 118 | show_cursor | ||
| 94 | 119 | ||||
| 95 | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "archup installation stopped!" | 120 | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "archup installation stopped!" | ||
| 96 | show_log_tail | 121 | show_log_tail | ||
| 97 | 122 | ||||
| 123 | + | echo | |||
| 98 | gum style "This command halted with exit code $exit_code:" | 124 | gum style "This command halted with exit code $exit_code:" | ||
| 99 | show_failed_script_or_command | 125 | show_failed_script_or_command | ||
| 126 | + | echo | |||
| 100 | 127 | ||||
| 101 | gum style "$QR_CODE" | 128 | gum style "$QR_CODE" | ||
| 102 | echo | 129 | echo | ||
| 103 | - | gum style "Report issues at ${ARCHUP_REPO_URL:-https://github.com/bnema/archup}/issues" | 130 | + | gum style "Check logs: $ARCHUP_INSTALL_LOG_FILE" |
| 131 | + | gum style "Report issues: ${ARCHUP_REPO_URL:-https://github.com/bnema/archup}/issues" | |||
| 132 | + | echo | |||
| 104 | 133 | ||||
| 105 | - | # Offer options menu | 134 | + | # Interactive menu |
| 106 | while true; do | 135 | while true; do | ||
| 107 | - | options=() | 136 | + | options=("View full log" "Exit") |
| 108 | - | ||||
| 109 | - | # Add upload option if internet is available | |||
| 110 | - | if ping -c 1 -W 1 1.1.1.1 >/dev/null 2>&1; then | |||
| 111 | - | options+=("Upload log for support") | |||
| 112 | - | fi | |||
| 113 | - | ||||
| 114 | - | # Add remaining options | |||
| 115 | - | options+=("View full log") | |||
| 116 | - | options+=("Exit") | |||
| 117 | 137 | ||||
| 118 | - | choice=$(gum choose "${options[@]}" --header "What would you like to do?" --height 6 --padding "1 $PADDING_LEFT") | 138 | + | choice=$(gum choose "${options[@]}" --header "What would you like to do?" --height 4 --padding "0 0 0 $PADDING_LEFT") |
| 119 | 139 | ||||
| 120 | case "$choice" in | 140 | case "$choice" in | ||
| 121 | "View full log") | 141 | "View full log") | ||
| 122 | if command -v less &>/dev/null; then | 142 | if command -v less &>/dev/null; then | ||
| 123 | less "$ARCHUP_INSTALL_LOG_FILE" | 143 | less "$ARCHUP_INSTALL_LOG_FILE" | ||
| 124 | else | 144 | else | ||
| 125 | - | tail "$ARCHUP_INSTALL_LOG_FILE" | 145 | + | cat "$ARCHUP_INSTALL_LOG_FILE" | tail -n 100 |
| 126 | fi | 146 | fi | ||
| 127 | - | ;; | 147 | + | clear_logo |
| 128 | - | "Upload log for support") | |||
| 129 | - | # Future: implement log upload (curl to pastebin service) | |||
| 130 | - | gum style --foreground 3 "Log upload not yet implemented" | |||
| 131 | - | gum style "Please manually upload: $ARCHUP_INSTALL_LOG_FILE" | |||
| 132 | ;; | 148 | ;; | ||
| 133 | "Exit" | "") | 149 | "Exit" | "") | ||
| 134 | exit 1 | 150 | exit 1 | ||
| @@ -137,11 +153,11 @@ catch_errors() { | |||||
| 137 | done | 153 | done | ||
| 138 | } | 154 | } | ||
| 139 | 155 | ||||
| 140 | - | # Exit handler - ensures cleanup happens on any exit | 156 | + | # Exit handler |
| 141 | exit_handler() { | 157 | exit_handler() { | ||
| 142 | local exit_code=$? | 158 | local exit_code=$? | ||
| 143 | 159 | ||||
| 144 | - | # Only run if we're exiting with an error and haven't already handled it | 160 | + | # Only run if exiting with error and not already handled |
| 145 | if [[ $exit_code -ne 0 && $ERROR_HANDLING != true ]]; then | 161 | if [[ $exit_code -ne 0 && $ERROR_HANDLING != true ]]; then | ||
| 146 | catch_errors | 162 | catch_errors | ||
| 147 | else | 163 | else | ||
| @@ -154,5 +170,5 @@ exit_handler() { | |||||
| 154 | trap catch_errors ERR INT TERM | 170 | trap catch_errors ERR INT TERM | ||
| 155 | trap exit_handler EXIT | 171 | trap exit_handler EXIT | ||
| 156 | 172 | ||||
| 157 | - | # Save original outputs in case we trap | 173 | + | # Save original outputs for restoration |
| 158 | save_original_outputs | 174 | save_original_outputs | ||
M install/helpers/logging.sh +19 -15
| @@ -1,7 +1,11 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # Logging utilities for archup installer | |
| 3 | - | # Adapted from Omarchy logging.sh | |
| 2 | + | # Logging system for archup installer - fixes variable export issues | |
| 3 | + | # Uses background process for log display instead of exec redirection | |
| 4 | 4 | ||
| 5 | + | # Global variable for monitor background process | |
| 6 | + | monitor_pid="" | |
| 7 | + | ||
| 8 | + | # Background process to monitor and display log in real-time | |
| 5 | 9 | start_log_output() { | |
| 6 | 10 | local ANSI_SAVE_CURSOR="\033[s" | |
| 7 | 11 | local ANSI_RESTORE_CURSOR="\033[u" | |
| @@ -14,6 +18,7 @@ start_log_output() { | |||
| 14 | 18 | printf $ANSI_SAVE_CURSOR | |
| 15 | 19 | printf $ANSI_HIDE_CURSOR | |
| 16 | 20 | ||
| 21 | + | # Start background monitor process | |
| 17 | 22 | ( | |
| 18 | 23 | local log_lines=20 | |
| 19 | 24 | local max_line_width=$((LOGO_WIDTH - 4)) | |
| @@ -32,7 +37,7 @@ start_log_output() { | |||
| 32 | 37 | line="${line:0:$max_line_width}..." | |
| 33 | 38 | fi | |
| 34 | 39 | ||
| 35 | - | # Add clear line escape and formatted output for each line | |
| 40 | + | # Add formatted output for each line | |
| 36 | 41 | if [ -n "$line" ]; then | |
| 37 | 42 | output+="${ANSI_CLEAR_LINE}${ANSI_GRAY}${PADDING_LEFT_SPACES} → ${line}${ANSI_RESET}\n" | |
| 38 | 43 | else | |
| @@ -41,7 +46,6 @@ start_log_output() { | |||
| 41 | 46 | done | |
| 42 | 47 | ||
| 43 | 48 | printf "${ANSI_RESTORE_CURSOR}%b" "$output" | |
| 44 | - | ||
| 45 | 49 | sleep 0.1 | |
| 46 | 50 | done | |
| 47 | 51 | ) & | |
| @@ -61,8 +65,9 @@ start_install_log() { | |||
| 61 | 65 | chmod 666 "$ARCHUP_INSTALL_LOG_FILE" | |
| 62 | 66 | ||
| 63 | 67 | export ARCHUP_START_TIME=$(date '+%Y-%m-%d %H:%M:%S') | |
| 68 | + | echo "=== archup Installation Started: $ARCHUP_START_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 64 | 69 | ||
| 65 | - | echo "=== archup Installation Started: $ARCHUP_START_TIME ===" >>"$ARCHUP_INSTALL_LOG_FILE" | |
| 70 | + | # Start background log display (NO exec redirection!) | |
| 66 | 71 | start_log_output | |
| 67 | 72 | } | |
| 68 | 73 | ||
| @@ -72,9 +77,8 @@ stop_install_log() { | |||
| 72 | 77 | ||
| 73 | 78 | if [[ -n ${ARCHUP_INSTALL_LOG_FILE:-} ]]; then | |
| 74 | 79 | ARCHUP_END_TIME=$(date '+%Y-%m-%d %H:%M:%S') | |
| 75 | - | echo "=== archup Installation Completed: $ARCHUP_END_TIME ===" >>"$ARCHUP_INSTALL_LOG_FILE" | |
| 76 | - | echo "" >>"$ARCHUP_INSTALL_LOG_FILE" | |
| 77 | - | echo "=== Installation Time Summary ===" >>"$ARCHUP_INSTALL_LOG_FILE" | |
| 80 | + | echo "" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 81 | + | echo "=== archup Installation Completed: $ARCHUP_END_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 78 | 82 | ||
| 79 | 83 | if [ -n "$ARCHUP_START_TIME" ]; then | |
| 80 | 84 | ARCHUP_START_EPOCH=$(date -d "$ARCHUP_START_TIME" +%s) | |
| @@ -84,9 +88,9 @@ stop_install_log() { | |||
| 84 | 88 | ARCHUP_MINS=$((ARCHUP_DURATION / 60)) | |
| 85 | 89 | ARCHUP_SECS=$((ARCHUP_DURATION % 60)) | |
| 86 | 90 | ||
| 87 | - | echo "archup: ${ARCHUP_MINS}m ${ARCHUP_SECS}s" >>"$ARCHUP_INSTALL_LOG_FILE" | |
| 91 | + | echo "Duration: ${ARCHUP_MINS}m ${ARCHUP_SECS}s" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 88 | 92 | fi | |
| 89 | - | echo "=================================" >>"$ARCHUP_INSTALL_LOG_FILE" | |
| 93 | + | echo "=================================" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 90 | 94 | fi | |
| 91 | 95 | } | |
| 92 | 96 | ||
| @@ -95,18 +99,18 @@ run_logged() { | |||
| 95 | 99 | ||
| 96 | 100 | export CURRENT_SCRIPT="$script" | |
| 97 | 101 | ||
| 98 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >>"$ARCHUP_INSTALL_LOG_FILE" | |
| 102 | + | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 99 | 103 | ||
| 100 | - | # Use bash -c to create a clean subshell | |
| 101 | - | bash -c "source '$script'" </dev/null >>"$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 104 | + | # Use bash -c to create a clean subshell and redirect output to log | |
| 105 | + | bash -c "source '$script'" </dev/null >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 102 | 106 | ||
| 103 | 107 | local exit_code=$? | |
| 104 | 108 | ||
| 105 | 109 | if [ $exit_code -eq 0 ]; then | |
| 106 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Completed: $script" >>"$ARCHUP_INSTALL_LOG_FILE" | |
| 110 | + | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Completed: $script" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 107 | 111 | unset CURRENT_SCRIPT | |
| 108 | 112 | else | |
| 109 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Failed: $script (exit code: $exit_code)" >>"$ARCHUP_INSTALL_LOG_FILE" | |
| 113 | + | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Failed: $script (exit code: $exit_code)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 110 | 114 | fi | |
| 111 | 115 | ||
| 112 | 116 | return $exit_code | |
| @@ -1,7 +1,11 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # Logging utilities for archup installer | 2 | + | # Logging system for archup installer - fixes variable export issues |
| 3 | - | # Adapted from Omarchy logging.sh | 3 | + | # Uses background process for log display instead of exec redirection |
| 4 | 4 | ||||
| 5 | + | # Global variable for monitor background process | |||
| 6 | + | monitor_pid="" | |||
| 7 | + | ||||
| 8 | + | # Background process to monitor and display log in real-time | |||
| 5 | start_log_output() { | 9 | start_log_output() { | ||
| 6 | local ANSI_SAVE_CURSOR="\033[s" | 10 | local ANSI_SAVE_CURSOR="\033[s" | ||
| 7 | local ANSI_RESTORE_CURSOR="\033[u" | 11 | local ANSI_RESTORE_CURSOR="\033[u" | ||
| @@ -14,6 +18,7 @@ start_log_output() { | |||||
| 14 | printf $ANSI_SAVE_CURSOR | 18 | printf $ANSI_SAVE_CURSOR | ||
| 15 | printf $ANSI_HIDE_CURSOR | 19 | printf $ANSI_HIDE_CURSOR | ||
| 16 | 20 | ||||
| 21 | + | # Start background monitor process | |||
| 17 | ( | 22 | ( | ||
| 18 | local log_lines=20 | 23 | local log_lines=20 | ||
| 19 | local max_line_width=$((LOGO_WIDTH - 4)) | 24 | local max_line_width=$((LOGO_WIDTH - 4)) | ||
| @@ -32,7 +37,7 @@ start_log_output() { | |||||
| 32 | line="${line:0:$max_line_width}..." | 37 | line="${line:0:$max_line_width}..." | ||
| 33 | fi | 38 | fi | ||
| 34 | 39 | ||||
| 35 | - | # Add clear line escape and formatted output for each line | 40 | + | # Add formatted output for each line |
| 36 | if [ -n "$line" ]; then | 41 | if [ -n "$line" ]; then | ||
| 37 | output+="${ANSI_CLEAR_LINE}${ANSI_GRAY}${PADDING_LEFT_SPACES} → ${line}${ANSI_RESET}\n" | 42 | output+="${ANSI_CLEAR_LINE}${ANSI_GRAY}${PADDING_LEFT_SPACES} → ${line}${ANSI_RESET}\n" | ||
| 38 | else | 43 | else | ||
| @@ -41,7 +46,6 @@ start_log_output() { | |||||
| 41 | done | 46 | done | ||
| 42 | 47 | ||||
| 43 | printf "${ANSI_RESTORE_CURSOR}%b" "$output" | 48 | printf "${ANSI_RESTORE_CURSOR}%b" "$output" | ||
| 44 | - | ||||
| 45 | sleep 0.1 | 49 | sleep 0.1 | ||
| 46 | done | 50 | done | ||
| 47 | ) & | 51 | ) & | ||
| @@ -61,8 +65,9 @@ start_install_log() { | |||||
| 61 | chmod 666 "$ARCHUP_INSTALL_LOG_FILE" | 65 | chmod 666 "$ARCHUP_INSTALL_LOG_FILE" | ||
| 62 | 66 | ||||
| 63 | export ARCHUP_START_TIME=$(date '+%Y-%m-%d %H:%M:%S') | 67 | export ARCHUP_START_TIME=$(date '+%Y-%m-%d %H:%M:%S') | ||
| 68 | + | echo "=== archup Installation Started: $ARCHUP_START_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 64 | 69 | ||||
| 65 | - | echo "=== archup Installation Started: $ARCHUP_START_TIME ===" >>"$ARCHUP_INSTALL_LOG_FILE" | 70 | + | # Start background log display (NO exec redirection!) |
| 66 | start_log_output | 71 | start_log_output | ||
| 67 | } | 72 | } | ||
| 68 | 73 | ||||
| @@ -72,9 +77,8 @@ stop_install_log() { | |||||
| 72 | 77 | ||||
| 73 | if [[ -n ${ARCHUP_INSTALL_LOG_FILE:-} ]]; then | 78 | if [[ -n ${ARCHUP_INSTALL_LOG_FILE:-} ]]; then | ||
| 74 | ARCHUP_END_TIME=$(date '+%Y-%m-%d %H:%M:%S') | 79 | ARCHUP_END_TIME=$(date '+%Y-%m-%d %H:%M:%S') | ||
| 75 | - | echo "=== archup Installation Completed: $ARCHUP_END_TIME ===" >>"$ARCHUP_INSTALL_LOG_FILE" | 80 | + | echo "" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 76 | - | echo "" >>"$ARCHUP_INSTALL_LOG_FILE" | 81 | + | echo "=== archup Installation Completed: $ARCHUP_END_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 77 | - | echo "=== Installation Time Summary ===" >>"$ARCHUP_INSTALL_LOG_FILE" | |||
| 78 | 82 | ||||
| 79 | if [ -n "$ARCHUP_START_TIME" ]; then | 83 | if [ -n "$ARCHUP_START_TIME" ]; then | ||
| 80 | ARCHUP_START_EPOCH=$(date -d "$ARCHUP_START_TIME" +%s) | 84 | ARCHUP_START_EPOCH=$(date -d "$ARCHUP_START_TIME" +%s) | ||
| @@ -84,9 +88,9 @@ stop_install_log() { | |||||
| 84 | ARCHUP_MINS=$((ARCHUP_DURATION / 60)) | 88 | ARCHUP_MINS=$((ARCHUP_DURATION / 60)) | ||
| 85 | ARCHUP_SECS=$((ARCHUP_DURATION % 60)) | 89 | ARCHUP_SECS=$((ARCHUP_DURATION % 60)) | ||
| 86 | 90 | ||||
| 87 | - | echo "archup: ${ARCHUP_MINS}m ${ARCHUP_SECS}s" >>"$ARCHUP_INSTALL_LOG_FILE" | 91 | + | echo "Duration: ${ARCHUP_MINS}m ${ARCHUP_SECS}s" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 88 | fi | 92 | fi | ||
| 89 | - | echo "=================================" >>"$ARCHUP_INSTALL_LOG_FILE" | 93 | + | echo "=================================" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 90 | fi | 94 | fi | ||
| 91 | } | 95 | } | ||
| 92 | 96 | ||||
| @@ -95,18 +99,18 @@ run_logged() { | |||||
| 95 | 99 | ||||
| 96 | export CURRENT_SCRIPT="$script" | 100 | export CURRENT_SCRIPT="$script" | ||
| 97 | 101 | ||||
| 98 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >>"$ARCHUP_INSTALL_LOG_FILE" | 102 | + | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 99 | 103 | ||||
| 100 | - | # Use bash -c to create a clean subshell | 104 | + | # Use bash -c to create a clean subshell and redirect output to log |
| 101 | - | bash -c "source '$script'" </dev/null >>"$ARCHUP_INSTALL_LOG_FILE" 2>&1 | 105 | + | bash -c "source '$script'" </dev/null >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 |
| 102 | 106 | ||||
| 103 | local exit_code=$? | 107 | local exit_code=$? | ||
| 104 | 108 | ||||
| 105 | if [ $exit_code -eq 0 ]; then | 109 | if [ $exit_code -eq 0 ]; then | ||
| 106 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Completed: $script" >>"$ARCHUP_INSTALL_LOG_FILE" | 110 | + | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Completed: $script" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 107 | unset CURRENT_SCRIPT | 111 | unset CURRENT_SCRIPT | ||
| 108 | else | 112 | else | ||
| 109 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Failed: $script (exit code: $exit_code)" >>"$ARCHUP_INSTALL_LOG_FILE" | 113 | + | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Failed: $script (exit code: $exit_code)" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 110 | fi | 114 | fi | ||
| 111 | 115 | ||||
| 112 | return $exit_code | 116 | return $exit_code | ||
M install/helpers/presentation.sh +10 -0
| @@ -46,3 +46,13 @@ clear_logo() { | |||
| 46 | 46 | printf "\033[H\033[2J" # Clear screen and move cursor to top-left | |
| 47 | 47 | gum style --foreground 4 --padding "1 0 0 $PADDING_LEFT" "$(<"$LOGO_PATH")" | |
| 48 | 48 | } | |
| 49 | + | ||
| 50 | + | # Show cursor (used in cleanup) | |
| 51 | + | show_cursor() { | |
| 52 | + | printf "\033[?25h" | |
| 53 | + | } | |
| 54 | + | ||
| 55 | + | # Hide cursor (used during installation) | |
| 56 | + | hide_cursor() { | |
| 57 | + | printf "\033[?25l" | |
| 58 | + | } | |
| @@ -46,3 +46,13 @@ clear_logo() { | |||||
| 46 | printf "\033[H\033[2J" # Clear screen and move cursor to top-left | 46 | printf "\033[H\033[2J" # Clear screen and move cursor to top-left | ||
| 47 | gum style --foreground 4 --padding "1 0 0 $PADDING_LEFT" "$(<"$LOGO_PATH")" | 47 | gum style --foreground 4 --padding "1 0 0 $PADDING_LEFT" "$(<"$LOGO_PATH")" | ||
| 48 | } | 48 | } | ||
| 49 | + | ||||
| 50 | + | # Show cursor (used in cleanup) | |||
| 51 | + | show_cursor() { | |||
| 52 | + | printf "\033[?25h" | |||
| 53 | + | } | |||
| 54 | + | ||||
| 55 | + | # Hide cursor (used during installation) | |||
| 56 | + | hide_cursor() { | |||
| 57 | + | printf "\033[?25l" | |||
| 58 | + | } | |||
M install/partitioning/all.sh +5 -5
| @@ -1,7 +1,7 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # Partitioning phase orchestrator | |
| 2 | + | # Partitioning phase | |
| 3 | 3 | ||
| 4 | - | run_logged "$ARCHUP_INSTALL/partitioning/detect-disk.sh" | |
| 5 | - | run_logged "$ARCHUP_INSTALL/partitioning/partition.sh" | |
| 6 | - | run_logged "$ARCHUP_INSTALL/partitioning/format.sh" | |
| 7 | - | run_logged "$ARCHUP_INSTALL/partitioning/mount.sh" | |
| 4 | + | source "$ARCHUP_INSTALL/partitioning/detect-disk.sh" # Interactive (gum confirm) | |
| 5 | + | run_logged "$ARCHUP_INSTALL/partitioning/partition.sh" # Non-interactive | |
| 6 | + | run_logged "$ARCHUP_INSTALL/partitioning/format.sh" # Non-interactive | |
| 7 | + | run_logged "$ARCHUP_INSTALL/partitioning/mount.sh" # Non-interactive | |
| @@ -1,7 +1,7 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # Partitioning phase orchestrator | 2 | + | # Partitioning phase |
| 3 | 3 | ||||
| 4 | - | run_logged "$ARCHUP_INSTALL/partitioning/detect-disk.sh" | 4 | + | source "$ARCHUP_INSTALL/partitioning/detect-disk.sh" # Interactive (gum confirm) |
| 5 | - | run_logged "$ARCHUP_INSTALL/partitioning/partition.sh" | 5 | + | run_logged "$ARCHUP_INSTALL/partitioning/partition.sh" # Non-interactive |
| 6 | - | run_logged "$ARCHUP_INSTALL/partitioning/format.sh" | 6 | + | run_logged "$ARCHUP_INSTALL/partitioning/format.sh" # Non-interactive |
| 7 | - | run_logged "$ARCHUP_INSTALL/partitioning/mount.sh" | 7 | + | run_logged "$ARCHUP_INSTALL/partitioning/mount.sh" # Non-interactive |
M install/partitioning/detect-disk.sh +3 -1
| @@ -9,6 +9,7 @@ mapfile -t disks < <(lsblk -dno NAME,SIZE,TYPE | grep disk | awk '{print "/dev/" | |||
| 9 | 9 | ||
| 10 | 10 | if [ ${#disks[@]} -eq 0 ]; then | |
| 11 | 11 | gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "No disks found!" | |
| 12 | + | echo "ERROR: No disks found" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 12 | 13 | exit 1 | |
| 13 | 14 | fi | |
| 14 | 15 | ||
| @@ -30,7 +31,8 @@ echo | |||
| 30 | 31 | # Final confirmation | |
| 31 | 32 | if ! gum confirm "WARNING: All data on $ARCHUP_DISK will be permanently erased. Continue?" --padding "0 0 1 $PADDING_LEFT"; then | |
| 32 | 33 | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user" | |
| 34 | + | echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 33 | 35 | exit 0 | |
| 34 | 36 | fi | |
| 35 | 37 | ||
| 36 | - | echo "Disk selected: $ARCHUP_DISK" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 38 | + | echo "Disk selected: $ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -9,6 +9,7 @@ mapfile -t disks < <(lsblk -dno NAME,SIZE,TYPE | grep disk | awk '{print "/dev/" | |||||
| 9 | 9 | ||||
| 10 | if [ ${#disks[@]} -eq 0 ]; then | 10 | if [ ${#disks[@]} -eq 0 ]; then | ||
| 11 | gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "No disks found!" | 11 | gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "No disks found!" | ||
| 12 | + | echo "ERROR: No disks found" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 12 | exit 1 | 13 | exit 1 | ||
| 13 | fi | 14 | fi | ||
| 14 | 15 | ||||
| @@ -30,7 +31,8 @@ echo | |||||
| 30 | # Final confirmation | 31 | # Final confirmation | ||
| 31 | if ! gum confirm "WARNING: All data on $ARCHUP_DISK will be permanently erased. Continue?" --padding "0 0 1 $PADDING_LEFT"; then | 32 | if ! gum confirm "WARNING: All data on $ARCHUP_DISK will be permanently erased. Continue?" --padding "0 0 1 $PADDING_LEFT"; then | ||
| 32 | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user" | 33 | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user" | ||
| 34 | + | echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 33 | exit 0 | 35 | exit 0 | ||
| 34 | fi | 36 | fi | ||
| 35 | 37 | ||||
| 36 | - | echo "Disk selected: $ARCHUP_DISK" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 38 | + | echo "Disk selected: $ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" |
M install/partitioning/format.sh +9 -8
| @@ -4,8 +4,8 @@ | |||
| 4 | 4 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Formatting partitions..." | |
| 5 | 5 | ||
| 6 | 6 | # Format EFI partition as FAT32 | |
| 7 | - | mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART" | |
| 8 | - | echo "Formatted $ARCHUP_EFI_PART as FAT32" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 7 | + | mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART" 2>&1 | |
| 8 | + | echo "Formatted $ARCHUP_EFI_PART as FAT32" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 9 | 9 | ||
| 10 | 10 | # Handle root partition - with or without encryption | |
| 11 | 11 | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |
| @@ -40,8 +40,8 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |||
| 40 | 40 | # Format the encrypted container with btrfs | |
| 41 | 41 | mkfs.btrfs -f -L ROOT "$ARCHUP_CRYPT_ROOT" | |
| 42 | 42 | ||
| 43 | - | echo "Created LUKS container on $ARCHUP_ROOT_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 44 | - | echo "Formatted $ARCHUP_CRYPT_ROOT as btrfs" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 43 | + | echo "Created LUKS container on $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 44 | + | echo "Formatted $ARCHUP_CRYPT_ROOT as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 45 | 45 | ||
| 46 | 46 | # Mount temporarily to create subvolumes | |
| 47 | 47 | mount "$ARCHUP_CRYPT_ROOT" /mnt | |
| @@ -49,7 +49,7 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |||
| 49 | 49 | else | |
| 50 | 50 | # No encryption - format directly with btrfs | |
| 51 | 51 | mkfs.btrfs -f -L ROOT "$ARCHUP_ROOT_PART" | |
| 52 | - | echo "Formatted $ARCHUP_ROOT_PART as btrfs" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 52 | + | echo "Formatted $ARCHUP_ROOT_PART as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 53 | 53 | ||
| 54 | 54 | # Mount temporarily to create subvolumes | |
| 55 | 55 | mount "$ARCHUP_ROOT_PART" /mnt | |
| @@ -61,10 +61,11 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating btrfs subvolu | |||
| 61 | 61 | btrfs subvolume create /mnt/@ | |
| 62 | 62 | btrfs subvolume create /mnt/@home | |
| 63 | 63 | ||
| 64 | - | echo "Created btrfs subvolume: @" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 65 | - | echo "Created btrfs subvolume: @home" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 64 | + | echo "Created btrfs subvolume: @" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 65 | + | echo "Created btrfs subvolume: @home" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 66 | 66 | ||
| 67 | 67 | # Unmount temporary mount | |
| 68 | 68 | umount /mnt | |
| 69 | 69 | ||
| 70 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Partitions formatted and subvolumes created" | |
| 70 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Partitions formatted and subvolumes created" | |
| 71 | + | echo "Partitions formatted and subvolumes created successfully" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -4,8 +4,8 @@ | |||||
| 4 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Formatting partitions..." | 4 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Formatting partitions..." | ||
| 5 | 5 | ||||
| 6 | # Format EFI partition as FAT32 | 6 | # Format EFI partition as FAT32 | ||
| 7 | - | mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART" | 7 | + | mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART" 2>&1 |
| 8 | - | echo "Formatted $ARCHUP_EFI_PART as FAT32" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 8 | + | echo "Formatted $ARCHUP_EFI_PART as FAT32" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 9 | 9 | ||||
| 10 | # Handle root partition - with or without encryption | 10 | # Handle root partition - with or without encryption | ||
| 11 | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | 11 | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | ||
| @@ -40,8 +40,8 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |||||
| 40 | # Format the encrypted container with btrfs | 40 | # Format the encrypted container with btrfs | ||
| 41 | mkfs.btrfs -f -L ROOT "$ARCHUP_CRYPT_ROOT" | 41 | mkfs.btrfs -f -L ROOT "$ARCHUP_CRYPT_ROOT" | ||
| 42 | 42 | ||||
| 43 | - | echo "Created LUKS container on $ARCHUP_ROOT_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 43 | + | echo "Created LUKS container on $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 44 | - | echo "Formatted $ARCHUP_CRYPT_ROOT as btrfs" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 44 | + | echo "Formatted $ARCHUP_CRYPT_ROOT as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 45 | 45 | ||||
| 46 | # Mount temporarily to create subvolumes | 46 | # Mount temporarily to create subvolumes | ||
| 47 | mount "$ARCHUP_CRYPT_ROOT" /mnt | 47 | mount "$ARCHUP_CRYPT_ROOT" /mnt | ||
| @@ -49,7 +49,7 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |||||
| 49 | else | 49 | else | ||
| 50 | # No encryption - format directly with btrfs | 50 | # No encryption - format directly with btrfs | ||
| 51 | mkfs.btrfs -f -L ROOT "$ARCHUP_ROOT_PART" | 51 | mkfs.btrfs -f -L ROOT "$ARCHUP_ROOT_PART" | ||
| 52 | - | echo "Formatted $ARCHUP_ROOT_PART as btrfs" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 52 | + | echo "Formatted $ARCHUP_ROOT_PART as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 53 | 53 | ||||
| 54 | # Mount temporarily to create subvolumes | 54 | # Mount temporarily to create subvolumes | ||
| 55 | mount "$ARCHUP_ROOT_PART" /mnt | 55 | mount "$ARCHUP_ROOT_PART" /mnt | ||
| @@ -61,10 +61,11 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating btrfs subvolu | |||||
| 61 | btrfs subvolume create /mnt/@ | 61 | btrfs subvolume create /mnt/@ | ||
| 62 | btrfs subvolume create /mnt/@home | 62 | btrfs subvolume create /mnt/@home | ||
| 63 | 63 | ||||
| 64 | - | echo "Created btrfs subvolume: @" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 64 | + | echo "Created btrfs subvolume: @" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 65 | - | echo "Created btrfs subvolume: @home" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 65 | + | echo "Created btrfs subvolume: @home" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 66 | 66 | ||||
| 67 | # Unmount temporary mount | 67 | # Unmount temporary mount | ||
| 68 | umount /mnt | 68 | umount /mnt | ||
| 69 | 69 | ||||
| 70 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Partitions formatted and subvolumes created" | 70 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Partitions formatted and subvolumes created" |
| 71 | + | echo "Partitions formatted and subvolumes created successfully" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
M install/partitioning/mount.sh +5 -4
| @@ -13,7 +13,7 @@ fi | |||
| 13 | 13 | # Mount @ subvolume as root with optimal btrfs options | |
| 14 | 14 | mount -o noatime,compress=zstd,subvol=@ "$MOUNT_DEVICE" /mnt | |
| 15 | 15 | ||
| 16 | - | echo "Mounted @ subvolume to /mnt" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 16 | + | echo "Mounted @ subvolume to /mnt" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 17 | 17 | ||
| 18 | 18 | # Create home directory | |
| 19 | 19 | mkdir -p /mnt/home | |
| @@ -21,12 +21,13 @@ mkdir -p /mnt/home | |||
| 21 | 21 | # Mount @home subvolume | |
| 22 | 22 | mount -o noatime,compress=zstd,subvol=@home "$MOUNT_DEVICE" /mnt/home | |
| 23 | 23 | ||
| 24 | - | echo "Mounted @home subvolume to /mnt/home" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 24 | + | echo "Mounted @home subvolume to /mnt/home" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 25 | 25 | ||
| 26 | 26 | # Create and mount EFI directory | |
| 27 | 27 | mkdir -p /mnt/boot | |
| 28 | 28 | mount "$ARCHUP_EFI_PART" /mnt/boot | |
| 29 | 29 | ||
| 30 | - | echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 30 | + | echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 31 | 31 | ||
| 32 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Partitions mounted" | |
| 32 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Partitions mounted" | |
| 33 | + | echo "Partitions mounted successfully" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -13,7 +13,7 @@ fi | |||||
| 13 | # Mount @ subvolume as root with optimal btrfs options | 13 | # Mount @ subvolume as root with optimal btrfs options | ||
| 14 | mount -o noatime,compress=zstd,subvol=@ "$MOUNT_DEVICE" /mnt | 14 | mount -o noatime,compress=zstd,subvol=@ "$MOUNT_DEVICE" /mnt | ||
| 15 | 15 | ||||
| 16 | - | echo "Mounted @ subvolume to /mnt" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 16 | + | echo "Mounted @ subvolume to /mnt" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 17 | 17 | ||||
| 18 | # Create home directory | 18 | # Create home directory | ||
| 19 | mkdir -p /mnt/home | 19 | mkdir -p /mnt/home | ||
| @@ -21,12 +21,13 @@ mkdir -p /mnt/home | |||||
| 21 | # Mount @home subvolume | 21 | # Mount @home subvolume | ||
| 22 | mount -o noatime,compress=zstd,subvol=@home "$MOUNT_DEVICE" /mnt/home | 22 | mount -o noatime,compress=zstd,subvol=@home "$MOUNT_DEVICE" /mnt/home | ||
| 23 | 23 | ||||
| 24 | - | echo "Mounted @home subvolume to /mnt/home" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 24 | + | echo "Mounted @home subvolume to /mnt/home" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 25 | 25 | ||||
| 26 | # Create and mount EFI directory | 26 | # Create and mount EFI directory | ||
| 27 | mkdir -p /mnt/boot | 27 | mkdir -p /mnt/boot | ||
| 28 | mount "$ARCHUP_EFI_PART" /mnt/boot | 28 | mount "$ARCHUP_EFI_PART" /mnt/boot | ||
| 29 | 29 | ||||
| 30 | - | echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 30 | + | echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 31 | 31 | ||||
| 32 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Partitions mounted" | 32 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Partitions mounted" |
| 33 | + | echo "Partitions mounted successfully" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
M install/partitioning/partition.sh +3 -3
| @@ -28,9 +28,9 @@ else | |||
| 28 | 28 | export ARCHUP_ROOT_PART="${ARCHUP_DISK}2" | |
| 29 | 29 | fi | |
| 30 | 30 | ||
| 31 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Partitions created" | |
| 31 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Partitions created" | |
| 32 | 32 | gum style --padding "0 0 0 $PADDING_LEFT" " EFI: $ARCHUP_EFI_PART (512MB)" | |
| 33 | 33 | gum style --padding "0 0 1 $PADDING_LEFT" " Root: $ARCHUP_ROOT_PART" | |
| 34 | 34 | ||
| 35 | - | echo "EFI partition: $ARCHUP_EFI_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 36 | - | echo "Root partition: $ARCHUP_ROOT_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 35 | + | echo "EFI partition: $ARCHUP_EFI_PART" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 36 | + | echo "Root partition: $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -28,9 +28,9 @@ else | |||||
| 28 | export ARCHUP_ROOT_PART="${ARCHUP_DISK}2" | 28 | export ARCHUP_ROOT_PART="${ARCHUP_DISK}2" | ||
| 29 | fi | 29 | fi | ||
| 30 | 30 | ||||
| 31 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Partitions created" | 31 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Partitions created" |
| 32 | gum style --padding "0 0 0 $PADDING_LEFT" " EFI: $ARCHUP_EFI_PART (512MB)" | 32 | gum style --padding "0 0 0 $PADDING_LEFT" " EFI: $ARCHUP_EFI_PART (512MB)" | ||
| 33 | gum style --padding "0 0 1 $PADDING_LEFT" " Root: $ARCHUP_ROOT_PART" | 33 | gum style --padding "0 0 1 $PADDING_LEFT" " Root: $ARCHUP_ROOT_PART" | ||
| 34 | 34 | ||||
| 35 | - | echo "EFI partition: $ARCHUP_EFI_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 35 | + | echo "EFI partition: $ARCHUP_EFI_PART" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 36 | - | echo "Root partition: $ARCHUP_ROOT_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 36 | + | echo "Root partition: $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" |
M install/preflight/all.sh +4 -10
| @@ -1,12 +1,6 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # Preflight phase orchestrator | |
| 3 | - | # Sources all preflight scripts in order | |
| 2 | + | # Preflight phase | |
| 4 | 3 | ||
| 5 | - | # Run guards (system validation) | |
| 6 | - | source "$ARCHUP_INSTALL/preflight/guards.sh" | |
| 7 | - | ||
| 8 | - | # Detect environment (keyboard layout, WiFi) | |
| 9 | - | run_logged "$ARCHUP_INSTALL/preflight/detect-environment.sh" | |
| 10 | - | ||
| 11 | - | # Run begin (welcome and initial config) | |
| 12 | - | run_logged "$ARCHUP_INSTALL/preflight/begin.sh" | |
| 4 | + | source "$ARCHUP_INSTALL/preflight/guards.sh" # Interactive (gum confirm) | |
| 5 | + | run_logged "$ARCHUP_INSTALL/preflight/detect-environment.sh" # Non-interactive | |
| 6 | + | source "$ARCHUP_INSTALL/preflight/begin.sh" # Interactive (gum confirm) | |
| @@ -1,12 +1,6 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # Preflight phase orchestrator | 2 | + | # Preflight phase |
| 3 | - | # Sources all preflight scripts in order | |||
| 4 | 3 | ||||
| 5 | - | # Run guards (system validation) | 4 | + | source "$ARCHUP_INSTALL/preflight/guards.sh" # Interactive (gum confirm) |
| 6 | - | source "$ARCHUP_INSTALL/preflight/guards.sh" | 5 | + | run_logged "$ARCHUP_INSTALL/preflight/detect-environment.sh" # Non-interactive |
| 7 | - | 6 | + | source "$ARCHUP_INSTALL/preflight/begin.sh" # Interactive (gum confirm) | |
| 8 | - | # Detect environment (keyboard layout, WiFi) | |||
| 9 | - | run_logged "$ARCHUP_INSTALL/preflight/detect-environment.sh" | |||
| 10 | - | ||||
| 11 | - | # Run begin (welcome and initial config) | |||
| 12 | - | run_logged "$ARCHUP_INSTALL/preflight/begin.sh" | |||
M install/preflight/begin.sh +6 -4
| @@ -10,6 +10,7 @@ echo | |||
| 10 | 10 | # Confirm installation start | |
| 11 | 11 | if ! gum confirm "Ready to begin installation?" --padding "0 0 1 $PADDING_LEFT"; then | |
| 12 | 12 | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user" | |
| 13 | + | echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 13 | 14 | exit 0 | |
| 14 | 15 | fi | |
| 15 | 16 | ||
| @@ -18,7 +19,7 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Bootloader: Limine" | |||
| 18 | 19 | gum style --padding "0 0 1 $PADDING_LEFT" "archup uses Limine for superior btrfs and snapshot support" | |
| 19 | 20 | ||
| 20 | 21 | export ARCHUP_BOOTLOADER="limine" | |
| 21 | - | echo "Bootloader: limine" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 22 | + | echo "Bootloader: limine" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 22 | 23 | ||
| 23 | 24 | # Ask for encryption preference (Phase 2) | |
| 24 | 25 | echo | |
| @@ -28,10 +29,11 @@ echo | |||
| 28 | 29 | ||
| 29 | 30 | if gum confirm "Enable full-disk encryption?" --padding "0 0 1 $PADDING_LEFT"; then | |
| 30 | 31 | export ARCHUP_ENCRYPTION="enabled" | |
| 31 | - | echo "Encryption: enabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 32 | + | echo "Encryption: enabled" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 32 | 33 | else | |
| 33 | 34 | export ARCHUP_ENCRYPTION="disabled" | |
| 34 | - | echo "Encryption: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 35 | + | echo "Encryption: disabled" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 35 | 36 | fi | |
| 36 | 37 | ||
| 37 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Configuration saved" | |
| 38 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Configuration saved" | |
| 39 | + | echo "Configuration saved" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -10,6 +10,7 @@ echo | |||||
| 10 | # Confirm installation start | 10 | # Confirm installation start | ||
| 11 | if ! gum confirm "Ready to begin installation?" --padding "0 0 1 $PADDING_LEFT"; then | 11 | if ! gum confirm "Ready to begin installation?" --padding "0 0 1 $PADDING_LEFT"; then | ||
| 12 | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user" | 12 | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user" | ||
| 13 | + | echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 13 | exit 0 | 14 | exit 0 | ||
| 14 | fi | 15 | fi | ||
| 15 | 16 | ||||
| @@ -18,7 +19,7 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Bootloader: Limine" | |||||
| 18 | gum style --padding "0 0 1 $PADDING_LEFT" "archup uses Limine for superior btrfs and snapshot support" | 19 | gum style --padding "0 0 1 $PADDING_LEFT" "archup uses Limine for superior btrfs and snapshot support" | ||
| 19 | 20 | ||||
| 20 | export ARCHUP_BOOTLOADER="limine" | 21 | export ARCHUP_BOOTLOADER="limine" | ||
| 21 | - | echo "Bootloader: limine" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 22 | + | echo "Bootloader: limine" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 22 | 23 | ||||
| 23 | # Ask for encryption preference (Phase 2) | 24 | # Ask for encryption preference (Phase 2) | ||
| 24 | echo | 25 | echo | ||
| @@ -28,10 +29,11 @@ echo | |||||
| 28 | 29 | ||||
| 29 | if gum confirm "Enable full-disk encryption?" --padding "0 0 1 $PADDING_LEFT"; then | 30 | if gum confirm "Enable full-disk encryption?" --padding "0 0 1 $PADDING_LEFT"; then | ||
| 30 | export ARCHUP_ENCRYPTION="enabled" | 31 | export ARCHUP_ENCRYPTION="enabled" | ||
| 31 | - | echo "Encryption: enabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 32 | + | echo "Encryption: enabled" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 32 | else | 33 | else | ||
| 33 | export ARCHUP_ENCRYPTION="disabled" | 34 | export ARCHUP_ENCRYPTION="disabled" | ||
| 34 | - | echo "Encryption: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 35 | + | echo "Encryption: disabled" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 35 | fi | 36 | fi | ||
| 36 | 37 | ||||
| 37 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Configuration saved" | 38 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Configuration saved" |
| 39 | + | echo "Configuration saved" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
M install/preflight/detect-environment.sh +24 -16
| @@ -22,21 +22,29 @@ if [ -z "$DETECTED_KEYMAP" ]; then | |||
| 22 | 22 | fi | |
| 23 | 23 | ||
| 24 | 24 | export ARCHUP_KEYMAP="$DETECTED_KEYMAP" | |
| 25 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Keyboard layout: $ARCHUP_KEYMAP" | |
| 26 | - | echo "Keyboard layout detected: $ARCHUP_KEYMAP" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 25 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Keyboard layout: $ARCHUP_KEYMAP" | |
| 26 | + | echo "Keyboard layout detected: $ARCHUP_KEYMAP" | |
| 27 | 27 | ||
| 28 | - | # Detect WiFi connection from iwd | |
| 29 | - | # Check if iwd is running and if we're connected to a network | |
| 28 | + | # Check for network connectivity | |
| 29 | + | # First check if we have an active ethernet connection | |
| 30 | + | HAS_ETHERNET=false | |
| 31 | + | if ip link show | grep -E "^[0-9]+: (eth|enp|eno)" | grep -q "state UP"; then | |
| 32 | + | HAS_ETHERNET=true | |
| 33 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Ethernet connection detected" | |
| 34 | + | echo "Network: Ethernet connected" | |
| 35 | + | fi | |
| 36 | + | ||
| 37 | + | # Only check for WiFi if no ethernet connection is available | |
| 30 | 38 | WIFI_SSID="" | |
| 31 | 39 | WIFI_PASSPHRASE="" | |
| 32 | 40 | ||
| 33 | - | if command -v iwctl >/dev/null 2>&1; then | |
| 41 | + | if [ "$HAS_ETHERNET" = false ] && command -v iwctl >/dev/null 2>&1; then | |
| 34 | 42 | # Get the first wireless device | |
| 35 | - | WIFI_DEVICE=$(iwctl device list | grep -oP 'wlan\d+' | head -1) | |
| 43 | + | WIFI_DEVICE=$(iwctl device list | grep -oP 'wlan\d+' | head -1) || true | |
| 36 | 44 | ||
| 37 | 45 | if [ -n "$WIFI_DEVICE" ]; then | |
| 38 | 46 | # Check if connected to a network | |
| 39 | - | WIFI_SSID=$(iwctl station "$WIFI_DEVICE" show | grep "Connected network" | awk '{print $3}') | |
| 47 | + | WIFI_SSID=$(iwctl station "$WIFI_DEVICE" show | grep "Connected network" | awk '{print $3}') || true | |
| 40 | 48 | ||
| 41 | 49 | if [ -n "$WIFI_SSID" ]; then | |
| 42 | 50 | # iwd stores credentials in /var/lib/iwd/ | |
| @@ -52,19 +60,19 @@ if command -v iwctl >/dev/null 2>&1; then | |||
| 52 | 60 | export ARCHUP_WIFI_DEVICE="$WIFI_DEVICE" | |
| 53 | 61 | export ARCHUP_WIFI_PASSPHRASE="$WIFI_PASSPHRASE" | |
| 54 | 62 | ||
| 55 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ WiFi network: $WIFI_SSID (device: $WIFI_DEVICE)" | |
| 56 | - | echo "WiFi detected: SSID=$WIFI_SSID, device=$WIFI_DEVICE" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 63 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] WiFi network: $WIFI_SSID (device: $WIFI_DEVICE)" | |
| 64 | + | echo "WiFi detected: SSID=$WIFI_SSID, device=$WIFI_DEVICE" | |
| 57 | 65 | else | |
| 58 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⊘ No active WiFi connection detected" | |
| 59 | - | echo "WiFi: not connected" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 66 | + | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No active WiFi connection detected" | |
| 67 | + | echo "WiFi: not connected" | |
| 60 | 68 | fi | |
| 61 | 69 | else | |
| 62 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⊘ No WiFi device found" | |
| 63 | - | echo "WiFi: no device" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 70 | + | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No WiFi device found" | |
| 71 | + | echo "WiFi: no device" | |
| 64 | 72 | fi | |
| 65 | - | else | |
| 66 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⊘ iwd not available" | |
| 67 | - | echo "WiFi: iwd not available" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 73 | + | elif [ "$HAS_ETHERNET" = false ]; then | |
| 74 | + | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] iwd not available" | |
| 75 | + | echo "WiFi: iwd not available" | |
| 68 | 76 | fi | |
| 69 | 77 | ||
| 70 | 78 | echo | |
| @@ -22,21 +22,29 @@ if [ -z "$DETECTED_KEYMAP" ]; then | |||||
| 22 | fi | 22 | fi | ||
| 23 | 23 | ||||
| 24 | export ARCHUP_KEYMAP="$DETECTED_KEYMAP" | 24 | export ARCHUP_KEYMAP="$DETECTED_KEYMAP" | ||
| 25 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Keyboard layout: $ARCHUP_KEYMAP" | 25 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Keyboard layout: $ARCHUP_KEYMAP" |
| 26 | - | echo "Keyboard layout detected: $ARCHUP_KEYMAP" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 26 | + | echo "Keyboard layout detected: $ARCHUP_KEYMAP" |
| 27 | 27 | ||||
| 28 | - | # Detect WiFi connection from iwd | 28 | + | # Check for network connectivity |
| 29 | - | # Check if iwd is running and if we're connected to a network | 29 | + | # First check if we have an active ethernet connection |
| 30 | + | HAS_ETHERNET=false | |||
| 31 | + | if ip link show | grep -E "^[0-9]+: (eth|enp|eno)" | grep -q "state UP"; then | |||
| 32 | + | HAS_ETHERNET=true | |||
| 33 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Ethernet connection detected" | |||
| 34 | + | echo "Network: Ethernet connected" | |||
| 35 | + | fi | |||
| 36 | + | ||||
| 37 | + | # Only check for WiFi if no ethernet connection is available | |||
| 30 | WIFI_SSID="" | 38 | WIFI_SSID="" | ||
| 31 | WIFI_PASSPHRASE="" | 39 | WIFI_PASSPHRASE="" | ||
| 32 | 40 | ||||
| 33 | - | if command -v iwctl >/dev/null 2>&1; then | 41 | + | if [ "$HAS_ETHERNET" = false ] && command -v iwctl >/dev/null 2>&1; then |
| 34 | # Get the first wireless device | 42 | # Get the first wireless device | ||
| 35 | - | WIFI_DEVICE=$(iwctl device list | grep -oP 'wlan\d+' | head -1) | 43 | + | WIFI_DEVICE=$(iwctl device list | grep -oP 'wlan\d+' | head -1) || true |
| 36 | 44 | ||||
| 37 | if [ -n "$WIFI_DEVICE" ]; then | 45 | if [ -n "$WIFI_DEVICE" ]; then | ||
| 38 | # Check if connected to a network | 46 | # Check if connected to a network | ||
| 39 | - | WIFI_SSID=$(iwctl station "$WIFI_DEVICE" show | grep "Connected network" | awk '{print $3}') | 47 | + | WIFI_SSID=$(iwctl station "$WIFI_DEVICE" show | grep "Connected network" | awk '{print $3}') || true |
| 40 | 48 | ||||
| 41 | if [ -n "$WIFI_SSID" ]; then | 49 | if [ -n "$WIFI_SSID" ]; then | ||
| 42 | # iwd stores credentials in /var/lib/iwd/ | 50 | # iwd stores credentials in /var/lib/iwd/ | ||
| @@ -52,19 +60,19 @@ if command -v iwctl >/dev/null 2>&1; then | |||||
| 52 | export ARCHUP_WIFI_DEVICE="$WIFI_DEVICE" | 60 | export ARCHUP_WIFI_DEVICE="$WIFI_DEVICE" | ||
| 53 | export ARCHUP_WIFI_PASSPHRASE="$WIFI_PASSPHRASE" | 61 | export ARCHUP_WIFI_PASSPHRASE="$WIFI_PASSPHRASE" | ||
| 54 | 62 | ||||
| 55 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ WiFi network: $WIFI_SSID (device: $WIFI_DEVICE)" | 63 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] WiFi network: $WIFI_SSID (device: $WIFI_DEVICE)" |
| 56 | - | echo "WiFi detected: SSID=$WIFI_SSID, device=$WIFI_DEVICE" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 64 | + | echo "WiFi detected: SSID=$WIFI_SSID, device=$WIFI_DEVICE" |
| 57 | else | 65 | else | ||
| 58 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⊘ No active WiFi connection detected" | 66 | + | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No active WiFi connection detected" |
| 59 | - | echo "WiFi: not connected" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 67 | + | echo "WiFi: not connected" |
| 60 | fi | 68 | fi | ||
| 61 | else | 69 | else | ||
| 62 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⊘ No WiFi device found" | 70 | + | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No WiFi device found" |
| 63 | - | echo "WiFi: no device" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 71 | + | echo "WiFi: no device" |
| 64 | fi | 72 | fi | ||
| 65 | - | else | 73 | + | elif [ "$HAS_ETHERNET" = false ]; then |
| 66 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⊘ iwd not available" | 74 | + | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] iwd not available" |
| 67 | - | echo "WiFi: iwd not available" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 75 | + | echo "WiFi: iwd not available" |
| 68 | fi | 76 | fi | ||
| 69 | 77 | ||||
| 70 | echo | 78 | echo | ||
M install/preflight/guards.sh +3 -2
| @@ -3,8 +3,9 @@ | |||
| 3 | 3 | # Validates system requirements before installation | |
| 4 | 4 | ||
| 5 | 5 | abort() { | |
| 6 | - | gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "❌ archup install requires: $1" | |
| 6 | + | gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "archup install requires: $1" | |
| 7 | 7 | echo | |
| 8 | + | echo "Preflight check failed: $1" | |
| 8 | 9 | gum confirm "Proceed anyway on your own accord and without assistance?" --padding "0 0 0 $PADDING_LEFT" || exit 1 | |
| 9 | 10 | } | |
| 10 | 11 | ||
| @@ -38,4 +39,4 @@ if bootctl status 2>/dev/null | grep -q 'Secure Boot: enabled'; then | |||
| 38 | 39 | fi | |
| 39 | 40 | ||
| 40 | 41 | # Cleared all guards | |
| 41 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ All preflight checks passed" | |
| 42 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "All preflight checks passed" | |
| @@ -3,8 +3,9 @@ | |||||
| 3 | # Validates system requirements before installation | 3 | # Validates system requirements before installation | ||
| 4 | 4 | ||||
| 5 | abort() { | 5 | abort() { | ||
| 6 | - | gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "❌ archup install requires: $1" | 6 | + | gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "archup install requires: $1" |
| 7 | echo | 7 | echo | ||
| 8 | + | echo "Preflight check failed: $1" | |||
| 8 | gum confirm "Proceed anyway on your own accord and without assistance?" --padding "0 0 0 $PADDING_LEFT" || exit 1 | 9 | gum confirm "Proceed anyway on your own accord and without assistance?" --padding "0 0 0 $PADDING_LEFT" || exit 1 | ||
| 9 | } | 10 | } | ||
| 10 | 11 | ||||
| @@ -38,4 +39,4 @@ if bootctl status 2>/dev/null | grep -q 'Secure Boot: enabled'; then | |||||
| 38 | fi | 39 | fi | ||
| 39 | 40 | ||||
| 40 | # Cleared all guards | 41 | # Cleared all guards | ||
| 41 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ All preflight checks passed" | 42 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "All preflight checks passed" |
M install/repos/all.sh +3 -3
| @@ -1,5 +1,5 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # Repository setup phase orchestrator | |
| 2 | + | # Repository setup phase | |
| 3 | 3 | ||
| 4 | - | run_logged "$ARCHUP_INSTALL/repos/yay.sh" | |
| 5 | - | run_logged "$ARCHUP_INSTALL/repos/chaotic.sh" | |
| 4 | + | source "$ARCHUP_INSTALL/repos/yay.sh" # Interactive (gum confirm) | |
| 5 | + | source "$ARCHUP_INSTALL/repos/chaotic.sh" # Interactive (gum confirm) | |
| @@ -1,5 +1,5 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # Repository setup phase orchestrator | 2 | + | # Repository setup phase |
| 3 | 3 | ||||
| 4 | - | run_logged "$ARCHUP_INSTALL/repos/yay.sh" | 4 | + | source "$ARCHUP_INSTALL/repos/yay.sh" # Interactive (gum confirm) |
| 5 | - | run_logged "$ARCHUP_INSTALL/repos/chaotic.sh" | 5 | + | source "$ARCHUP_INSTALL/repos/chaotic.sh" # Interactive (gum confirm) |
M install/repos/chaotic.sh +7 -7
| @@ -6,8 +6,8 @@ echo | |||
| 6 | 6 | ||
| 7 | 7 | # Ask if user wants Chaotic-AUR | |
| 8 | 8 | if ! gum confirm "Enable Chaotic-AUR repository?" --padding "0 0 1 $PADDING_LEFT"; then | |
| 9 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⊘ Skipping Chaotic-AUR" | |
| 10 | - | echo "Chaotic-AUR: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 9 | + | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping Chaotic-AUR" | |
| 10 | + | echo "Chaotic-AUR: disabled" | |
| 11 | 11 | export ARCHUP_CHAOTIC="disabled" | |
| 12 | 12 | return 0 | |
| 13 | 13 | fi | |
| @@ -35,7 +35,7 @@ if ! grep -q "\[chaotic-aur\]" /mnt/etc/pacman.conf; then | |||
| 35 | 35 | Include = /etc/pacman.d/chaotic-mirrorlist | |
| 36 | 36 | EOF | |
| 37 | 37 | ||
| 38 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Added Chaotic-AUR to pacman.conf" | |
| 38 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Added Chaotic-AUR to pacman.conf" | |
| 39 | 39 | fi | |
| 40 | 40 | ||
| 41 | 41 | # Update package databases | |
| @@ -43,11 +43,11 @@ arch-chroot /mnt pacman -Sy | |||
| 43 | 43 | ||
| 44 | 44 | # Verify Chaotic-AUR is working | |
| 45 | 45 | if arch-chroot /mnt pacman -Sl chaotic-aur >/dev/null 2>&1; then | |
| 46 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Chaotic-AUR enabled successfully" | |
| 47 | - | echo "Chaotic-AUR: enabled (repo added to pacman.conf)" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 46 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Chaotic-AUR enabled successfully" | |
| 47 | + | echo "Chaotic-AUR: enabled (repo added to pacman.conf)" | |
| 48 | 48 | else | |
| 49 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ Chaotic-AUR verification failed" | |
| 50 | - | echo "WARNING: Chaotic-AUR verification failed" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 49 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Chaotic-AUR verification failed" | |
| 50 | + | echo "WARNING: Chaotic-AUR verification failed" | |
| 51 | 51 | export ARCHUP_CHAOTIC="failed" | |
| 52 | 52 | return 1 | |
| 53 | 53 | fi | |
| @@ -6,8 +6,8 @@ echo | |||||
| 6 | 6 | ||||
| 7 | # Ask if user wants Chaotic-AUR | 7 | # Ask if user wants Chaotic-AUR | ||
| 8 | if ! gum confirm "Enable Chaotic-AUR repository?" --padding "0 0 1 $PADDING_LEFT"; then | 8 | if ! gum confirm "Enable Chaotic-AUR repository?" --padding "0 0 1 $PADDING_LEFT"; then | ||
| 9 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⊘ Skipping Chaotic-AUR" | 9 | + | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping Chaotic-AUR" |
| 10 | - | echo "Chaotic-AUR: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 10 | + | echo "Chaotic-AUR: disabled" |
| 11 | export ARCHUP_CHAOTIC="disabled" | 11 | export ARCHUP_CHAOTIC="disabled" | ||
| 12 | return 0 | 12 | return 0 | ||
| 13 | fi | 13 | fi | ||
| @@ -35,7 +35,7 @@ if ! grep -q "\[chaotic-aur\]" /mnt/etc/pacman.conf; then | |||||
| 35 | Include = /etc/pacman.d/chaotic-mirrorlist | 35 | Include = /etc/pacman.d/chaotic-mirrorlist | ||
| 36 | EOF | 36 | EOF | ||
| 37 | 37 | ||||
| 38 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Added Chaotic-AUR to pacman.conf" | 38 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Added Chaotic-AUR to pacman.conf" |
| 39 | fi | 39 | fi | ||
| 40 | 40 | ||||
| 41 | # Update package databases | 41 | # Update package databases | ||
| @@ -43,11 +43,11 @@ arch-chroot /mnt pacman -Sy | |||||
| 43 | 43 | ||||
| 44 | # Verify Chaotic-AUR is working | 44 | # Verify Chaotic-AUR is working | ||
| 45 | if arch-chroot /mnt pacman -Sl chaotic-aur >/dev/null 2>&1; then | 45 | if arch-chroot /mnt pacman -Sl chaotic-aur >/dev/null 2>&1; then | ||
| 46 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Chaotic-AUR enabled successfully" | 46 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Chaotic-AUR enabled successfully" |
| 47 | - | echo "Chaotic-AUR: enabled (repo added to pacman.conf)" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 47 | + | echo "Chaotic-AUR: enabled (repo added to pacman.conf)" |
| 48 | else | 48 | else | ||
| 49 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ Chaotic-AUR verification failed" | 49 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Chaotic-AUR verification failed" |
| 50 | - | echo "WARNING: Chaotic-AUR verification failed" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 50 | + | echo "WARNING: Chaotic-AUR verification failed" |
| 51 | export ARCHUP_CHAOTIC="failed" | 51 | export ARCHUP_CHAOTIC="failed" | ||
| 52 | return 1 | 52 | return 1 | ||
| 53 | fi | 53 | fi | ||
M install/repos/yay.sh +8 -8
| @@ -6,8 +6,8 @@ echo | |||
| 6 | 6 | ||
| 7 | 7 | # Ask if user wants AUR support | |
| 8 | 8 | if ! gum confirm "Enable AUR support (install yay)?" --padding "0 0 1 $PADDING_LEFT"; then | |
| 9 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⊘ Skipping AUR support" | |
| 10 | - | echo "AUR: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 9 | + | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping AUR support" | |
| 10 | + | echo "AUR: disabled" | |
| 11 | 11 | export ARCHUP_AUR="disabled" | |
| 12 | 12 | return 0 | |
| 13 | 13 | fi | |
| @@ -24,8 +24,8 @@ arch-chroot /mnt pacman -S --noconfirm --needed base-devel git | |||
| 24 | 24 | USERNAME=$(arch-chroot /mnt ls /home | head -1) | |
| 25 | 25 | ||
| 26 | 26 | if [ -z "$USERNAME" ]; then | |
| 27 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ Error: Could not find user for yay installation" | |
| 28 | - | echo "ERROR: No user found for yay installation" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 27 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Error: Could not find user for yay installation" | |
| 28 | + | echo "ERROR: No user found for yay installation" | |
| 29 | 29 | export ARCHUP_AUR="failed" | |
| 30 | 30 | return 1 | |
| 31 | 31 | fi | |
| @@ -41,11 +41,11 @@ arch-chroot /mnt rm -rf /tmp/yay-bin | |||
| 41 | 41 | ||
| 42 | 42 | # Verify installation | |
| 43 | 43 | if arch-chroot /mnt su - "$USERNAME" -c "yay --version" >/dev/null 2>&1; then | |
| 44 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ yay installed successfully" | |
| 45 | - | echo "AUR: enabled (yay installed for user: $USERNAME)" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 44 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] yay installed successfully" | |
| 45 | + | echo "AUR: enabled (yay installed for user: $USERNAME)" | |
| 46 | 46 | else | |
| 47 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ yay installation failed" | |
| 48 | - | echo "ERROR: yay installation failed" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 47 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay installation failed" | |
| 48 | + | echo "ERROR: yay installation failed" | |
| 49 | 49 | export ARCHUP_AUR="failed" | |
| 50 | 50 | return 1 | |
| 51 | 51 | fi | |
| @@ -6,8 +6,8 @@ echo | |||||
| 6 | 6 | ||||
| 7 | # Ask if user wants AUR support | 7 | # Ask if user wants AUR support | ||
| 8 | if ! gum confirm "Enable AUR support (install yay)?" --padding "0 0 1 $PADDING_LEFT"; then | 8 | if ! gum confirm "Enable AUR support (install yay)?" --padding "0 0 1 $PADDING_LEFT"; then | ||
| 9 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⊘ Skipping AUR support" | 9 | + | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping AUR support" |
| 10 | - | echo "AUR: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 10 | + | echo "AUR: disabled" |
| 11 | export ARCHUP_AUR="disabled" | 11 | export ARCHUP_AUR="disabled" | ||
| 12 | return 0 | 12 | return 0 | ||
| 13 | fi | 13 | fi | ||
| @@ -24,8 +24,8 @@ arch-chroot /mnt pacman -S --noconfirm --needed base-devel git | |||||
| 24 | USERNAME=$(arch-chroot /mnt ls /home | head -1) | 24 | USERNAME=$(arch-chroot /mnt ls /home | head -1) | ||
| 25 | 25 | ||||
| 26 | if [ -z "$USERNAME" ]; then | 26 | if [ -z "$USERNAME" ]; then | ||
| 27 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ Error: Could not find user for yay installation" | 27 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Error: Could not find user for yay installation" |
| 28 | - | echo "ERROR: No user found for yay installation" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 28 | + | echo "ERROR: No user found for yay installation" |
| 29 | export ARCHUP_AUR="failed" | 29 | export ARCHUP_AUR="failed" | ||
| 30 | return 1 | 30 | return 1 | ||
| 31 | fi | 31 | fi | ||
| @@ -41,11 +41,11 @@ arch-chroot /mnt rm -rf /tmp/yay-bin | |||||
| 41 | 41 | ||||
| 42 | # Verify installation | 42 | # Verify installation | ||
| 43 | if arch-chroot /mnt su - "$USERNAME" -c "yay --version" >/dev/null 2>&1; then | 43 | if arch-chroot /mnt su - "$USERNAME" -c "yay --version" >/dev/null 2>&1; then | ||
| 44 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ yay installed successfully" | 44 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] yay installed successfully" |
| 45 | - | echo "AUR: enabled (yay installed for user: $USERNAME)" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 45 | + | echo "AUR: enabled (yay installed for user: $USERNAME)" |
| 46 | else | 46 | else | ||
| 47 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ yay installation failed" | 47 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay installation failed" |
| 48 | - | echo "ERROR: yay installation failed" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 48 | + | echo "ERROR: yay installation failed" |
| 49 | export ARCHUP_AUR="failed" | 49 | export ARCHUP_AUR="failed" | ||
| 50 | return 1 | 50 | return 1 | ||
| 51 | fi | 51 | fi | ||