chore(cleanup): remove deprecated bash scripts superseded by Go handlers
- commit
- e868eabdaaaecd2c9e1768b6f61ed449638514fb
- author
- brice · · 2026-02-27 05:24 UTC
- parent
- 1535d73
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
49 files · +0 -2958
D install/deprecated/base/all.sh +0 -12
| @@ -1,12 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Base installation phase | |
| 3 | - | ||
| 4 | - | stop_log_output # Stop for interactive prompt | |
| 5 | - | source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose) | |
| 6 | - | start_log_output # Resume after prompt | |
| 7 | - | ||
| 8 | - | run_logged "$ARCHUP_INSTALL/base/enable-multilib.sh" # Enable multilib before pacstrap | |
| 9 | - | run_logged "$ARCHUP_INSTALL/base/cachyos-repo.sh" # Configure CachyOS repo if needed | |
| 10 | - | run_logged "$ARCHUP_INSTALL/base/pacman.sh" # Configure ISO pacman for fast downloads | |
| 11 | - | run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive (essential packages only) | |
| 12 | - | run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive | |
| @@ -1,12 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Base installation phase | |||
| 3 | - | ||||
| 4 | - | stop_log_output # Stop for interactive prompt | |||
| 5 | - | source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose) | |||
| 6 | - | start_log_output # Resume after prompt | |||
| 7 | - | ||||
| 8 | - | run_logged "$ARCHUP_INSTALL/base/enable-multilib.sh" # Enable multilib before pacstrap | |||
| 9 | - | run_logged "$ARCHUP_INSTALL/base/cachyos-repo.sh" # Configure CachyOS repo if needed | |||
| 10 | - | run_logged "$ARCHUP_INSTALL/base/pacman.sh" # Configure ISO pacman for fast downloads | |||
| 11 | - | run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive (essential packages only) | |||
| 12 | - | run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive | |||
D install/deprecated/base/amd-cpu.sh +0 -256
| @@ -1,256 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # AMD CPU detection and P-State configuration | |
| 3 | - | # Detects Zen generation and recommends appropriate AMD P-State modes | |
| 4 | - | ||
| 5 | - | # This script should only be called for AMD CPUs | |
| 6 | - | # Requires: gum, /proc/cpuinfo | |
| 7 | - | ||
| 8 | - | detect_zen_generation() { | |
| 9 | - | local cpu_family | |
| 10 | - | local cpu_model | |
| 11 | - | ||
| 12 | - | # Get CPU family and model from /proc/cpuinfo | |
| 13 | - | cpu_family=$(grep -m1 'cpu family' /proc/cpuinfo | awk '{print $4}') | |
| 14 | - | cpu_model=$(grep -m1 'model' /proc/cpuinfo | awk '{print $3}') | |
| 15 | - | ||
| 16 | - | # Convert to hex for easier comparison (though we'll use decimal) | |
| 17 | - | local family_dec=$((cpu_family)) | |
| 18 | - | local model_dec=$((cpu_model)) | |
| 19 | - | ||
| 20 | - | # Detect Zen generation based on CPU family and model | |
| 21 | - | # Reference: https://en.wikichip.org/wiki/amd/cpuid | |
| 22 | - | ||
| 23 | - | local zen_gen="" | |
| 24 | - | local zen_label="" | |
| 25 | - | ||
| 26 | - | case $family_dec in | |
| 27 | - | 23) # Family 17h | |
| 28 | - | if [ $model_dec -ge 0 ] && [ $model_dec -le 15 ]; then | |
| 29 | - | zen_gen="1" | |
| 30 | - | zen_label="Zen 1" | |
| 31 | - | elif [ $model_dec -ge 16 ] && [ $model_dec -le 31 ]; then | |
| 32 | - | zen_gen="1+" | |
| 33 | - | zen_label="Zen+" | |
| 34 | - | elif [ $model_dec -ge 48 ] && [ $model_dec -le 127 ]; then | |
| 35 | - | zen_gen="2" | |
| 36 | - | zen_label="Zen 2" | |
| 37 | - | else | |
| 38 | - | zen_gen="2" | |
| 39 | - | zen_label="Zen 2 (assumed)" | |
| 40 | - | fi | |
| 41 | - | ;; | |
| 42 | - | 25) # Family 19h | |
| 43 | - | if [ $model_dec -ge 0 ] && [ $model_dec -le 15 ]; then | |
| 44 | - | zen_gen="3" | |
| 45 | - | zen_label="Zen 3" | |
| 46 | - | elif [ $model_dec -ge 32 ] && [ $model_dec -le 47 ]; then | |
| 47 | - | zen_gen="3" | |
| 48 | - | zen_label="Zen 3" | |
| 49 | - | elif [ $model_dec -ge 80 ] && [ $model_dec -le 95 ]; then | |
| 50 | - | zen_gen="3+" | |
| 51 | - | zen_label="Zen 3+" | |
| 52 | - | elif [ $model_dec -ge 96 ] && [ $model_dec -le 175 ]; then | |
| 53 | - | zen_gen="4" | |
| 54 | - | zen_label="Zen 4" | |
| 55 | - | else | |
| 56 | - | zen_gen="3" | |
| 57 | - | zen_label="Zen 3 (assumed)" | |
| 58 | - | fi | |
| 59 | - | ;; | |
| 60 | - | 26) # Family 1Ah | |
| 61 | - | zen_gen="5" | |
| 62 | - | zen_label="Zen 5" | |
| 63 | - | ;; | |
| 64 | - | *) | |
| 65 | - | zen_gen="unknown" | |
| 66 | - | zen_label="Unknown" | |
| 67 | - | ;; | |
| 68 | - | esac | |
| 69 | - | ||
| 70 | - | echo "${zen_gen}|${zen_label}" | |
| 71 | - | } | |
| 72 | - | ||
| 73 | - | get_recommended_pstate_modes() { | |
| 74 | - | local zen_gen=$1 | |
| 75 | - | local kernel_version | |
| 76 | - | ||
| 77 | - | # Get kernel version | |
| 78 | - | kernel_version=$(uname -r | cut -d'.' -f1,2) | |
| 79 | - | local major=$(echo "$kernel_version" | cut -d'.' -f1) | |
| 80 | - | local minor=$(echo "$kernel_version" | cut -d'.' -f2) | |
| 81 | - | ||
| 82 | - | # Calculate kernel version as single number for comparison | |
| 83 | - | local kernel_num=$((major * 100 + minor)) | |
| 84 | - | ||
| 85 | - | # Determine available modes based on Zen generation and kernel version | |
| 86 | - | # Reference: https://docs.kernel.org/admin-guide/pm/amd-pstate.html | |
| 87 | - | # Active: CPPC autonomous (amd_pstate_epp) - kernel 6.3+ | |
| 88 | - | # Passive: CPPC non-autonomous (amd_pstate) - all kernels | |
| 89 | - | # Guided: CPPC guided autonomous (amd_pstate) - kernel 6.4+ | |
| 90 | - | ||
| 91 | - | case $zen_gen in | |
| 92 | - | "1"|"1+") | |
| 93 | - | # Zen 1 and Zen+: No CPPC support, use acpi-cpufreq | |
| 94 | - | echo "none" | |
| 95 | - | ;; | |
| 96 | - | "2") | |
| 97 | - | # Zen 2: Basic CPPC support, may need shared_mem=1 parameter | |
| 98 | - | # Passive: available, Active: 6.3+ | |
| 99 | - | if [ $kernel_num -ge 603 ]; then | |
| 100 | - | echo "passive|active" | |
| 101 | - | else | |
| 102 | - | echo "passive" | |
| 103 | - | fi | |
| 104 | - | ;; | |
| 105 | - | "3"|"3+"|"4"|"5") | |
| 106 | - | # Zen 3+: Full CPPC support for all modes | |
| 107 | - | # Passive: available, Active: 6.3+, Guided: 6.4+ | |
| 108 | - | local modes="passive" | |
| 109 | - | if [ $kernel_num -ge 603 ]; then | |
| 110 | - | modes="${modes}|active" | |
| 111 | - | fi | |
| 112 | - | if [ $kernel_num -ge 604 ]; then | |
| 113 | - | modes="${modes}|guided" | |
| 114 | - | fi | |
| 115 | - | echo "$modes" | |
| 116 | - | ;; | |
| 117 | - | *) | |
| 118 | - | echo "passive" | |
| 119 | - | ;; | |
| 120 | - | esac | |
| 121 | - | } | |
| 122 | - | ||
| 123 | - | get_pstate_recommendation() { | |
| 124 | - | local zen_gen=$1 | |
| 125 | - | ||
| 126 | - | # Return the best recommended mode for each Zen generation | |
| 127 | - | case $zen_gen in | |
| 128 | - | "1"|"1+") | |
| 129 | - | echo "none" # Use default acpi-cpufreq | |
| 130 | - | ;; | |
| 131 | - | "2") | |
| 132 | - | echo "passive" # Conservative choice for Zen 2 | |
| 133 | - | ;; | |
| 134 | - | "3"|"3+") | |
| 135 | - | echo "active" # Best for Zen 3/3+ | |
| 136 | - | ;; | |
| 137 | - | "4"|"5") | |
| 138 | - | echo "active" # Best for Zen 4/5 | |
| 139 | - | ;; | |
| 140 | - | *) | |
| 141 | - | echo "passive" | |
| 142 | - | ;; | |
| 143 | - | esac | |
| 144 | - | } | |
| 145 | - | ||
| 146 | - | get_additional_params() { | |
| 147 | - | local zen_gen=$1 | |
| 148 | - | local mode=$2 | |
| 149 | - | ||
| 150 | - | # Some Zen 2 CPUs need shared_mem parameter | |
| 151 | - | if [ "$zen_gen" = "2" ] && [ "$mode" = "active" ]; then | |
| 152 | - | echo "amd_pstate.shared_mem=1" | |
| 153 | - | else | |
| 154 | - | echo "" | |
| 155 | - | fi | |
| 156 | - | } | |
| 157 | - | ||
| 158 | - | # Main execution | |
| 159 | - | main() { | |
| 160 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "AMD CPU Detection" | |
| 161 | - | ||
| 162 | - | # Detect Zen generation | |
| 163 | - | local zen_info | |
| 164 | - | zen_info=$(detect_zen_generation) | |
| 165 | - | local zen_gen=$(echo "$zen_info" | cut -d'|' -f1) | |
| 166 | - | local zen_label=$(echo "$zen_info" | cut -d'|' -f2) | |
| 167 | - | ||
| 168 | - | # Get CPU model name for display | |
| 169 | - | local cpu_model_name | |
| 170 | - | cpu_model_name=$(grep -m1 'model name' /proc/cpuinfo | cut -d':' -f2 | sed 's/^[ \t]*//') | |
| 171 | - | ||
| 172 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Detected: $zen_label" | |
| 173 | - | gum style --padding "0 0 0 $PADDING_LEFT" " CPU: $cpu_model_name" | |
| 174 | - | ||
| 175 | - | # Check if Zen generation supports AMD pstate | |
| 176 | - | if [ "$zen_gen" = "1" ] || [ "$zen_gen" = "1+" ]; then | |
| 177 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[WARN] $zen_label does not support AMD P-State driver" | |
| 178 | - | gum style --padding "0 0 1 $PADDING_LEFT" " Using default acpi-cpufreq driver" | |
| 179 | - | export ARCHUP_AMD_PSTATE="" | |
| 180 | - | export ARCHUP_AMD_KERNEL_PARAMS="" | |
| 181 | - | echo "AMD CPU: $zen_label (no P-State support)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 182 | - | return 0 | |
| 183 | - | fi | |
| 184 | - | ||
| 185 | - | # Get available modes for this Zen generation | |
| 186 | - | local available_modes | |
| 187 | - | available_modes=$(get_recommended_pstate_modes "$zen_gen") | |
| 188 | - | ||
| 189 | - | echo | |
| 190 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "AMD P-State Configuration" | |
| 191 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Select AMD P-State driver mode for CPU frequency scaling" | |
| 192 | - | gum style --foreground 8 --padding "0 0 0 $PADDING_LEFT" "Note: Requires CPPC enabled in UEFI (AMD CBS > NBIO > SMU > CPPC)" | |
| 193 | - | echo | |
| 194 | - | ||
| 195 | - | # Build choice menu based on available modes | |
| 196 | - | declare -a MODE_CHOICES | |
| 197 | - | ||
| 198 | - | if echo "$available_modes" | grep -q "active"; then | |
| 199 | - | MODE_CHOICES+=("active - CPPC autonomous with EPP hints (best performance, desktop/gaming)") | |
| 200 | - | fi | |
| 201 | - | ||
| 202 | - | if echo "$available_modes" | grep -q "guided"; then | |
| 203 | - | MODE_CHOICES+=("guided - CPPC guided autonomous (balanced, laptop/hybrid)") | |
| 204 | - | fi | |
| 205 | - | ||
| 206 | - | if echo "$available_modes" | grep -q "passive"; then | |
| 207 | - | MODE_CHOICES+=("passive - CPPC non-autonomous (compatibility, manual governor control)") | |
| 208 | - | fi | |
| 209 | - | ||
| 210 | - | # Show recommendation | |
| 211 | - | local recommended | |
| 212 | - | recommended=$(get_pstate_recommendation "$zen_gen") | |
| 213 | - | ||
| 214 | - | if [ "$recommended" != "none" ]; then | |
| 215 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "Recommended for $zen_label: $recommended" | |
| 216 | - | echo | |
| 217 | - | fi | |
| 218 | - | ||
| 219 | - | # Let user choose | |
| 220 | - | local choice | |
| 221 | - | choice=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${MODE_CHOICES[@]}") | |
| 222 | - | ||
| 223 | - | # Extract mode name | |
| 224 | - | local selected_mode | |
| 225 | - | selected_mode=$(echo "$choice" | awk '{print $1}') | |
| 226 | - | ||
| 227 | - | # Get any additional kernel parameters needed | |
| 228 | - | local extra_params | |
| 229 | - | extra_params=$(get_additional_params "$zen_gen" "$selected_mode") | |
| 230 | - | ||
| 231 | - | # Export configuration | |
| 232 | - | export ARCHUP_AMD_PSTATE="$selected_mode" | |
| 233 | - | ||
| 234 | - | if [ -n "$extra_params" ]; then | |
| 235 | - | export ARCHUP_AMD_KERNEL_PARAMS="amd_pstate=$selected_mode $extra_params" | |
| 236 | - | else | |
| 237 | - | export ARCHUP_AMD_KERNEL_PARAMS="amd_pstate=$selected_mode" | |
| 238 | - | fi | |
| 239 | - | ||
| 240 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] P-State mode: $selected_mode" | |
| 241 | - | ||
| 242 | - | if [ -n "$extra_params" ]; then | |
| 243 | - | gum style --padding "0 0 1 $PADDING_LEFT" " Additional params: $extra_params" | |
| 244 | - | fi | |
| 245 | - | ||
| 246 | - | echo "AMD CPU: $zen_label, P-State: $selected_mode" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 247 | - | ||
| 248 | - | if [ -n "$extra_params" ]; then | |
| 249 | - | echo " Extra params: $extra_params" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 250 | - | fi | |
| 251 | - | } | |
| 252 | - | ||
| 253 | - | # Run if executed directly (not sourced) | |
| 254 | - | if [ "${BASH_SOURCE[0]}" = "${0}" ]; then | |
| 255 | - | main | |
| 256 | - | fi | |
| @@ -1,256 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # AMD CPU detection and P-State configuration | |||
| 3 | - | # Detects Zen generation and recommends appropriate AMD P-State modes | |||
| 4 | - | ||||
| 5 | - | # This script should only be called for AMD CPUs | |||
| 6 | - | # Requires: gum, /proc/cpuinfo | |||
| 7 | - | ||||
| 8 | - | detect_zen_generation() { | |||
| 9 | - | local cpu_family | |||
| 10 | - | local cpu_model | |||
| 11 | - | ||||
| 12 | - | # Get CPU family and model from /proc/cpuinfo | |||
| 13 | - | cpu_family=$(grep -m1 'cpu family' /proc/cpuinfo | awk '{print $4}') | |||
| 14 | - | cpu_model=$(grep -m1 'model' /proc/cpuinfo | awk '{print $3}') | |||
| 15 | - | ||||
| 16 | - | # Convert to hex for easier comparison (though we'll use decimal) | |||
| 17 | - | local family_dec=$((cpu_family)) | |||
| 18 | - | local model_dec=$((cpu_model)) | |||
| 19 | - | ||||
| 20 | - | # Detect Zen generation based on CPU family and model | |||
| 21 | - | # Reference: https://en.wikichip.org/wiki/amd/cpuid | |||
| 22 | - | ||||
| 23 | - | local zen_gen="" | |||
| 24 | - | local zen_label="" | |||
| 25 | - | ||||
| 26 | - | case $family_dec in | |||
| 27 | - | 23) # Family 17h | |||
| 28 | - | if [ $model_dec -ge 0 ] && [ $model_dec -le 15 ]; then | |||
| 29 | - | zen_gen="1" | |||
| 30 | - | zen_label="Zen 1" | |||
| 31 | - | elif [ $model_dec -ge 16 ] && [ $model_dec -le 31 ]; then | |||
| 32 | - | zen_gen="1+" | |||
| 33 | - | zen_label="Zen+" | |||
| 34 | - | elif [ $model_dec -ge 48 ] && [ $model_dec -le 127 ]; then | |||
| 35 | - | zen_gen="2" | |||
| 36 | - | zen_label="Zen 2" | |||
| 37 | - | else | |||
| 38 | - | zen_gen="2" | |||
| 39 | - | zen_label="Zen 2 (assumed)" | |||
| 40 | - | fi | |||
| 41 | - | ;; | |||
| 42 | - | 25) # Family 19h | |||
| 43 | - | if [ $model_dec -ge 0 ] && [ $model_dec -le 15 ]; then | |||
| 44 | - | zen_gen="3" | |||
| 45 | - | zen_label="Zen 3" | |||
| 46 | - | elif [ $model_dec -ge 32 ] && [ $model_dec -le 47 ]; then | |||
| 47 | - | zen_gen="3" | |||
| 48 | - | zen_label="Zen 3" | |||
| 49 | - | elif [ $model_dec -ge 80 ] && [ $model_dec -le 95 ]; then | |||
| 50 | - | zen_gen="3+" | |||
| 51 | - | zen_label="Zen 3+" | |||
| 52 | - | elif [ $model_dec -ge 96 ] && [ $model_dec -le 175 ]; then | |||
| 53 | - | zen_gen="4" | |||
| 54 | - | zen_label="Zen 4" | |||
| 55 | - | else | |||
| 56 | - | zen_gen="3" | |||
| 57 | - | zen_label="Zen 3 (assumed)" | |||
| 58 | - | fi | |||
| 59 | - | ;; | |||
| 60 | - | 26) # Family 1Ah | |||
| 61 | - | zen_gen="5" | |||
| 62 | - | zen_label="Zen 5" | |||
| 63 | - | ;; | |||
| 64 | - | *) | |||
| 65 | - | zen_gen="unknown" | |||
| 66 | - | zen_label="Unknown" | |||
| 67 | - | ;; | |||
| 68 | - | esac | |||
| 69 | - | ||||
| 70 | - | echo "${zen_gen}|${zen_label}" | |||
| 71 | - | } | |||
| 72 | - | ||||
| 73 | - | get_recommended_pstate_modes() { | |||
| 74 | - | local zen_gen=$1 | |||
| 75 | - | local kernel_version | |||
| 76 | - | ||||
| 77 | - | # Get kernel version | |||
| 78 | - | kernel_version=$(uname -r | cut -d'.' -f1,2) | |||
| 79 | - | local major=$(echo "$kernel_version" | cut -d'.' -f1) | |||
| 80 | - | local minor=$(echo "$kernel_version" | cut -d'.' -f2) | |||
| 81 | - | ||||
| 82 | - | # Calculate kernel version as single number for comparison | |||
| 83 | - | local kernel_num=$((major * 100 + minor)) | |||
| 84 | - | ||||
| 85 | - | # Determine available modes based on Zen generation and kernel version | |||
| 86 | - | # Reference: https://docs.kernel.org/admin-guide/pm/amd-pstate.html | |||
| 87 | - | # Active: CPPC autonomous (amd_pstate_epp) - kernel 6.3+ | |||
| 88 | - | # Passive: CPPC non-autonomous (amd_pstate) - all kernels | |||
| 89 | - | # Guided: CPPC guided autonomous (amd_pstate) - kernel 6.4+ | |||
| 90 | - | ||||
| 91 | - | case $zen_gen in | |||
| 92 | - | "1"|"1+") | |||
| 93 | - | # Zen 1 and Zen+: No CPPC support, use acpi-cpufreq | |||
| 94 | - | echo "none" | |||
| 95 | - | ;; | |||
| 96 | - | "2") | |||
| 97 | - | # Zen 2: Basic CPPC support, may need shared_mem=1 parameter | |||
| 98 | - | # Passive: available, Active: 6.3+ | |||
| 99 | - | if [ $kernel_num -ge 603 ]; then | |||
| 100 | - | echo "passive|active" | |||
| 101 | - | else | |||
| 102 | - | echo "passive" | |||
| 103 | - | fi | |||
| 104 | - | ;; | |||
| 105 | - | "3"|"3+"|"4"|"5") | |||
| 106 | - | # Zen 3+: Full CPPC support for all modes | |||
| 107 | - | # Passive: available, Active: 6.3+, Guided: 6.4+ | |||
| 108 | - | local modes="passive" | |||
| 109 | - | if [ $kernel_num -ge 603 ]; then | |||
| 110 | - | modes="${modes}|active" | |||
| 111 | - | fi | |||
| 112 | - | if [ $kernel_num -ge 604 ]; then | |||
| 113 | - | modes="${modes}|guided" | |||
| 114 | - | fi | |||
| 115 | - | echo "$modes" | |||
| 116 | - | ;; | |||
| 117 | - | *) | |||
| 118 | - | echo "passive" | |||
| 119 | - | ;; | |||
| 120 | - | esac | |||
| 121 | - | } | |||
| 122 | - | ||||
| 123 | - | get_pstate_recommendation() { | |||
| 124 | - | local zen_gen=$1 | |||
| 125 | - | ||||
| 126 | - | # Return the best recommended mode for each Zen generation | |||
| 127 | - | case $zen_gen in | |||
| 128 | - | "1"|"1+") | |||
| 129 | - | echo "none" # Use default acpi-cpufreq | |||
| 130 | - | ;; | |||
| 131 | - | "2") | |||
| 132 | - | echo "passive" # Conservative choice for Zen 2 | |||
| 133 | - | ;; | |||
| 134 | - | "3"|"3+") | |||
| 135 | - | echo "active" # Best for Zen 3/3+ | |||
| 136 | - | ;; | |||
| 137 | - | "4"|"5") | |||
| 138 | - | echo "active" # Best for Zen 4/5 | |||
| 139 | - | ;; | |||
| 140 | - | *) | |||
| 141 | - | echo "passive" | |||
| 142 | - | ;; | |||
| 143 | - | esac | |||
| 144 | - | } | |||
| 145 | - | ||||
| 146 | - | get_additional_params() { | |||
| 147 | - | local zen_gen=$1 | |||
| 148 | - | local mode=$2 | |||
| 149 | - | ||||
| 150 | - | # Some Zen 2 CPUs need shared_mem parameter | |||
| 151 | - | if [ "$zen_gen" = "2" ] && [ "$mode" = "active" ]; then | |||
| 152 | - | echo "amd_pstate.shared_mem=1" | |||
| 153 | - | else | |||
| 154 | - | echo "" | |||
| 155 | - | fi | |||
| 156 | - | } | |||
| 157 | - | ||||
| 158 | - | # Main execution | |||
| 159 | - | main() { | |||
| 160 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "AMD CPU Detection" | |||
| 161 | - | ||||
| 162 | - | # Detect Zen generation | |||
| 163 | - | local zen_info | |||
| 164 | - | zen_info=$(detect_zen_generation) | |||
| 165 | - | local zen_gen=$(echo "$zen_info" | cut -d'|' -f1) | |||
| 166 | - | local zen_label=$(echo "$zen_info" | cut -d'|' -f2) | |||
| 167 | - | ||||
| 168 | - | # Get CPU model name for display | |||
| 169 | - | local cpu_model_name | |||
| 170 | - | cpu_model_name=$(grep -m1 'model name' /proc/cpuinfo | cut -d':' -f2 | sed 's/^[ \t]*//') | |||
| 171 | - | ||||
| 172 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Detected: $zen_label" | |||
| 173 | - | gum style --padding "0 0 0 $PADDING_LEFT" " CPU: $cpu_model_name" | |||
| 174 | - | ||||
| 175 | - | # Check if Zen generation supports AMD pstate | |||
| 176 | - | if [ "$zen_gen" = "1" ] || [ "$zen_gen" = "1+" ]; then | |||
| 177 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[WARN] $zen_label does not support AMD P-State driver" | |||
| 178 | - | gum style --padding "0 0 1 $PADDING_LEFT" " Using default acpi-cpufreq driver" | |||
| 179 | - | export ARCHUP_AMD_PSTATE="" | |||
| 180 | - | export ARCHUP_AMD_KERNEL_PARAMS="" | |||
| 181 | - | echo "AMD CPU: $zen_label (no P-State support)" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 182 | - | return 0 | |||
| 183 | - | fi | |||
| 184 | - | ||||
| 185 | - | # Get available modes for this Zen generation | |||
| 186 | - | local available_modes | |||
| 187 | - | available_modes=$(get_recommended_pstate_modes "$zen_gen") | |||
| 188 | - | ||||
| 189 | - | echo | |||
| 190 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "AMD P-State Configuration" | |||
| 191 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Select AMD P-State driver mode for CPU frequency scaling" | |||
| 192 | - | gum style --foreground 8 --padding "0 0 0 $PADDING_LEFT" "Note: Requires CPPC enabled in UEFI (AMD CBS > NBIO > SMU > CPPC)" | |||
| 193 | - | echo | |||
| 194 | - | ||||
| 195 | - | # Build choice menu based on available modes | |||
| 196 | - | declare -a MODE_CHOICES | |||
| 197 | - | ||||
| 198 | - | if echo "$available_modes" | grep -q "active"; then | |||
| 199 | - | MODE_CHOICES+=("active - CPPC autonomous with EPP hints (best performance, desktop/gaming)") | |||
| 200 | - | fi | |||
| 201 | - | ||||
| 202 | - | if echo "$available_modes" | grep -q "guided"; then | |||
| 203 | - | MODE_CHOICES+=("guided - CPPC guided autonomous (balanced, laptop/hybrid)") | |||
| 204 | - | fi | |||
| 205 | - | ||||
| 206 | - | if echo "$available_modes" | grep -q "passive"; then | |||
| 207 | - | MODE_CHOICES+=("passive - CPPC non-autonomous (compatibility, manual governor control)") | |||
| 208 | - | fi | |||
| 209 | - | ||||
| 210 | - | # Show recommendation | |||
| 211 | - | local recommended | |||
| 212 | - | recommended=$(get_pstate_recommendation "$zen_gen") | |||
| 213 | - | ||||
| 214 | - | if [ "$recommended" != "none" ]; then | |||
| 215 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "Recommended for $zen_label: $recommended" | |||
| 216 | - | echo | |||
| 217 | - | fi | |||
| 218 | - | ||||
| 219 | - | # Let user choose | |||
| 220 | - | local choice | |||
| 221 | - | choice=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${MODE_CHOICES[@]}") | |||
| 222 | - | ||||
| 223 | - | # Extract mode name | |||
| 224 | - | local selected_mode | |||
| 225 | - | selected_mode=$(echo "$choice" | awk '{print $1}') | |||
| 226 | - | ||||
| 227 | - | # Get any additional kernel parameters needed | |||
| 228 | - | local extra_params | |||
| 229 | - | extra_params=$(get_additional_params "$zen_gen" "$selected_mode") | |||
| 230 | - | ||||
| 231 | - | # Export configuration | |||
| 232 | - | export ARCHUP_AMD_PSTATE="$selected_mode" | |||
| 233 | - | ||||
| 234 | - | if [ -n "$extra_params" ]; then | |||
| 235 | - | export ARCHUP_AMD_KERNEL_PARAMS="amd_pstate=$selected_mode $extra_params" | |||
| 236 | - | else | |||
| 237 | - | export ARCHUP_AMD_KERNEL_PARAMS="amd_pstate=$selected_mode" | |||
| 238 | - | fi | |||
| 239 | - | ||||
| 240 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] P-State mode: $selected_mode" | |||
| 241 | - | ||||
| 242 | - | if [ -n "$extra_params" ]; then | |||
| 243 | - | gum style --padding "0 0 1 $PADDING_LEFT" " Additional params: $extra_params" | |||
| 244 | - | fi | |||
| 245 | - | ||||
| 246 | - | echo "AMD CPU: $zen_label, P-State: $selected_mode" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 247 | - | ||||
| 248 | - | if [ -n "$extra_params" ]; then | |||
| 249 | - | echo " Extra params: $extra_params" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 250 | - | fi | |||
| 251 | - | } | |||
| 252 | - | ||||
| 253 | - | # Run if executed directly (not sourced) | |||
| 254 | - | if [ "${BASH_SOURCE[0]}" = "${0}" ]; then | |||
| 255 | - | main | |||
| 256 | - | fi | |||
D install/deprecated/base/cachyos-repo.sh +0 -49
| @@ -1,49 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Configure CachyOS repository if linux-cachyos kernel is selected | |
| 3 | - | ||
| 4 | - | # Only run if linux-cachyos is selected | |
| 5 | - | if [[ "$ARCHUP_KERNEL" != "linux-cachyos" ]]; then | |
| 6 | - | exit 0 | |
| 7 | - | fi | |
| 8 | - | ||
| 9 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring CachyOS repository..." | |
| 10 | - | ||
| 11 | - | # Download and import CachyOS keyring | |
| 12 | - | echo "Downloading CachyOS keyring..." >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 13 | - | pacman-key --recv-keys F3B607488DB35A47 --keyserver keyserver.ubuntu.com >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 14 | - | pacman-key --lsign-key F3B607488DB35A47 >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 15 | - | ||
| 16 | - | # Detect CPU architecture for optimal repo selection | |
| 17 | - | CPU_LEVEL="x86-64" | |
| 18 | - | if grep -q "avx2" /proc/cpuinfo && grep -q "fma" /proc/cpuinfo; then | |
| 19 | - | CPU_LEVEL="x86-64-v3" | |
| 20 | - | echo "Detected x86-64-v3 CPU support" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 21 | - | else | |
| 22 | - | echo "Using x86-64 (generic) repository" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 23 | - | fi | |
| 24 | - | ||
| 25 | - | # Add CachyOS repository to live system's pacman.conf (for pacstrap) | |
| 26 | - | echo "Configuring CachyOS repository on live system..." >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 27 | - | ||
| 28 | - | # Check if already configured | |
| 29 | - | if ! grep -q "\[cachyos\]" /etc/pacman.conf; then | |
| 30 | - | # Add CachyOS repo before [core] repository | |
| 31 | - | sed -i '/^\[core\]/i \ | |
| 32 | - | # CachyOS repositories\ | |
| 33 | - | [cachyos]\ | |
| 34 | - | Include = /etc/pacman.d/cachyos-mirrorlist\ | |
| 35 | - | ' /etc/pacman.conf | |
| 36 | - | fi | |
| 37 | - | ||
| 38 | - | # Create mirrorlist for CachyOS | |
| 39 | - | cat > /etc/pacman.d/cachyos-mirrorlist << 'EOF' | |
| 40 | - | ## CachyOS mirrorlist | |
| 41 | - | Server = https://mirror.cachyos.org/repo/$arch/$repo | |
| 42 | - | EOF | |
| 43 | - | ||
| 44 | - | # Sync databases | |
| 45 | - | echo "Syncing package databases..." >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 46 | - | pacman -Sy >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 47 | - | ||
| 48 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] CachyOS repository configured" | |
| 49 | - | echo "CachyOS repository enabled for $CPU_LEVEL architecture" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,49 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Configure CachyOS repository if linux-cachyos kernel is selected | |||
| 3 | - | ||||
| 4 | - | # Only run if linux-cachyos is selected | |||
| 5 | - | if [[ "$ARCHUP_KERNEL" != "linux-cachyos" ]]; then | |||
| 6 | - | exit 0 | |||
| 7 | - | fi | |||
| 8 | - | ||||
| 9 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring CachyOS repository..." | |||
| 10 | - | ||||
| 11 | - | # Download and import CachyOS keyring | |||
| 12 | - | echo "Downloading CachyOS keyring..." >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 13 | - | pacman-key --recv-keys F3B607488DB35A47 --keyserver keyserver.ubuntu.com >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 14 | - | pacman-key --lsign-key F3B607488DB35A47 >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 15 | - | ||||
| 16 | - | # Detect CPU architecture for optimal repo selection | |||
| 17 | - | CPU_LEVEL="x86-64" | |||
| 18 | - | if grep -q "avx2" /proc/cpuinfo && grep -q "fma" /proc/cpuinfo; then | |||
| 19 | - | CPU_LEVEL="x86-64-v3" | |||
| 20 | - | echo "Detected x86-64-v3 CPU support" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 21 | - | else | |||
| 22 | - | echo "Using x86-64 (generic) repository" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 23 | - | fi | |||
| 24 | - | ||||
| 25 | - | # Add CachyOS repository to live system's pacman.conf (for pacstrap) | |||
| 26 | - | echo "Configuring CachyOS repository on live system..." >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 27 | - | ||||
| 28 | - | # Check if already configured | |||
| 29 | - | if ! grep -q "\[cachyos\]" /etc/pacman.conf; then | |||
| 30 | - | # Add CachyOS repo before [core] repository | |||
| 31 | - | sed -i '/^\[core\]/i \ | |||
| 32 | - | # CachyOS repositories\ | |||
| 33 | - | [cachyos]\ | |||
| 34 | - | Include = /etc/pacman.d/cachyos-mirrorlist\ | |||
| 35 | - | ' /etc/pacman.conf | |||
| 36 | - | fi | |||
| 37 | - | ||||
| 38 | - | # Create mirrorlist for CachyOS | |||
| 39 | - | cat > /etc/pacman.d/cachyos-mirrorlist << 'EOF' | |||
| 40 | - | ## CachyOS mirrorlist | |||
| 41 | - | Server = https://mirror.cachyos.org/repo/$arch/$repo | |||
| 42 | - | EOF | |||
| 43 | - | ||||
| 44 | - | # Sync databases | |||
| 45 | - | echo "Syncing package databases..." >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 46 | - | pacman -Sy >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 47 | - | ||||
| 48 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] CachyOS repository configured" | |||
| 49 | - | echo "CachyOS repository enabled for $CPU_LEVEL architecture" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
D install/deprecated/base/enable-multilib.sh +0 -15
| @@ -1,15 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Enable multilib on ISO before pacstrap | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Enabling multilib repository..." | |
| 5 | - | ||
| 6 | - | # Enable multilib in ISO's pacman.conf | |
| 7 | - | enable_multilib "/etc/pacman.conf" | |
| 8 | - | ||
| 9 | - | # Update package database | |
| 10 | - | if ! run_with_spinner "Updating package database..." "pacman -Sy --noconfirm"; then | |
| 11 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Failed to update package database" | |
| 12 | - | exit 1 | |
| 13 | - | fi | |
| 14 | - | ||
| 15 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Multilib enabled" | |
| @@ -1,15 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Enable multilib on ISO before pacstrap | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Enabling multilib repository..." | |||
| 5 | - | ||||
| 6 | - | # Enable multilib in ISO's pacman.conf | |||
| 7 | - | enable_multilib "/etc/pacman.conf" | |||
| 8 | - | ||||
| 9 | - | # Update package database | |||
| 10 | - | if ! run_with_spinner "Updating package database..." "pacman -Sy --noconfirm"; then | |||
| 11 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Failed to update package database" | |||
| 12 | - | exit 1 | |||
| 13 | - | fi | |||
| 14 | - | ||||
| 15 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Multilib enabled" | |||
D install/deprecated/base/fstab.sh +0 -11
| @@ -1,11 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Generate fstab | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Generating fstab..." | |
| 5 | - | ||
| 6 | - | # Generate fstab using UUIDs | |
| 7 | - | genfstab -U /mnt >> /mnt/etc/fstab | |
| 8 | - | ||
| 9 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] fstab generated" | |
| 10 | - | ||
| 11 | - | echo "Generated /etc/fstab" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,11 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Generate fstab | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Generating fstab..." | |||
| 5 | - | ||||
| 6 | - | # Generate fstab using UUIDs | |||
| 7 | - | genfstab -U /mnt >> /mnt/etc/fstab | |||
| 8 | - | ||||
| 9 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] fstab generated" | |||
| 10 | - | ||||
| 11 | - | echo "Generated /etc/fstab" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
D install/deprecated/base/kernel.sh +0 -131
| @@ -1,131 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Kernel selection and microcode installation | |
| 3 | - | # Detects CPU vendor and auto-installs appropriate microcode | |
| 4 | - | ||
| 5 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Kernel Selection" | |
| 6 | - | ||
| 7 | - | # Ask user to choose kernel | |
| 8 | - | echo | |
| 9 | - | KERNEL_CHOICE=$(gum choose --padding "0 0 1 $PADDING_LEFT" \ | |
| 10 | - | "linux - Stable mainline kernel (recommended)" \ | |
| 11 | - | "linux-lts - Long-term support (maximum stability)" \ | |
| 12 | - | "linux-zen - Performance-optimized for general use" \ | |
| 13 | - | "linux-cachyos - Gaming-optimized") | |
| 14 | - | ||
| 15 | - | # Extract just the kernel name (before the dash) | |
| 16 | - | KERNEL_CHOICE=$(echo "$KERNEL_CHOICE" | awk '{print $1}') | |
| 17 | - | export ARCHUP_KERNEL="$KERNEL_CHOICE" | |
| 18 | - | ||
| 19 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Selected: $ARCHUP_KERNEL" | |
| 20 | - | echo "Kernel: $ARCHUP_KERNEL" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 21 | - | ||
| 22 | - | # Detect CPU vendor | |
| 23 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Detecting CPU vendor..." | |
| 24 | - | ||
| 25 | - | CPU_VENDOR=$(grep -m1 'vendor_id' /proc/cpuinfo | awk '{print $3}') | |
| 26 | - | ||
| 27 | - | if [ "$CPU_VENDOR" = "GenuineIntel" ]; then | |
| 28 | - | MICROCODE="intel-ucode" | |
| 29 | - | CPU_TYPE="Intel" | |
| 30 | - | elif [ "$CPU_VENDOR" = "AuthenticAMD" ]; then | |
| 31 | - | MICROCODE="amd-ucode" | |
| 32 | - | CPU_TYPE="AMD" | |
| 33 | - | else | |
| 34 | - | MICROCODE="" | |
| 35 | - | CPU_TYPE="Unknown" | |
| 36 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[WARN] Unknown CPU vendor: $CPU_VENDOR" | |
| 37 | - | fi | |
| 38 | - | ||
| 39 | - | if [ -n "$MICROCODE" ]; then | |
| 40 | - | export ARCHUP_MICROCODE="$MICROCODE" | |
| 41 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Detected: $CPU_TYPE CPU" | |
| 42 | - | gum style --padding "0 0 1 $PADDING_LEFT" " Microcode: $MICROCODE" | |
| 43 | - | echo "CPU: $CPU_TYPE, Microcode: $MICROCODE" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 44 | - | else | |
| 45 | - | export ARCHUP_MICROCODE="" | |
| 46 | - | echo "CPU: Unknown, no microcode" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 47 | - | fi | |
| 48 | - | ||
| 49 | - | # AMD-specific tuning (P-State driver selection) | |
| 50 | - | if [ "$CPU_TYPE" = "AMD" ]; then | |
| 51 | - | echo | |
| 52 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "AMD CPU Tuning" | |
| 53 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Select AMD P-State driver mode for CPU frequency scaling" | |
| 54 | - | echo | |
| 55 | - | ||
| 56 | - | # Detect available AMD P-State modes from the live system | |
| 57 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Detecting available P-State modes..." | |
| 58 | - | ||
| 59 | - | # Check if amd-pstate driver is loaded and what modes are available | |
| 60 | - | AVAILABLE_MODES=() | |
| 61 | - | ||
| 62 | - | # Try to read available modes from sysfs (if driver is already loaded) | |
| 63 | - | if [ -f /sys/devices/system/cpu/amd_pstate/status ]; then | |
| 64 | - | # Driver is loaded, check available modes | |
| 65 | - | # Typically: active, passive, guided, disable | |
| 66 | - | mapfile -t AVAILABLE_MODES < <(cat /sys/devices/system/cpu/amd_pstate/status 2>/dev/null | grep -oE '(active|passive|guided)' || echo "") | |
| 67 | - | fi | |
| 68 | - | ||
| 69 | - | # If we couldn't detect modes, check if the CPU supports CPPC | |
| 70 | - | # Most modern AMD Ryzen CPUs support all three modes | |
| 71 | - | if [ ${#AVAILABLE_MODES[@]} -eq 0 ]; then | |
| 72 | - | # Check if CPPC is supported (indicates active mode support) | |
| 73 | - | if grep -q "cppc" /proc/cpuinfo 2>/dev/null || [ -d /sys/devices/system/cpu/cpu0/cpufreq/amd_pstate ]; then | |
| 74 | - | AVAILABLE_MODES=("active" "guided" "passive") | |
| 75 | - | else | |
| 76 | - | # Fallback: older AMD CPUs might only support passive | |
| 77 | - | AVAILABLE_MODES=("passive") | |
| 78 | - | fi | |
| 79 | - | fi | |
| 80 | - | ||
| 81 | - | # Remove duplicates and sort, filter out empty strings | |
| 82 | - | mapfile -t AVAILABLE_MODES < <(printf '%s\n' "${AVAILABLE_MODES[@]}" | grep -v '^$' | sort -u) | |
| 83 | - | ||
| 84 | - | # Display detected modes | |
| 85 | - | if [ ${#AVAILABLE_MODES[@]} -gt 0 ]; then | |
| 86 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Detected ${#AVAILABLE_MODES[@]} available mode(s): ${AVAILABLE_MODES[*]}" | |
| 87 | - | else | |
| 88 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[WARN] Could not detect available modes, using defaults" | |
| 89 | - | AVAILABLE_MODES=("passive") | |
| 90 | - | fi | |
| 91 | - | ||
| 92 | - | # Auto-select if only one mode available, otherwise prompt user | |
| 93 | - | if [[ ${#AVAILABLE_MODES[@]} -eq 1 ]]; then | |
| 94 | - | AMD_PSTATE="${AVAILABLE_MODES[0]}" | |
| 95 | - | gum style --foreground 2 --padding "1 0 0 $PADDING_LEFT" "[OK] Auto-selected: $AMD_PSTATE (only available mode)" | |
| 96 | - | else | |
| 97 | - | echo | |
| 98 | - | # Build choice options with descriptions | |
| 99 | - | declare -a MODE_CHOICES | |
| 100 | - | for mode in "${AVAILABLE_MODES[@]}"; do | |
| 101 | - | case "$mode" in | |
| 102 | - | active) | |
| 103 | - | MODE_CHOICES+=("active - Best performance (recommended for desktop/gaming)") | |
| 104 | - | ;; | |
| 105 | - | guided) | |
| 106 | - | MODE_CHOICES+=("guided - Balanced performance and efficiency (recommended for laptops)") | |
| 107 | - | ;; | |
| 108 | - | passive) | |
| 109 | - | MODE_CHOICES+=("passive - Maximum compatibility (older CPUs)") | |
| 110 | - | ;; | |
| 111 | - | esac | |
| 112 | - | done | |
| 113 | - | ||
| 114 | - | AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${MODE_CHOICES[@]}") | |
| 115 | - | ||
| 116 | - | # Extract just the mode name (before the dash) | |
| 117 | - | AMD_PSTATE=$(echo "$AMD_PSTATE" | awk '{print $1}') | |
| 118 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] P-State: $AMD_PSTATE" | |
| 119 | - | fi | |
| 120 | - | ||
| 121 | - | export ARCHUP_AMD_PSTATE="$AMD_PSTATE" | |
| 122 | - | echo "AMD P-State: $AMD_PSTATE (kernel parameter)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 123 | - | ||
| 124 | - | # Prepare kernel parameters for AMD P-State | |
| 125 | - | export ARCHUP_AMD_KERNEL_PARAMS="amd_pstate=$AMD_PSTATE" | |
| 126 | - | else | |
| 127 | - | export ARCHUP_AMD_PSTATE="" | |
| 128 | - | export ARCHUP_AMD_KERNEL_PARAMS="" | |
| 129 | - | fi | |
| 130 | - | ||
| 131 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Kernel configuration complete" | |
| @@ -1,131 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Kernel selection and microcode installation | |||
| 3 | - | # Detects CPU vendor and auto-installs appropriate microcode | |||
| 4 | - | ||||
| 5 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Kernel Selection" | |||
| 6 | - | ||||
| 7 | - | # Ask user to choose kernel | |||
| 8 | - | echo | |||
| 9 | - | KERNEL_CHOICE=$(gum choose --padding "0 0 1 $PADDING_LEFT" \ | |||
| 10 | - | "linux - Stable mainline kernel (recommended)" \ | |||
| 11 | - | "linux-lts - Long-term support (maximum stability)" \ | |||
| 12 | - | "linux-zen - Performance-optimized for general use" \ | |||
| 13 | - | "linux-cachyos - Gaming-optimized") | |||
| 14 | - | ||||
| 15 | - | # Extract just the kernel name (before the dash) | |||
| 16 | - | KERNEL_CHOICE=$(echo "$KERNEL_CHOICE" | awk '{print $1}') | |||
| 17 | - | export ARCHUP_KERNEL="$KERNEL_CHOICE" | |||
| 18 | - | ||||
| 19 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Selected: $ARCHUP_KERNEL" | |||
| 20 | - | echo "Kernel: $ARCHUP_KERNEL" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 21 | - | ||||
| 22 | - | # Detect CPU vendor | |||
| 23 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Detecting CPU vendor..." | |||
| 24 | - | ||||
| 25 | - | CPU_VENDOR=$(grep -m1 'vendor_id' /proc/cpuinfo | awk '{print $3}') | |||
| 26 | - | ||||
| 27 | - | if [ "$CPU_VENDOR" = "GenuineIntel" ]; then | |||
| 28 | - | MICROCODE="intel-ucode" | |||
| 29 | - | CPU_TYPE="Intel" | |||
| 30 | - | elif [ "$CPU_VENDOR" = "AuthenticAMD" ]; then | |||
| 31 | - | MICROCODE="amd-ucode" | |||
| 32 | - | CPU_TYPE="AMD" | |||
| 33 | - | else | |||
| 34 | - | MICROCODE="" | |||
| 35 | - | CPU_TYPE="Unknown" | |||
| 36 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[WARN] Unknown CPU vendor: $CPU_VENDOR" | |||
| 37 | - | fi | |||
| 38 | - | ||||
| 39 | - | if [ -n "$MICROCODE" ]; then | |||
| 40 | - | export ARCHUP_MICROCODE="$MICROCODE" | |||
| 41 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Detected: $CPU_TYPE CPU" | |||
| 42 | - | gum style --padding "0 0 1 $PADDING_LEFT" " Microcode: $MICROCODE" | |||
| 43 | - | echo "CPU: $CPU_TYPE, Microcode: $MICROCODE" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 44 | - | else | |||
| 45 | - | export ARCHUP_MICROCODE="" | |||
| 46 | - | echo "CPU: Unknown, no microcode" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 47 | - | fi | |||
| 48 | - | ||||
| 49 | - | # AMD-specific tuning (P-State driver selection) | |||
| 50 | - | if [ "$CPU_TYPE" = "AMD" ]; then | |||
| 51 | - | echo | |||
| 52 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "AMD CPU Tuning" | |||
| 53 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Select AMD P-State driver mode for CPU frequency scaling" | |||
| 54 | - | echo | |||
| 55 | - | ||||
| 56 | - | # Detect available AMD P-State modes from the live system | |||
| 57 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Detecting available P-State modes..." | |||
| 58 | - | ||||
| 59 | - | # Check if amd-pstate driver is loaded and what modes are available | |||
| 60 | - | AVAILABLE_MODES=() | |||
| 61 | - | ||||
| 62 | - | # Try to read available modes from sysfs (if driver is already loaded) | |||
| 63 | - | if [ -f /sys/devices/system/cpu/amd_pstate/status ]; then | |||
| 64 | - | # Driver is loaded, check available modes | |||
| 65 | - | # Typically: active, passive, guided, disable | |||
| 66 | - | mapfile -t AVAILABLE_MODES < <(cat /sys/devices/system/cpu/amd_pstate/status 2>/dev/null | grep -oE '(active|passive|guided)' || echo "") | |||
| 67 | - | fi | |||
| 68 | - | ||||
| 69 | - | # If we couldn't detect modes, check if the CPU supports CPPC | |||
| 70 | - | # Most modern AMD Ryzen CPUs support all three modes | |||
| 71 | - | if [ ${#AVAILABLE_MODES[@]} -eq 0 ]; then | |||
| 72 | - | # Check if CPPC is supported (indicates active mode support) | |||
| 73 | - | if grep -q "cppc" /proc/cpuinfo 2>/dev/null || [ -d /sys/devices/system/cpu/cpu0/cpufreq/amd_pstate ]; then | |||
| 74 | - | AVAILABLE_MODES=("active" "guided" "passive") | |||
| 75 | - | else | |||
| 76 | - | # Fallback: older AMD CPUs might only support passive | |||
| 77 | - | AVAILABLE_MODES=("passive") | |||
| 78 | - | fi | |||
| 79 | - | fi | |||
| 80 | - | ||||
| 81 | - | # Remove duplicates and sort, filter out empty strings | |||
| 82 | - | mapfile -t AVAILABLE_MODES < <(printf '%s\n' "${AVAILABLE_MODES[@]}" | grep -v '^$' | sort -u) | |||
| 83 | - | ||||
| 84 | - | # Display detected modes | |||
| 85 | - | if [ ${#AVAILABLE_MODES[@]} -gt 0 ]; then | |||
| 86 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Detected ${#AVAILABLE_MODES[@]} available mode(s): ${AVAILABLE_MODES[*]}" | |||
| 87 | - | else | |||
| 88 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[WARN] Could not detect available modes, using defaults" | |||
| 89 | - | AVAILABLE_MODES=("passive") | |||
| 90 | - | fi | |||
| 91 | - | ||||
| 92 | - | # Auto-select if only one mode available, otherwise prompt user | |||
| 93 | - | if [[ ${#AVAILABLE_MODES[@]} -eq 1 ]]; then | |||
| 94 | - | AMD_PSTATE="${AVAILABLE_MODES[0]}" | |||
| 95 | - | gum style --foreground 2 --padding "1 0 0 $PADDING_LEFT" "[OK] Auto-selected: $AMD_PSTATE (only available mode)" | |||
| 96 | - | else | |||
| 97 | - | echo | |||
| 98 | - | # Build choice options with descriptions | |||
| 99 | - | declare -a MODE_CHOICES | |||
| 100 | - | for mode in "${AVAILABLE_MODES[@]}"; do | |||
| 101 | - | case "$mode" in | |||
| 102 | - | active) | |||
| 103 | - | MODE_CHOICES+=("active - Best performance (recommended for desktop/gaming)") | |||
| 104 | - | ;; | |||
| 105 | - | guided) | |||
| 106 | - | MODE_CHOICES+=("guided - Balanced performance and efficiency (recommended for laptops)") | |||
| 107 | - | ;; | |||
| 108 | - | passive) | |||
| 109 | - | MODE_CHOICES+=("passive - Maximum compatibility (older CPUs)") | |||
| 110 | - | ;; | |||
| 111 | - | esac | |||
| 112 | - | done | |||
| 113 | - | ||||
| 114 | - | AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${MODE_CHOICES[@]}") | |||
| 115 | - | ||||
| 116 | - | # Extract just the mode name (before the dash) | |||
| 117 | - | AMD_PSTATE=$(echo "$AMD_PSTATE" | awk '{print $1}') | |||
| 118 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] P-State: $AMD_PSTATE" | |||
| 119 | - | fi | |||
| 120 | - | ||||
| 121 | - | export ARCHUP_AMD_PSTATE="$AMD_PSTATE" | |||
| 122 | - | echo "AMD P-State: $AMD_PSTATE (kernel parameter)" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 123 | - | ||||
| 124 | - | # Prepare kernel parameters for AMD P-State | |||
| 125 | - | export ARCHUP_AMD_KERNEL_PARAMS="amd_pstate=$AMD_PSTATE" | |||
| 126 | - | else | |||
| 127 | - | export ARCHUP_AMD_PSTATE="" | |||
| 128 | - | export ARCHUP_AMD_KERNEL_PARAMS="" | |||
| 129 | - | fi | |||
| 130 | - | ||||
| 131 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Kernel configuration complete" | |||
D install/deprecated/base/pacman.sh +0 -7
| @@ -1,7 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Configure ISO pacman for faster downloads | |
| 3 | - | ||
| 4 | - | # Enable ParallelDownloads on ISO | |
| 5 | - | sed -i 's/^#ParallelDownloads = 5$/ParallelDownloads = 10/' /etc/pacman.conf | |
| 6 | - | ||
| 7 | - | echo "ISO Pacman configured: ParallelDownloads=10" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,7 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Configure ISO pacman for faster downloads | |||
| 3 | - | ||||
| 4 | - | # Enable ParallelDownloads on ISO | |||
| 5 | - | sed -i 's/^#ParallelDownloads = 5$/ParallelDownloads = 10/' /etc/pacman.conf | |||
| 6 | - | ||||
| 7 | - | echo "ISO Pacman configured: ParallelDownloads=10" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
D install/deprecated/base/pacstrap.sh +0 -55
| @@ -1,55 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Install base system with pacstrap | |
| 3 | - | ||
| 4 | - | # Read base package list | |
| 5 | - | mapfile -t packages < <(grep -v '^#' "$ARCHUP_INSTALL/base.packages" | grep -v '^$') | |
| 6 | - | ||
| 7 | - | # Add kernel (selected in kernel.sh) | |
| 8 | - | if [ -n "$ARCHUP_KERNEL" ]; then | |
| 9 | - | packages+=("$ARCHUP_KERNEL") | |
| 10 | - | echo "Adding kernel: $ARCHUP_KERNEL" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 11 | - | fi | |
| 12 | - | ||
| 13 | - | # Add microcode (detected in kernel.sh) | |
| 14 | - | if [ -n "$ARCHUP_MICROCODE" ]; then | |
| 15 | - | packages+=("$ARCHUP_MICROCODE") | |
| 16 | - | echo "Adding microcode: $ARCHUP_MICROCODE" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 17 | - | fi | |
| 18 | - | ||
| 19 | - | # Add cryptsetup if encryption is enabled | |
| 20 | - | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |
| 21 | - | packages+=("cryptsetup") | |
| 22 | - | echo "Adding cryptsetup for LUKS encryption" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 23 | - | fi | |
| 24 | - | ||
| 25 | - | # Install base system with spinner | |
| 26 | - | # Note: pacstrap automatically runs with --noconfirm unless -i flag is used | |
| 27 | - | echo "Installing ${#packages[@]} packages: ${packages[*]}" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 28 | - | if ! run_with_spinner "Installing base system (${#packages[@]} packages)..." "pacstrap /mnt ${packages[*]}"; then | |
| 29 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Base system installation failed" | |
| 30 | - | exit 1 | |
| 31 | - | fi | |
| 32 | - | ||
| 33 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Base system installed" | |
| 34 | - | ||
| 35 | - | echo "Installed ${#packages[@]} packages" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 36 | - | ||
| 37 | - | # Configure CachyOS repository in installed system if linux-cachyos was selected | |
| 38 | - | if [[ "$ARCHUP_KERNEL" == "linux-cachyos" ]]; then | |
| 39 | - | echo "Configuring CachyOS repository in installed system..." >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 40 | - | ||
| 41 | - | # Add CachyOS repo before [core] repository | |
| 42 | - | if ! grep -q "\[cachyos\]" /mnt/etc/pacman.conf; then | |
| 43 | - | sed -i '/^\[core\]/i \ | |
| 44 | - | # CachyOS repositories\ | |
| 45 | - | [cachyos]\ | |
| 46 | - | Include = /etc/pacman.d/cachyos-mirrorlist\ | |
| 47 | - | ' /mnt/etc/pacman.conf | |
| 48 | - | fi | |
| 49 | - | ||
| 50 | - | # Copy mirrorlist to installed system | |
| 51 | - | mkdir -p /mnt/etc/pacman.d | |
| 52 | - | cp /etc/pacman.d/cachyos-mirrorlist /mnt/etc/pacman.d/cachyos-mirrorlist | |
| 53 | - | ||
| 54 | - | echo "CachyOS repository configured in installed system" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 55 | - | fi | |
| @@ -1,55 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Install base system with pacstrap | |||
| 3 | - | ||||
| 4 | - | # Read base package list | |||
| 5 | - | mapfile -t packages < <(grep -v '^#' "$ARCHUP_INSTALL/base.packages" | grep -v '^$') | |||
| 6 | - | ||||
| 7 | - | # Add kernel (selected in kernel.sh) | |||
| 8 | - | if [ -n "$ARCHUP_KERNEL" ]; then | |||
| 9 | - | packages+=("$ARCHUP_KERNEL") | |||
| 10 | - | echo "Adding kernel: $ARCHUP_KERNEL" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 11 | - | fi | |||
| 12 | - | ||||
| 13 | - | # Add microcode (detected in kernel.sh) | |||
| 14 | - | if [ -n "$ARCHUP_MICROCODE" ]; then | |||
| 15 | - | packages+=("$ARCHUP_MICROCODE") | |||
| 16 | - | echo "Adding microcode: $ARCHUP_MICROCODE" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 17 | - | fi | |||
| 18 | - | ||||
| 19 | - | # Add cryptsetup if encryption is enabled | |||
| 20 | - | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |||
| 21 | - | packages+=("cryptsetup") | |||
| 22 | - | echo "Adding cryptsetup for LUKS encryption" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 23 | - | fi | |||
| 24 | - | ||||
| 25 | - | # Install base system with spinner | |||
| 26 | - | # Note: pacstrap automatically runs with --noconfirm unless -i flag is used | |||
| 27 | - | echo "Installing ${#packages[@]} packages: ${packages[*]}" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 28 | - | if ! run_with_spinner "Installing base system (${#packages[@]} packages)..." "pacstrap /mnt ${packages[*]}"; then | |||
| 29 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Base system installation failed" | |||
| 30 | - | exit 1 | |||
| 31 | - | fi | |||
| 32 | - | ||||
| 33 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Base system installed" | |||
| 34 | - | ||||
| 35 | - | echo "Installed ${#packages[@]} packages" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 36 | - | ||||
| 37 | - | # Configure CachyOS repository in installed system if linux-cachyos was selected | |||
| 38 | - | if [[ "$ARCHUP_KERNEL" == "linux-cachyos" ]]; then | |||
| 39 | - | echo "Configuring CachyOS repository in installed system..." >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 40 | - | ||||
| 41 | - | # Add CachyOS repo before [core] repository | |||
| 42 | - | if ! grep -q "\[cachyos\]" /mnt/etc/pacman.conf; then | |||
| 43 | - | sed -i '/^\[core\]/i \ | |||
| 44 | - | # CachyOS repositories\ | |||
| 45 | - | [cachyos]\ | |||
| 46 | - | Include = /etc/pacman.d/cachyos-mirrorlist\ | |||
| 47 | - | ' /mnt/etc/pacman.conf | |||
| 48 | - | fi | |||
| 49 | - | ||||
| 50 | - | # Copy mirrorlist to installed system | |||
| 51 | - | mkdir -p /mnt/etc/pacman.d | |||
| 52 | - | cp /etc/pacman.d/cachyos-mirrorlist /mnt/etc/pacman.d/cachyos-mirrorlist | |||
| 53 | - | ||||
| 54 | - | echo "CachyOS repository configured in installed system" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 55 | - | fi | |||
D install/deprecated/boot/all.sh +0 -4
| @@ -1,4 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Bootloader installation phase | |
| 3 | - | ||
| 4 | - | run_logged "$ARCHUP_INSTALL/boot/limine.sh" | |
| @@ -1,4 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Bootloader installation phase | |||
| 3 | - | ||||
| 4 | - | run_logged "$ARCHUP_INSTALL/boot/limine.sh" | |||
D install/deprecated/boot/limine.sh +0 -88
| @@ -1,88 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Install and configure Limine bootloader | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing Limine bootloader..." | |
| 5 | - | ||
| 6 | - | # Determine root device UUID and prepare kernel parameters | |
| 7 | - | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |
| 8 | - | # For encrypted setups, we need the root partition UUID (before LUKS) | |
| 9 | - | ROOT_UUID=$(blkid -s UUID -o value "$ARCHUP_ROOT_PART") | |
| 10 | - | ||
| 11 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring initramfs for encryption..." | |
| 12 | - | ||
| 13 | - | sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block plymouth encrypt filesystems fsck)/' /mnt/etc/mkinitcpio.conf | |
| 14 | - | ||
| 15 | - | echo "Configured mkinitcpio hooks for encrypted Plymouth boot" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 16 | - | ||
| 17 | - | KERNEL_PARAMS="cryptdevice=UUID=$ROOT_UUID:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw" | |
| 18 | - | else | |
| 19 | - | # For non-encrypted setups, use the root partition UUID directly | |
| 20 | - | ROOT_UUID=$(blkid -s UUID -o value "$ARCHUP_ROOT_PART") | |
| 21 | - | sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block plymouth filesystems fsck)/' /mnt/etc/mkinitcpio.conf | |
| 22 | - | echo "Configured mkinitcpio hooks for Plymouth boot" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 23 | - | KERNEL_PARAMS="root=UUID=$ROOT_UUID rootflags=subvol=@ rw" | |
| 24 | - | fi | |
| 25 | - | ||
| 26 | - | # Add AMD-specific kernel parameters if configured | |
| 27 | - | if [ -n "$ARCHUP_AMD_KERNEL_PARAMS" ]; then | |
| 28 | - | KERNEL_PARAMS="$KERNEL_PARAMS $ARCHUP_AMD_KERNEL_PARAMS" | |
| 29 | - | echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 30 | - | fi | |
| 31 | - | ||
| 32 | - | KERNEL_PARAMS="$KERNEL_PARAMS quiet splash loglevel=3 rd.udev.log_priority=3 systemd.show_status=auto" | |
| 33 | - | ||
| 34 | - | # Regenerate initramfs with updated hooks (covers both encrypted and plain setups) | |
| 35 | - | arch-chroot /mnt mkinitcpio -P >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 36 | - | ||
| 37 | - | # Install Limine to the disk (BIOS - optional, will fail on UEFI-only systems) | |
| 38 | - | arch-chroot /mnt limine bios-install "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true | |
| 39 | - | ||
| 40 | - | # Create Limine directory following official Arch Wiki method | |
| 41 | - | mkdir -p /mnt/boot/EFI/limine | |
| 42 | - | ||
| 43 | - | # Copy Limine EFI bootloader to recommended location | |
| 44 | - | cp /mnt/usr/share/limine/BOOTX64.EFI /mnt/boot/EFI/limine/ | |
| 45 | - | ||
| 46 | - | # Create Limine configuration file at recommended location | |
| 47 | - | # Using forward slash syntax and proper key names as per official documentation | |
| 48 | - | cat > /mnt/boot/EFI/limine/limine.conf <<EOF | |
| 49 | - | timeout: 0 | |
| 50 | - | default_entry: 0 | |
| 51 | - | interface_branding: ArchUp | |
| 52 | - | interface_branding_colour: 6 | |
| 53 | - | graphics: yes | |
| 54 | - | quiet: yes | |
| 55 | - | ||
| 56 | - | /Arch Linux | |
| 57 | - | protocol: linux | |
| 58 | - | path: boot():/vmlinuz-$ARCHUP_KERNEL | |
| 59 | - | cmdline: $KERNEL_PARAMS | |
| 60 | - | module_path: boot():/initramfs-$ARCHUP_KERNEL.img | |
| 61 | - | ||
| 62 | - | /Arch Linux (fallback) | |
| 63 | - | protocol: linux | |
| 64 | - | path: boot():/vmlinuz-$ARCHUP_KERNEL | |
| 65 | - | cmdline: $KERNEL_PARAMS | |
| 66 | - | module_path: boot():/initramfs-$ARCHUP_KERNEL-fallback.img | |
| 67 | - | EOF | |
| 68 | - | ||
| 69 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating UEFI boot entry..." | |
| 70 | - | ||
| 71 | - | # Detect EFI partition number (usually 1) | |
| 72 | - | EFI_PART_NUM=$(echo "$ARCHUP_EFI_PART" | grep -o '[0-9]*$' | sed 's/^p//') | |
| 73 | - | ||
| 74 | - | # Add UEFI boot entry using efibootmgr following official method | |
| 75 | - | arch-chroot /mnt efibootmgr --create \ | |
| 76 | - | --disk "$ARCHUP_DISK" \ | |
| 77 | - | --part "$EFI_PART_NUM" \ | |
| 78 | - | --label "ArchUp" \ | |
| 79 | - | --loader "\\EFI\\limine\\BOOTX64.EFI" \ | |
| 80 | - | --unicode >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 81 | - | ||
| 82 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Limine installed and configured" | |
| 83 | - | ||
| 84 | - | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |
| 85 | - | echo "Installed Limine with encrypted root (UUID: $ROOT_UUID)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 86 | - | else | |
| 87 | - | echo "Installed Limine with root UUID: $ROOT_UUID" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 88 | - | fi | |
| @@ -1,88 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Install and configure Limine bootloader | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing Limine bootloader..." | |||
| 5 | - | ||||
| 6 | - | # Determine root device UUID and prepare kernel parameters | |||
| 7 | - | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |||
| 8 | - | # For encrypted setups, we need the root partition UUID (before LUKS) | |||
| 9 | - | ROOT_UUID=$(blkid -s UUID -o value "$ARCHUP_ROOT_PART") | |||
| 10 | - | ||||
| 11 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring initramfs for encryption..." | |||
| 12 | - | ||||
| 13 | - | sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block plymouth encrypt filesystems fsck)/' /mnt/etc/mkinitcpio.conf | |||
| 14 | - | ||||
| 15 | - | echo "Configured mkinitcpio hooks for encrypted Plymouth boot" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 16 | - | ||||
| 17 | - | KERNEL_PARAMS="cryptdevice=UUID=$ROOT_UUID:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw" | |||
| 18 | - | else | |||
| 19 | - | # For non-encrypted setups, use the root partition UUID directly | |||
| 20 | - | ROOT_UUID=$(blkid -s UUID -o value "$ARCHUP_ROOT_PART") | |||
| 21 | - | sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block plymouth filesystems fsck)/' /mnt/etc/mkinitcpio.conf | |||
| 22 | - | echo "Configured mkinitcpio hooks for Plymouth boot" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 23 | - | KERNEL_PARAMS="root=UUID=$ROOT_UUID rootflags=subvol=@ rw" | |||
| 24 | - | fi | |||
| 25 | - | ||||
| 26 | - | # Add AMD-specific kernel parameters if configured | |||
| 27 | - | if [ -n "$ARCHUP_AMD_KERNEL_PARAMS" ]; then | |||
| 28 | - | KERNEL_PARAMS="$KERNEL_PARAMS $ARCHUP_AMD_KERNEL_PARAMS" | |||
| 29 | - | echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 30 | - | fi | |||
| 31 | - | ||||
| 32 | - | KERNEL_PARAMS="$KERNEL_PARAMS quiet splash loglevel=3 rd.udev.log_priority=3 systemd.show_status=auto" | |||
| 33 | - | ||||
| 34 | - | # Regenerate initramfs with updated hooks (covers both encrypted and plain setups) | |||
| 35 | - | arch-chroot /mnt mkinitcpio -P >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 36 | - | ||||
| 37 | - | # Install Limine to the disk (BIOS - optional, will fail on UEFI-only systems) | |||
| 38 | - | arch-chroot /mnt limine bios-install "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true | |||
| 39 | - | ||||
| 40 | - | # Create Limine directory following official Arch Wiki method | |||
| 41 | - | mkdir -p /mnt/boot/EFI/limine | |||
| 42 | - | ||||
| 43 | - | # Copy Limine EFI bootloader to recommended location | |||
| 44 | - | cp /mnt/usr/share/limine/BOOTX64.EFI /mnt/boot/EFI/limine/ | |||
| 45 | - | ||||
| 46 | - | # Create Limine configuration file at recommended location | |||
| 47 | - | # Using forward slash syntax and proper key names as per official documentation | |||
| 48 | - | cat > /mnt/boot/EFI/limine/limine.conf <<EOF | |||
| 49 | - | timeout: 0 | |||
| 50 | - | default_entry: 0 | |||
| 51 | - | interface_branding: ArchUp | |||
| 52 | - | interface_branding_colour: 6 | |||
| 53 | - | graphics: yes | |||
| 54 | - | quiet: yes | |||
| 55 | - | ||||
| 56 | - | /Arch Linux | |||
| 57 | - | protocol: linux | |||
| 58 | - | path: boot():/vmlinuz-$ARCHUP_KERNEL | |||
| 59 | - | cmdline: $KERNEL_PARAMS | |||
| 60 | - | module_path: boot():/initramfs-$ARCHUP_KERNEL.img | |||
| 61 | - | ||||
| 62 | - | /Arch Linux (fallback) | |||
| 63 | - | protocol: linux | |||
| 64 | - | path: boot():/vmlinuz-$ARCHUP_KERNEL | |||
| 65 | - | cmdline: $KERNEL_PARAMS | |||
| 66 | - | module_path: boot():/initramfs-$ARCHUP_KERNEL-fallback.img | |||
| 67 | - | EOF | |||
| 68 | - | ||||
| 69 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating UEFI boot entry..." | |||
| 70 | - | ||||
| 71 | - | # Detect EFI partition number (usually 1) | |||
| 72 | - | EFI_PART_NUM=$(echo "$ARCHUP_EFI_PART" | grep -o '[0-9]*$' | sed 's/^p//') | |||
| 73 | - | ||||
| 74 | - | # Add UEFI boot entry using efibootmgr following official method | |||
| 75 | - | arch-chroot /mnt efibootmgr --create \ | |||
| 76 | - | --disk "$ARCHUP_DISK" \ | |||
| 77 | - | --part "$EFI_PART_NUM" \ | |||
| 78 | - | --label "ArchUp" \ | |||
| 79 | - | --loader "\\EFI\\limine\\BOOTX64.EFI" \ | |||
| 80 | - | --unicode >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 81 | - | ||||
| 82 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Limine installed and configured" | |||
| 83 | - | ||||
| 84 | - | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |||
| 85 | - | echo "Installed Limine with encrypted root (UUID: $ROOT_UUID)" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 86 | - | else | |||
| 87 | - | echo "Installed Limine with root UUID: $ROOT_UUID" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 88 | - | fi | |||
D install/deprecated/bootstrap.sh +0 -49
| @@ -1,49 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Bootstrap: Install essential dependencies before running preflight | |
| 3 | - | # This script cannot use gum since it installs gum! | |
| 4 | - | # Must be run with internet connectivity (after wifi setup in ISO) | |
| 5 | - | ||
| 6 | - | set -e | |
| 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 | - | ||
| 14 | - | echo "=== ArchUp Bootstrap ===" | |
| 15 | - | echo "Installing essential dependencies..." | |
| 16 | - | ||
| 17 | - | # Fix TERM for better gum compatibility in VMs | |
| 18 | - | if [ "$TERM" = "linux" ] || [ -z "$TERM" ]; then | |
| 19 | - | export TERM=xterm-256color | |
| 20 | - | echo "Set TERM=xterm-256color for better TUI compatibility" | |
| 21 | - | fi | |
| 22 | - | ||
| 23 | - | # Sync package database (required on fresh ISO boot) | |
| 24 | - | echo "Syncing package database..." | |
| 25 | - | pacman -Sy --noconfirm | |
| 26 | - | ||
| 27 | - | # Install gum for TUI | |
| 28 | - | if ! command -v gum &>/dev/null; then | |
| 29 | - | echo "Installing gum for interactive TUI..." | |
| 30 | - | pacman -S --needed --noconfirm gum | |
| 31 | - | echo "[OK] gum installed" | |
| 32 | - | else | |
| 33 | - | echo "[OK] gum already available" | |
| 34 | - | fi | |
| 35 | - | ||
| 36 | - | # Install jq for JSON parsing (presets) | |
| 37 | - | if ! command -v jq &>/dev/null; then | |
| 38 | - | echo "Installing jq for preset JSON parsing..." | |
| 39 | - | pacman -S --needed --noconfirm jq | |
| 40 | - | echo "[OK] jq installed" | |
| 41 | - | else | |
| 42 | - | echo "[OK] jq already available" | |
| 43 | - | fi | |
| 44 | - | ||
| 45 | - | # Any other critical dependencies that preflight needs can go here | |
| 46 | - | # Example: pacman -S --needed --noconfirm other-tool | |
| 47 | - | ||
| 48 | - | echo "[OK] Bootstrap complete!" | |
| 49 | - | echo | |
| @@ -1,49 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Bootstrap: Install essential dependencies before running preflight | |||
| 3 | - | # This script cannot use gum since it installs gum! | |||
| 4 | - | # Must be run with internet connectivity (after wifi setup in ISO) | |||
| 5 | - | ||||
| 6 | - | set -e | |||
| 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 | - | ||||
| 14 | - | echo "=== ArchUp Bootstrap ===" | |||
| 15 | - | echo "Installing essential dependencies..." | |||
| 16 | - | ||||
| 17 | - | # Fix TERM for better gum compatibility in VMs | |||
| 18 | - | if [ "$TERM" = "linux" ] || [ -z "$TERM" ]; then | |||
| 19 | - | export TERM=xterm-256color | |||
| 20 | - | echo "Set TERM=xterm-256color for better TUI compatibility" | |||
| 21 | - | fi | |||
| 22 | - | ||||
| 23 | - | # Sync package database (required on fresh ISO boot) | |||
| 24 | - | echo "Syncing package database..." | |||
| 25 | - | pacman -Sy --noconfirm | |||
| 26 | - | ||||
| 27 | - | # Install gum for TUI | |||
| 28 | - | if ! command -v gum &>/dev/null; then | |||
| 29 | - | echo "Installing gum for interactive TUI..." | |||
| 30 | - | pacman -S --needed --noconfirm gum | |||
| 31 | - | echo "[OK] gum installed" | |||
| 32 | - | else | |||
| 33 | - | echo "[OK] gum already available" | |||
| 34 | - | fi | |||
| 35 | - | ||||
| 36 | - | # Install jq for JSON parsing (presets) | |||
| 37 | - | if ! command -v jq &>/dev/null; then | |||
| 38 | - | echo "Installing jq for preset JSON parsing..." | |||
| 39 | - | pacman -S --needed --noconfirm jq | |||
| 40 | - | echo "[OK] jq installed" | |||
| 41 | - | else | |||
| 42 | - | echo "[OK] jq already available" | |||
| 43 | - | fi | |||
| 44 | - | ||||
| 45 | - | # Any other critical dependencies that preflight needs can go here | |||
| 46 | - | # Example: pacman -S --needed --noconfirm other-tool | |||
| 47 | - | ||||
| 48 | - | echo "[OK] Bootstrap complete!" | |||
| 49 | - | echo | |||
D install/deprecated/config/all.sh +0 -10
| @@ -1,10 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Configuration phase | |
| 3 | - | ||
| 4 | - | stop_log_output # Stop for interactive prompts | |
| 5 | - | source "$ARCHUP_INSTALL/config/system.sh" # Interactive (gum input) | |
| 6 | - | source "$ARCHUP_INSTALL/config/user.sh" # Interactive (gum input) | |
| 7 | - | start_log_output # Resume after prompts | |
| 8 | - | ||
| 9 | - | run_logged "$ARCHUP_INSTALL/config/network.sh" # Non-interactive | |
| 10 | - | run_logged "$ARCHUP_INSTALL/config/zram.sh" # Non-interactive | |
| @@ -1,10 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Configuration phase | |||
| 3 | - | ||||
| 4 | - | stop_log_output # Stop for interactive prompts | |||
| 5 | - | source "$ARCHUP_INSTALL/config/system.sh" # Interactive (gum input) | |||
| 6 | - | source "$ARCHUP_INSTALL/config/user.sh" # Interactive (gum input) | |||
| 7 | - | start_log_output # Resume after prompts | |||
| 8 | - | ||||
| 9 | - | run_logged "$ARCHUP_INSTALL/config/network.sh" # Non-interactive | |||
| 10 | - | run_logged "$ARCHUP_INSTALL/config/zram.sh" # Non-interactive | |||
D install/deprecated/config/network.sh +0 -48
| @@ -1,48 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Configure network (NetworkManager) | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring network..." | |
| 5 | - | ||
| 6 | - | # Enable NetworkManager service | |
| 7 | - | arch-chroot /mnt systemctl enable NetworkManager >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 8 | - | ||
| 9 | - | # Migrate WiFi credentials from ISO if detected | |
| 10 | - | if [ -n "$ARCHUP_WIFI_SSID" ] && [ -n "$ARCHUP_WIFI_PASSPHRASE" ]; then | |
| 11 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Migrating WiFi credentials..." | |
| 12 | - | ||
| 13 | - | # Create NetworkManager connection file | |
| 14 | - | cat > "/mnt/etc/NetworkManager/system-connections/${ARCHUP_WIFI_SSID}.nmconnection" <<EOF | |
| 15 | - | [connection] | |
| 16 | - | id=${ARCHUP_WIFI_SSID} | |
| 17 | - | uuid=$(uuidgen) | |
| 18 | - | type=wifi | |
| 19 | - | autoconnect=true | |
| 20 | - | ||
| 21 | - | [wifi] | |
| 22 | - | mode=infrastructure | |
| 23 | - | ssid=${ARCHUP_WIFI_SSID} | |
| 24 | - | ||
| 25 | - | [wifi-security] | |
| 26 | - | key-mgmt=wpa-psk | |
| 27 | - | psk=${ARCHUP_WIFI_PASSPHRASE} | |
| 28 | - | ||
| 29 | - | [ipv4] | |
| 30 | - | method=auto | |
| 31 | - | ||
| 32 | - | [ipv6] | |
| 33 | - | addr-gen-mode=default | |
| 34 | - | method=auto | |
| 35 | - | ||
| 36 | - | [proxy] | |
| 37 | - | EOF | |
| 38 | - | ||
| 39 | - | # Set correct permissions (NetworkManager requires 600) | |
| 40 | - | chmod 600 "/mnt/etc/NetworkManager/system-connections/${ARCHUP_WIFI_SSID}.nmconnection" | |
| 41 | - | ||
| 42 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] WiFi credentials migrated: $ARCHUP_WIFI_SSID" | |
| 43 | - | echo "WiFi credentials migrated: $ARCHUP_WIFI_SSID (auto-connect enabled)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 44 | - | fi | |
| 45 | - | ||
| 46 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Network configured" | |
| 47 | - | ||
| 48 | - | echo "Enabled NetworkManager" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,48 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Configure network (NetworkManager) | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring network..." | |||
| 5 | - | ||||
| 6 | - | # Enable NetworkManager service | |||
| 7 | - | arch-chroot /mnt systemctl enable NetworkManager >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 8 | - | ||||
| 9 | - | # Migrate WiFi credentials from ISO if detected | |||
| 10 | - | if [ -n "$ARCHUP_WIFI_SSID" ] && [ -n "$ARCHUP_WIFI_PASSPHRASE" ]; then | |||
| 11 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Migrating WiFi credentials..." | |||
| 12 | - | ||||
| 13 | - | # Create NetworkManager connection file | |||
| 14 | - | cat > "/mnt/etc/NetworkManager/system-connections/${ARCHUP_WIFI_SSID}.nmconnection" <<EOF | |||
| 15 | - | [connection] | |||
| 16 | - | id=${ARCHUP_WIFI_SSID} | |||
| 17 | - | uuid=$(uuidgen) | |||
| 18 | - | type=wifi | |||
| 19 | - | autoconnect=true | |||
| 20 | - | ||||
| 21 | - | [wifi] | |||
| 22 | - | mode=infrastructure | |||
| 23 | - | ssid=${ARCHUP_WIFI_SSID} | |||
| 24 | - | ||||
| 25 | - | [wifi-security] | |||
| 26 | - | key-mgmt=wpa-psk | |||
| 27 | - | psk=${ARCHUP_WIFI_PASSPHRASE} | |||
| 28 | - | ||||
| 29 | - | [ipv4] | |||
| 30 | - | method=auto | |||
| 31 | - | ||||
| 32 | - | [ipv6] | |||
| 33 | - | addr-gen-mode=default | |||
| 34 | - | method=auto | |||
| 35 | - | ||||
| 36 | - | [proxy] | |||
| 37 | - | EOF | |||
| 38 | - | ||||
| 39 | - | # Set correct permissions (NetworkManager requires 600) | |||
| 40 | - | chmod 600 "/mnt/etc/NetworkManager/system-connections/${ARCHUP_WIFI_SSID}.nmconnection" | |||
| 41 | - | ||||
| 42 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] WiFi credentials migrated: $ARCHUP_WIFI_SSID" | |||
| 43 | - | echo "WiFi credentials migrated: $ARCHUP_WIFI_SSID (auto-connect enabled)" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 44 | - | fi | |||
| 45 | - | ||||
| 46 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Network configured" | |||
| 47 | - | ||||
| 48 | - | echo "Enabled NetworkManager" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
D install/deprecated/config/system.sh +0 -58
| @@ -1,58 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # System configuration (timezone, locale, hostname) | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "System Configuration" | |
| 5 | - | ||
| 6 | - | # Read timezone from config (already set in preflight/identify.sh) | |
| 7 | - | if [ -z "$ARCHUP_TIMEZONE" ]; then | |
| 8 | - | ARCHUP_TIMEZONE=$(config_get "ARCHUP_TIMEZONE") | |
| 9 | - | fi | |
| 10 | - | ||
| 11 | - | if [ -z "$ARCHUP_TIMEZONE" ]; then | |
| 12 | - | ARCHUP_TIMEZONE="UTC" | |
| 13 | - | fi | |
| 14 | - | ||
| 15 | - | # Set timezone | |
| 16 | - | arch-chroot /mnt ln -sf "/usr/share/zoneinfo/$ARCHUP_TIMEZONE" /etc/localtime >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 17 | - | arch-chroot /mnt hwclock --systohc >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 18 | - | ||
| 19 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Timezone set to: $ARCHUP_TIMEZONE" | |
| 20 | - | ||
| 21 | - | # Set locale to en_US.UTF-8 | |
| 22 | - | echo "en_US.UTF-8 UTF-8" > /mnt/etc/locale.gen | |
| 23 | - | arch-chroot /mnt locale-gen >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 24 | - | echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf | |
| 25 | - | ||
| 26 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Locale set to: en_US.UTF-8" | |
| 27 | - | ||
| 28 | - | # Set console keyboard layout (detected from ISO) | |
| 29 | - | if [ -n "$ARCHUP_KEYMAP" ]; then | |
| 30 | - | echo "KEYMAP=$ARCHUP_KEYMAP" > /mnt/etc/vconsole.conf | |
| 31 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Console keymap set to: $ARCHUP_KEYMAP" | |
| 32 | - | echo "Console keymap: $ARCHUP_KEYMAP" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 33 | - | fi | |
| 34 | - | ||
| 35 | - | # Read hostname from config (already set in preflight/identify.sh) | |
| 36 | - | if [ -z "$ARCHUP_HOSTNAME" ]; then | |
| 37 | - | ARCHUP_HOSTNAME=$(config_get "ARCHUP_HOSTNAME") | |
| 38 | - | fi | |
| 39 | - | ||
| 40 | - | if [ -z "$ARCHUP_HOSTNAME" ]; then | |
| 41 | - | ARCHUP_HOSTNAME="archup" | |
| 42 | - | fi | |
| 43 | - | ||
| 44 | - | # Set hostname | |
| 45 | - | echo "$ARCHUP_HOSTNAME" > /mnt/etc/hostname | |
| 46 | - | ||
| 47 | - | # Configure hosts file | |
| 48 | - | cat > /mnt/etc/hosts <<EOF | |
| 49 | - | 127.0.0.1 localhost | |
| 50 | - | ::1 localhost | |
| 51 | - | 127.0.1.1 $ARCHUP_HOSTNAME.localdomain $ARCHUP_HOSTNAME | |
| 52 | - | EOF | |
| 53 | - | ||
| 54 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Hostname set to: $ARCHUP_HOSTNAME" | |
| 55 | - | ||
| 56 | - | echo "Timezone: $ARCHUP_TIMEZONE" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 57 | - | echo "Locale: en_US.UTF-8" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 58 | - | echo "Hostname: $ARCHUP_HOSTNAME" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,58 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # System configuration (timezone, locale, hostname) | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "System Configuration" | |||
| 5 | - | ||||
| 6 | - | # Read timezone from config (already set in preflight/identify.sh) | |||
| 7 | - | if [ -z "$ARCHUP_TIMEZONE" ]; then | |||
| 8 | - | ARCHUP_TIMEZONE=$(config_get "ARCHUP_TIMEZONE") | |||
| 9 | - | fi | |||
| 10 | - | ||||
| 11 | - | if [ -z "$ARCHUP_TIMEZONE" ]; then | |||
| 12 | - | ARCHUP_TIMEZONE="UTC" | |||
| 13 | - | fi | |||
| 14 | - | ||||
| 15 | - | # Set timezone | |||
| 16 | - | arch-chroot /mnt ln -sf "/usr/share/zoneinfo/$ARCHUP_TIMEZONE" /etc/localtime >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 17 | - | arch-chroot /mnt hwclock --systohc >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 18 | - | ||||
| 19 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Timezone set to: $ARCHUP_TIMEZONE" | |||
| 20 | - | ||||
| 21 | - | # Set locale to en_US.UTF-8 | |||
| 22 | - | echo "en_US.UTF-8 UTF-8" > /mnt/etc/locale.gen | |||
| 23 | - | arch-chroot /mnt locale-gen >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 24 | - | echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf | |||
| 25 | - | ||||
| 26 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Locale set to: en_US.UTF-8" | |||
| 27 | - | ||||
| 28 | - | # Set console keyboard layout (detected from ISO) | |||
| 29 | - | if [ -n "$ARCHUP_KEYMAP" ]; then | |||
| 30 | - | echo "KEYMAP=$ARCHUP_KEYMAP" > /mnt/etc/vconsole.conf | |||
| 31 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Console keymap set to: $ARCHUP_KEYMAP" | |||
| 32 | - | echo "Console keymap: $ARCHUP_KEYMAP" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 33 | - | fi | |||
| 34 | - | ||||
| 35 | - | # Read hostname from config (already set in preflight/identify.sh) | |||
| 36 | - | if [ -z "$ARCHUP_HOSTNAME" ]; then | |||
| 37 | - | ARCHUP_HOSTNAME=$(config_get "ARCHUP_HOSTNAME") | |||
| 38 | - | fi | |||
| 39 | - | ||||
| 40 | - | if [ -z "$ARCHUP_HOSTNAME" ]; then | |||
| 41 | - | ARCHUP_HOSTNAME="archup" | |||
| 42 | - | fi | |||
| 43 | - | ||||
| 44 | - | # Set hostname | |||
| 45 | - | echo "$ARCHUP_HOSTNAME" > /mnt/etc/hostname | |||
| 46 | - | ||||
| 47 | - | # Configure hosts file | |||
| 48 | - | cat > /mnt/etc/hosts <<EOF | |||
| 49 | - | 127.0.0.1 localhost | |||
| 50 | - | ::1 localhost | |||
| 51 | - | 127.0.1.1 $ARCHUP_HOSTNAME.localdomain $ARCHUP_HOSTNAME | |||
| 52 | - | EOF | |||
| 53 | - | ||||
| 54 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Hostname set to: $ARCHUP_HOSTNAME" | |||
| 55 | - | ||||
| 56 | - | echo "Timezone: $ARCHUP_TIMEZONE" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 57 | - | echo "Locale: en_US.UTF-8" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 58 | - | echo "Hostname: $ARCHUP_HOSTNAME" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
D install/deprecated/config/user.sh +0 -23
| @@ -1,23 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # User creation and configuration (uses credentials from preflight) | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating user account..." | |
| 5 | - | ||
| 6 | - | # Set root password (same as user password) | |
| 7 | - | echo "root:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 8 | - | ||
| 9 | - | # Create user with home directory | |
| 10 | - | arch-chroot /mnt useradd -m -G wheel -s /bin/bash "$ARCHUP_USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 11 | - | ||
| 12 | - | # Set user password | |
| 13 | - | echo "$ARCHUP_USERNAME:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 14 | - | ||
| 15 | - | # Enable sudo for wheel group | |
| 16 | - | echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/etc/sudoers.d/wheel | |
| 17 | - | chmod 440 /mnt/etc/sudoers.d/wheel >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 18 | - | ||
| 19 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] User created: $ARCHUP_USERNAME" | |
| 20 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Sudo enabled for wheel group" | |
| 21 | - | ||
| 22 | - | echo "Created user: $ARCHUP_USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 23 | - | echo "Enabled sudo for wheel group" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,23 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # User creation and configuration (uses credentials from preflight) | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating user account..." | |||
| 5 | - | ||||
| 6 | - | # Set root password (same as user password) | |||
| 7 | - | echo "root:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 8 | - | ||||
| 9 | - | # Create user with home directory | |||
| 10 | - | arch-chroot /mnt useradd -m -G wheel -s /bin/bash "$ARCHUP_USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 11 | - | ||||
| 12 | - | # Set user password | |||
| 13 | - | echo "$ARCHUP_USERNAME:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 14 | - | ||||
| 15 | - | # Enable sudo for wheel group | |||
| 16 | - | echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/etc/sudoers.d/wheel | |||
| 17 | - | chmod 440 /mnt/etc/sudoers.d/wheel >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 18 | - | ||||
| 19 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] User created: $ARCHUP_USERNAME" | |||
| 20 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Sudo enabled for wheel group" | |||
| 21 | - | ||||
| 22 | - | echo "Created user: $ARCHUP_USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 23 | - | echo "Enabled sudo for wheel group" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
D install/deprecated/config/zram.sh +0 -25
| @@ -1,25 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Configure zram compressed swap | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring zram swap..." | |
| 5 | - | ||
| 6 | - | # Create zram-generator config | |
| 7 | - | cat > /mnt/etc/systemd/zram-generator.conf << 'EOF' | |
| 8 | - | [zram0] | |
| 9 | - | zram-size = min(ram / 2, 4096) | |
| 10 | - | compression-algorithm = zstd | |
| 11 | - | EOF | |
| 12 | - | ||
| 13 | - | echo "Created /etc/systemd/zram-generator.conf" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 14 | - | ||
| 15 | - | # Create sysctl config for zram optimization | |
| 16 | - | cat > /mnt/etc/sysctl.d/99-vm-zram-parameters.conf << 'EOF' | |
| 17 | - | vm.swappiness = 180 | |
| 18 | - | vm.watermark_boost_factor = 0 | |
| 19 | - | vm.watermark_scale_factor = 125 | |
| 20 | - | vm.page-cluster = 0 | |
| 21 | - | EOF | |
| 22 | - | ||
| 23 | - | echo "Created /etc/sysctl.d/99-vm-zram-parameters.conf with optimized settings" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 24 | - | ||
| 25 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] zram swap configured" | |
| @@ -1,25 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Configure zram compressed swap | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring zram swap..." | |||
| 5 | - | ||||
| 6 | - | # Create zram-generator config | |||
| 7 | - | cat > /mnt/etc/systemd/zram-generator.conf << 'EOF' | |||
| 8 | - | [zram0] | |||
| 9 | - | zram-size = min(ram / 2, 4096) | |||
| 10 | - | compression-algorithm = zstd | |||
| 11 | - | EOF | |||
| 12 | - | ||||
| 13 | - | echo "Created /etc/systemd/zram-generator.conf" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 14 | - | ||||
| 15 | - | # Create sysctl config for zram optimization | |||
| 16 | - | cat > /mnt/etc/sysctl.d/99-vm-zram-parameters.conf << 'EOF' | |||
| 17 | - | vm.swappiness = 180 | |||
| 18 | - | vm.watermark_boost_factor = 0 | |||
| 19 | - | vm.watermark_scale_factor = 125 | |||
| 20 | - | vm.page-cluster = 0 | |||
| 21 | - | EOF | |||
| 22 | - | ||||
| 23 | - | echo "Created /etc/sysctl.d/99-vm-zram-parameters.conf with optimized settings" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 24 | - | ||||
| 25 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] zram swap configured" | |||
D install/deprecated/helpers/all.sh +0 -10
| @@ -1,10 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Source all helper utilities | |
| 3 | - | # This file is sourced by install.sh to load all helper functions | |
| 4 | - | ||
| 5 | - | source "$ARCHUP_INSTALL/helpers/config.sh" | |
| 6 | - | source "$ARCHUP_INSTALL/helpers/presentation.sh" | |
| 7 | - | source "$ARCHUP_INSTALL/helpers/logging.sh" | |
| 8 | - | source "$ARCHUP_INSTALL/helpers/errors.sh" | |
| 9 | - | source "$ARCHUP_INSTALL/helpers/chroot.sh" | |
| 10 | - | source "$ARCHUP_INSTALL/helpers/multilib.sh" | |
| @@ -1,10 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Source all helper utilities | |||
| 3 | - | # This file is sourced by install.sh to load all helper functions | |||
| 4 | - | ||||
| 5 | - | source "$ARCHUP_INSTALL/helpers/config.sh" | |||
| 6 | - | source "$ARCHUP_INSTALL/helpers/presentation.sh" | |||
| 7 | - | source "$ARCHUP_INSTALL/helpers/logging.sh" | |||
| 8 | - | source "$ARCHUP_INSTALL/helpers/errors.sh" | |||
| 9 | - | source "$ARCHUP_INSTALL/helpers/chroot.sh" | |||
| 10 | - | source "$ARCHUP_INSTALL/helpers/multilib.sh" | |||
D install/deprecated/helpers/chroot.sh +0 -15
| @@ -1,15 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Chroot utilities for ArchUp installer | |
| 3 | - | # Adapted from Omarchy chroot.sh | |
| 4 | - | ||
| 5 | - | # Starting the installer with ARCHUP_CHROOT_INSTALL=1 will put it into chroot mode | |
| 6 | - | chrootable_systemctl_enable() { | |
| 7 | - | if [ -n "${ARCHUP_CHROOT_INSTALL:-}" ]; then | |
| 8 | - | sudo systemctl enable $1 | |
| 9 | - | else | |
| 10 | - | sudo systemctl enable --now $1 | |
| 11 | - | fi | |
| 12 | - | } | |
| 13 | - | ||
| 14 | - | # Export the function so it's available in subshells | |
| 15 | - | export -f chrootable_systemctl_enable | |
| @@ -1,15 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Chroot utilities for ArchUp installer | |||
| 3 | - | # Adapted from Omarchy chroot.sh | |||
| 4 | - | ||||
| 5 | - | # Starting the installer with ARCHUP_CHROOT_INSTALL=1 will put it into chroot mode | |||
| 6 | - | chrootable_systemctl_enable() { | |||
| 7 | - | if [ -n "${ARCHUP_CHROOT_INSTALL:-}" ]; then | |||
| 8 | - | sudo systemctl enable $1 | |||
| 9 | - | else | |||
| 10 | - | sudo systemctl enable --now $1 | |||
| 11 | - | fi | |||
| 12 | - | } | |||
| 13 | - | ||||
| 14 | - | # Export the function so it's available in subshells | |||
| 15 | - | export -f chrootable_systemctl_enable | |||
D install/deprecated/helpers/cleanup.sh +0 -293
| @@ -1,293 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # ArchUp Cleanup - Remove artifacts from failed installations | |
| 3 | - | # This script is 100% idempotent and safe to call multiple times | |
| 4 | - | # Called from bootstrap.sh on every install attempt | |
| 5 | - | ||
| 6 | - | # Cleanup modes: | |
| 7 | - | # - default (called from bootstrap): Unmount, close LUKS, disable swap | |
| 8 | - | # - full (optional): Also delete /mnt content, allow fresh pacstrap | |
| 9 | - | # - efi-cleanup (optional): Remove UEFI boot entries (manual only) | |
| 10 | - | ||
| 11 | - | set +e # Continue even if commands fail | |
| 12 | - | ||
| 13 | - | CLEANUP_MODE="${1:-default}" | |
| 14 | - | ||
| 15 | - | # Color codes for output | |
| 16 | - | RED='\033[0;31m' | |
| 17 | - | GREEN='\033[0;32m' | |
| 18 | - | NC='\033[0m' # No Color | |
| 19 | - | ||
| 20 | - | log_cleanup() { | |
| 21 | - | echo "[CLEANUP] $1" | |
| 22 | - | if [ -n "${ARCHUP_INSTALL_LOG_FILE:-}" ] && [ -f "$ARCHUP_INSTALL_LOG_FILE" ]; then | |
| 23 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] [CLEANUP] $1" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 24 | - | fi | |
| 25 | - | } | |
| 26 | - | ||
| 27 | - | log_success() { | |
| 28 | - | echo -e "${GREEN}[CLEANUP OK]${NC} $1" | |
| 29 | - | if [ -n "${ARCHUP_INSTALL_LOG_FILE:-}" ] && [ -f "$ARCHUP_INSTALL_LOG_FILE" ]; then | |
| 30 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] [CLEANUP OK] $1" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 31 | - | fi | |
| 32 | - | } | |
| 33 | - | ||
| 34 | - | log_error() { | |
| 35 | - | echo -e "${RED}[CLEANUP ERROR]${NC} $1" | |
| 36 | - | if [ -n "${ARCHUP_INSTALL_LOG_FILE:-}" ] && [ -f "$ARCHUP_INSTALL_LOG_FILE" ]; then | |
| 37 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] [CLEANUP ERROR] $1" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 38 | - | fi | |
| 39 | - | } | |
| 40 | - | ||
| 41 | - | # ============================================================ | |
| 42 | - | # PHASE 1: SAFE UNMOUNTING - Always safe to do | |
| 43 | - | # ============================================================ | |
| 44 | - | ||
| 45 | - | cleanup_mounts() { | |
| 46 | - | log_cleanup "Cleaning up mounted filesystems..." | |
| 47 | - | ||
| 48 | - | # Unmount in reverse order (most specific first) | |
| 49 | - | local mounts_to_clean=( | |
| 50 | - | "/mnt/boot" | |
| 51 | - | "/mnt/home" | |
| 52 | - | "/mnt" | |
| 53 | - | ) | |
| 54 | - | ||
| 55 | - | for mount_point in "${mounts_to_clean[@]}"; do | |
| 56 | - | if mountpoint -q "$mount_point" 2>/dev/null; then | |
| 57 | - | log_cleanup "Unmounting $mount_point..." | |
| 58 | - | if umount -R "$mount_point" 2>/dev/null; then | |
| 59 | - | log_success "Unmounted $mount_point" | |
| 60 | - | else | |
| 61 | - | # Force unmount if normal unmount fails | |
| 62 | - | log_cleanup "Force unmounting $mount_point..." | |
| 63 | - | if umount -R -l "$mount_point" 2>/dev/null; then | |
| 64 | - | log_success "Force unmounted $mount_point" | |
| 65 | - | else | |
| 66 | - | log_error "Failed to unmount $mount_point (may retry later)" | |
| 67 | - | fi | |
| 68 | - | fi | |
| 69 | - | fi | |
| 70 | - | done | |
| 71 | - | ||
| 72 | - | # Wait for any lingering unmount operations | |
| 73 | - | sleep 1 | |
| 74 | - | } | |
| 75 | - | ||
| 76 | - | # ============================================================ | |
| 77 | - | # PHASE 2: CLOSE ENCRYPTION - Always safe to do | |
| 78 | - | # ============================================================ | |
| 79 | - | ||
| 80 | - | cleanup_encryption() { | |
| 81 | - | log_cleanup "Cleaning up LUKS/dm-crypt mappings..." | |
| 82 | - | ||
| 83 | - | # Close cryptroot specifically (Omarchy convention) | |
| 84 | - | if [ -e /dev/mapper/cryptroot ]; then | |
| 85 | - | log_cleanup "Closing LUKS container: cryptroot..." | |
| 86 | - | if cryptsetup close cryptroot 2>/dev/null; then | |
| 87 | - | log_success "Closed cryptroot" | |
| 88 | - | else | |
| 89 | - | log_error "Failed to close cryptroot" | |
| 90 | - | fi | |
| 91 | - | fi | |
| 92 | - | ||
| 93 | - | # Close ALL dm-crypt mappings (in case multiple exist) | |
| 94 | - | local crypt_mappings=$(dmsetup ls --target crypt 2>/dev/null | cut -f1) | |
| 95 | - | if [ -n "$crypt_mappings" ]; then | |
| 96 | - | while IFS= read -r mapping; do | |
| 97 | - | if [ -n "$mapping" ]; then | |
| 98 | - | log_cleanup "Closing dm-crypt mapping: $mapping..." | |
| 99 | - | if cryptsetup close "$mapping" 2>/dev/null; then | |
| 100 | - | log_success "Closed dm-crypt mapping: $mapping" | |
| 101 | - | else | |
| 102 | - | log_error "Failed to close $mapping" | |
| 103 | - | fi | |
| 104 | - | fi | |
| 105 | - | done <<< "$crypt_mappings" | |
| 106 | - | fi | |
| 107 | - | ||
| 108 | - | # Ensure all device mapper entries are removed | |
| 109 | - | if command -v dmsetup &>/dev/null; then | |
| 110 | - | if dmsetup table 2>/dev/null | grep -q crypt; then | |
| 111 | - | log_cleanup "Removing lingering device mapper entries..." | |
| 112 | - | dmsetup remove_all 2>/dev/null || true | |
| 113 | - | log_success "Device mapper cleanup attempted" | |
| 114 | - | fi | |
| 115 | - | fi | |
| 116 | - | } | |
| 117 | - | ||
| 118 | - | # ============================================================ | |
| 119 | - | # PHASE 3: DISABLE SWAP - Always safe to do | |
| 120 | - | # ============================================================ | |
| 121 | - | ||
| 122 | - | cleanup_swap() { | |
| 123 | - | log_cleanup "Disabling swap..." | |
| 124 | - | ||
| 125 | - | if swapon --show 2>/dev/null | grep -q .; then | |
| 126 | - | log_cleanup "Found active swap, disabling..." | |
| 127 | - | if swapoff -a 2>/dev/null; then | |
| 128 | - | log_success "Swap disabled" | |
| 129 | - | else | |
| 130 | - | log_error "Failed to disable swap (non-critical)" | |
| 131 | - | fi | |
| 132 | - | fi | |
| 133 | - | } | |
| 134 | - | ||
| 135 | - | # ============================================================ | |
| 136 | - | # PHASE 4: KILL STUCK PROCESSES - Always safe to do | |
| 137 | - | # ============================================================ | |
| 138 | - | ||
| 139 | - | cleanup_processes() { | |
| 140 | - | log_cleanup "Checking for stuck pacstrap/chroot processes..." | |
| 141 | - | ||
| 142 | - | # Kill any stuck pacstrap or arch-chroot processes | |
| 143 | - | # Note: pgrep returns 1 if no processes found, which is expected/normal | |
| 144 | - | local stuck_pids=$(pgrep -f "pacstrap|arch-chroot" 2>/dev/null || true) | |
| 145 | - | if [ -n "$stuck_pids" ]; then | |
| 146 | - | log_cleanup "Killing stuck processes: $stuck_pids" | |
| 147 | - | kill $stuck_pids 2>/dev/null || true | |
| 148 | - | sleep 1 | |
| 149 | - | kill -9 $stuck_pids 2>/dev/null || true | |
| 150 | - | log_success "Cleaned up stuck processes" | |
| 151 | - | fi | |
| 152 | - | } | |
| 153 | - | ||
| 154 | - | # ============================================================ | |
| 155 | - | # PHASE 5: REMOVE CONFIG FILE - Always safe to do | |
| 156 | - | # ============================================================ | |
| 157 | - | ||
| 158 | - | cleanup_config() { | |
| 159 | - | log_cleanup "Removing installation config file..." | |
| 160 | - | ||
| 161 | - | if [ -f "$ARCHUP_INSTALL_CONFIG" ]; then | |
| 162 | - | rm -f "$ARCHUP_INSTALL_CONFIG" | |
| 163 | - | log_success "Config file removed" | |
| 164 | - | fi | |
| 165 | - | } | |
| 166 | - | ||
| 167 | - | # ============================================================ | |
| 168 | - | # PHASE 6: FILESYSTEM SYNC - Always safe to do | |
| 169 | - | # ============================================================ | |
| 170 | - | ||
| 171 | - | cleanup_sync() { | |
| 172 | - | log_cleanup "Syncing filesystems..." | |
| 173 | - | ||
| 174 | - | if sync 2>/dev/null; then | |
| 175 | - | log_success "Filesystems synced" | |
| 176 | - | else | |
| 177 | - | log_error "Failed to sync filesystems (non-critical)" | |
| 178 | - | fi | |
| 179 | - | } | |
| 180 | - | ||
| 181 | - | # ============================================================ | |
| 182 | - | # OPTIONAL: FULL CLEANUP - Wipe /mnt (use --full flag) | |
| 183 | - | # ============================================================ | |
| 184 | - | ||
| 185 | - | cleanup_full() { | |
| 186 | - | log_cleanup "Performing FULL cleanup - deleting /mnt content..." | |
| 187 | - | ||
| 188 | - | if [ -d /mnt ]; then | |
| 189 | - | log_cleanup "Removing all files and directories in /mnt..." | |
| 190 | - | # Safety check: only remove if /mnt exists and is not empty | |
| 191 | - | if [ -d "/mnt" ] && [ "$(ls -A /mnt 2>/dev/null)" ]; then | |
| 192 | - | if rm -rf /mnt/./* /mnt/..?* /mnt/.[!.]* 2>/dev/null; then | |
| 193 | - | log_success "Removed /mnt content" | |
| 194 | - | else | |
| 195 | - | # Try alternate approach | |
| 196 | - | log_cleanup "Retry: Using find to remove /mnt content..." | |
| 197 | - | find /mnt -mindepth 1 -delete 2>/dev/null || true | |
| 198 | - | log_success "Removed /mnt content (with find)" | |
| 199 | - | fi | |
| 200 | - | fi | |
| 201 | - | fi | |
| 202 | - | ||
| 203 | - | # Ensure /mnt directory exists for next installation | |
| 204 | - | mkdir -p /mnt 2>/dev/null || true | |
| 205 | - | log_success "Prepared /mnt for fresh installation" | |
| 206 | - | } | |
| 207 | - | ||
| 208 | - | # ============================================================ | |
| 209 | - | # OPTIONAL: UEFI BOOT ENTRY CLEANUP (advanced/manual only) | |
| 210 | - | # ============================================================ | |
| 211 | - | ||
| 212 | - | cleanup_uefi_entries() { | |
| 213 | - | log_cleanup "Listing existing UEFI boot entries..." | |
| 214 | - | echo | |
| 215 | - | echo "Current UEFI boot entries:" | |
| 216 | - | efibootmgr 2>/dev/null || log_error "efibootmgr not available" | |
| 217 | - | echo | |
| 218 | - | echo "To remove archup entries, run:" | |
| 219 | - | echo " efibootmgr -b XXXX -B (where XXXX is the entry number)" | |
| 220 | - | echo | |
| 221 | - | log_cleanup "UEFI cleanup requires manual intervention" | |
| 222 | - | } | |
| 223 | - | ||
| 224 | - | # ============================================================ | |
| 225 | - | # DIAGNOSTIC: Check current state | |
| 226 | - | # ============================================================ | |
| 227 | - | ||
| 228 | - | cleanup_diagnostic() { | |
| 229 | - | log_cleanup "=== SYSTEM STATE DIAGNOSTIC ===" | |
| 230 | - | ||
| 231 | - | echo "Mounted filesystems at /mnt:" | |
| 232 | - | mount | grep /mnt || echo " (none)" | |
| 233 | - | echo | |
| 234 | - | ||
| 235 | - | echo "Active dm-crypt mappings:" | |
| 236 | - | dmsetup ls --target crypt 2>/dev/null || echo " (none)" | |
| 237 | - | echo | |
| 238 | - | ||
| 239 | - | echo "Active swap:" | |
| 240 | - | swapon --show 2>/dev/null || echo " (none)" | |
| 241 | - | echo | |
| 242 | - | ||
| 243 | - | echo "Partitions:" | |
| 244 | - | lsblk 2>/dev/null | head -20 | |
| 245 | - | } | |
| 246 | - | ||
| 247 | - | # ============================================================ | |
| 248 | - | # MAIN EXECUTION | |
| 249 | - | # ============================================================ | |
| 250 | - | ||
| 251 | - | case "$CLEANUP_MODE" in | |
| 252 | - | default) | |
| 253 | - | log_cleanup "=== ArchUp Cleanup (DEFAULT) ===" | |
| 254 | - | cleanup_mounts | |
| 255 | - | cleanup_encryption | |
| 256 | - | cleanup_swap | |
| 257 | - | cleanup_processes | |
| 258 | - | cleanup_config | |
| 259 | - | cleanup_sync | |
| 260 | - | log_success "=== Default cleanup complete ===" | |
| 261 | - | ;; | |
| 262 | - | ||
| 263 | - | full) | |
| 264 | - | log_cleanup "=== ArchUp Cleanup (FULL - DESTRUCTIVE) ===" | |
| 265 | - | cleanup_mounts | |
| 266 | - | cleanup_encryption | |
| 267 | - | cleanup_swap | |
| 268 | - | cleanup_processes | |
| 269 | - | cleanup_full | |
| 270 | - | cleanup_config | |
| 271 | - | cleanup_sync | |
| 272 | - | log_success "=== Full cleanup complete ===" | |
| 273 | - | ;; | |
| 274 | - | ||
| 275 | - | uefi-cleanup) | |
| 276 | - | cleanup_uefi_entries | |
| 277 | - | ;; | |
| 278 | - | ||
| 279 | - | diagnostic) | |
| 280 | - | cleanup_diagnostic | |
| 281 | - | ;; | |
| 282 | - | ||
| 283 | - | *) | |
| 284 | - | echo "Usage: cleanup.sh [default|full|uefi-cleanup|diagnostic]" | |
| 285 | - | echo "" | |
| 286 | - | echo "Modes:" | |
| 287 | - | echo " default - Unmount, close LUKS, disable swap (safe, always done)" | |
| 288 | - | echo " full - Also delete /mnt content (destructive)" | |
| 289 | - | echo " uefi-cleanup - Show UEFI boot entries (manual cleanup)" | |
| 290 | - | echo " diagnostic - Show current system state" | |
| 291 | - | exit 1 | |
| 292 | - | ;; | |
| 293 | - | esac | |
| @@ -1,293 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # ArchUp Cleanup - Remove artifacts from failed installations | |||
| 3 | - | # This script is 100% idempotent and safe to call multiple times | |||
| 4 | - | # Called from bootstrap.sh on every install attempt | |||
| 5 | - | ||||
| 6 | - | # Cleanup modes: | |||
| 7 | - | # - default (called from bootstrap): Unmount, close LUKS, disable swap | |||
| 8 | - | # - full (optional): Also delete /mnt content, allow fresh pacstrap | |||
| 9 | - | # - efi-cleanup (optional): Remove UEFI boot entries (manual only) | |||
| 10 | - | ||||
| 11 | - | set +e # Continue even if commands fail | |||
| 12 | - | ||||
| 13 | - | CLEANUP_MODE="${1:-default}" | |||
| 14 | - | ||||
| 15 | - | # Color codes for output | |||
| 16 | - | RED='\033[0;31m' | |||
| 17 | - | GREEN='\033[0;32m' | |||
| 18 | - | NC='\033[0m' # No Color | |||
| 19 | - | ||||
| 20 | - | log_cleanup() { | |||
| 21 | - | echo "[CLEANUP] $1" | |||
| 22 | - | if [ -n "${ARCHUP_INSTALL_LOG_FILE:-}" ] && [ -f "$ARCHUP_INSTALL_LOG_FILE" ]; then | |||
| 23 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] [CLEANUP] $1" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 24 | - | fi | |||
| 25 | - | } | |||
| 26 | - | ||||
| 27 | - | log_success() { | |||
| 28 | - | echo -e "${GREEN}[CLEANUP OK]${NC} $1" | |||
| 29 | - | if [ -n "${ARCHUP_INSTALL_LOG_FILE:-}" ] && [ -f "$ARCHUP_INSTALL_LOG_FILE" ]; then | |||
| 30 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] [CLEANUP OK] $1" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 31 | - | fi | |||
| 32 | - | } | |||
| 33 | - | ||||
| 34 | - | log_error() { | |||
| 35 | - | echo -e "${RED}[CLEANUP ERROR]${NC} $1" | |||
| 36 | - | if [ -n "${ARCHUP_INSTALL_LOG_FILE:-}" ] && [ -f "$ARCHUP_INSTALL_LOG_FILE" ]; then | |||
| 37 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] [CLEANUP ERROR] $1" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 38 | - | fi | |||
| 39 | - | } | |||
| 40 | - | ||||
| 41 | - | # ============================================================ | |||
| 42 | - | # PHASE 1: SAFE UNMOUNTING - Always safe to do | |||
| 43 | - | # ============================================================ | |||
| 44 | - | ||||
| 45 | - | cleanup_mounts() { | |||
| 46 | - | log_cleanup "Cleaning up mounted filesystems..." | |||
| 47 | - | ||||
| 48 | - | # Unmount in reverse order (most specific first) | |||
| 49 | - | local mounts_to_clean=( | |||
| 50 | - | "/mnt/boot" | |||
| 51 | - | "/mnt/home" | |||
| 52 | - | "/mnt" | |||
| 53 | - | ) | |||
| 54 | - | ||||
| 55 | - | for mount_point in "${mounts_to_clean[@]}"; do | |||
| 56 | - | if mountpoint -q "$mount_point" 2>/dev/null; then | |||
| 57 | - | log_cleanup "Unmounting $mount_point..." | |||
| 58 | - | if umount -R "$mount_point" 2>/dev/null; then | |||
| 59 | - | log_success "Unmounted $mount_point" | |||
| 60 | - | else | |||
| 61 | - | # Force unmount if normal unmount fails | |||
| 62 | - | log_cleanup "Force unmounting $mount_point..." | |||
| 63 | - | if umount -R -l "$mount_point" 2>/dev/null; then | |||
| 64 | - | log_success "Force unmounted $mount_point" | |||
| 65 | - | else | |||
| 66 | - | log_error "Failed to unmount $mount_point (may retry later)" | |||
| 67 | - | fi | |||
| 68 | - | fi | |||
| 69 | - | fi | |||
| 70 | - | done | |||
| 71 | - | ||||
| 72 | - | # Wait for any lingering unmount operations | |||
| 73 | - | sleep 1 | |||
| 74 | - | } | |||
| 75 | - | ||||
| 76 | - | # ============================================================ | |||
| 77 | - | # PHASE 2: CLOSE ENCRYPTION - Always safe to do | |||
| 78 | - | # ============================================================ | |||
| 79 | - | ||||
| 80 | - | cleanup_encryption() { | |||
| 81 | - | log_cleanup "Cleaning up LUKS/dm-crypt mappings..." | |||
| 82 | - | ||||
| 83 | - | # Close cryptroot specifically (Omarchy convention) | |||
| 84 | - | if [ -e /dev/mapper/cryptroot ]; then | |||
| 85 | - | log_cleanup "Closing LUKS container: cryptroot..." | |||
| 86 | - | if cryptsetup close cryptroot 2>/dev/null; then | |||
| 87 | - | log_success "Closed cryptroot" | |||
| 88 | - | else | |||
| 89 | - | log_error "Failed to close cryptroot" | |||
| 90 | - | fi | |||
| 91 | - | fi | |||
| 92 | - | ||||
| 93 | - | # Close ALL dm-crypt mappings (in case multiple exist) | |||
| 94 | - | local crypt_mappings=$(dmsetup ls --target crypt 2>/dev/null | cut -f1) | |||
| 95 | - | if [ -n "$crypt_mappings" ]; then | |||
| 96 | - | while IFS= read -r mapping; do | |||
| 97 | - | if [ -n "$mapping" ]; then | |||
| 98 | - | log_cleanup "Closing dm-crypt mapping: $mapping..." | |||
| 99 | - | if cryptsetup close "$mapping" 2>/dev/null; then | |||
| 100 | - | log_success "Closed dm-crypt mapping: $mapping" | |||
| 101 | - | else | |||
| 102 | - | log_error "Failed to close $mapping" | |||
| 103 | - | fi | |||
| 104 | - | fi | |||
| 105 | - | done <<< "$crypt_mappings" | |||
| 106 | - | fi | |||
| 107 | - | ||||
| 108 | - | # Ensure all device mapper entries are removed | |||
| 109 | - | if command -v dmsetup &>/dev/null; then | |||
| 110 | - | if dmsetup table 2>/dev/null | grep -q crypt; then | |||
| 111 | - | log_cleanup "Removing lingering device mapper entries..." | |||
| 112 | - | dmsetup remove_all 2>/dev/null || true | |||
| 113 | - | log_success "Device mapper cleanup attempted" | |||
| 114 | - | fi | |||
| 115 | - | fi | |||
| 116 | - | } | |||
| 117 | - | ||||
| 118 | - | # ============================================================ | |||
| 119 | - | # PHASE 3: DISABLE SWAP - Always safe to do | |||
| 120 | - | # ============================================================ | |||
| 121 | - | ||||
| 122 | - | cleanup_swap() { | |||
| 123 | - | log_cleanup "Disabling swap..." | |||
| 124 | - | ||||
| 125 | - | if swapon --show 2>/dev/null | grep -q .; then | |||
| 126 | - | log_cleanup "Found active swap, disabling..." | |||
| 127 | - | if swapoff -a 2>/dev/null; then | |||
| 128 | - | log_success "Swap disabled" | |||
| 129 | - | else | |||
| 130 | - | log_error "Failed to disable swap (non-critical)" | |||
| 131 | - | fi | |||
| 132 | - | fi | |||
| 133 | - | } | |||
| 134 | - | ||||
| 135 | - | # ============================================================ | |||
| 136 | - | # PHASE 4: KILL STUCK PROCESSES - Always safe to do | |||
| 137 | - | # ============================================================ | |||
| 138 | - | ||||
| 139 | - | cleanup_processes() { | |||
| 140 | - | log_cleanup "Checking for stuck pacstrap/chroot processes..." | |||
| 141 | - | ||||
| 142 | - | # Kill any stuck pacstrap or arch-chroot processes | |||
| 143 | - | # Note: pgrep returns 1 if no processes found, which is expected/normal | |||
| 144 | - | local stuck_pids=$(pgrep -f "pacstrap|arch-chroot" 2>/dev/null || true) | |||
| 145 | - | if [ -n "$stuck_pids" ]; then | |||
| 146 | - | log_cleanup "Killing stuck processes: $stuck_pids" | |||
| 147 | - | kill $stuck_pids 2>/dev/null || true | |||
| 148 | - | sleep 1 | |||
| 149 | - | kill -9 $stuck_pids 2>/dev/null || true | |||
| 150 | - | log_success "Cleaned up stuck processes" | |||
| 151 | - | fi | |||
| 152 | - | } | |||
| 153 | - | ||||
| 154 | - | # ============================================================ | |||
| 155 | - | # PHASE 5: REMOVE CONFIG FILE - Always safe to do | |||
| 156 | - | # ============================================================ | |||
| 157 | - | ||||
| 158 | - | cleanup_config() { | |||
| 159 | - | log_cleanup "Removing installation config file..." | |||
| 160 | - | ||||
| 161 | - | if [ -f "$ARCHUP_INSTALL_CONFIG" ]; then | |||
| 162 | - | rm -f "$ARCHUP_INSTALL_CONFIG" | |||
| 163 | - | log_success "Config file removed" | |||
| 164 | - | fi | |||
| 165 | - | } | |||
| 166 | - | ||||
| 167 | - | # ============================================================ | |||
| 168 | - | # PHASE 6: FILESYSTEM SYNC - Always safe to do | |||
| 169 | - | # ============================================================ | |||
| 170 | - | ||||
| 171 | - | cleanup_sync() { | |||
| 172 | - | log_cleanup "Syncing filesystems..." | |||
| 173 | - | ||||
| 174 | - | if sync 2>/dev/null; then | |||
| 175 | - | log_success "Filesystems synced" | |||
| 176 | - | else | |||
| 177 | - | log_error "Failed to sync filesystems (non-critical)" | |||
| 178 | - | fi | |||
| 179 | - | } | |||
| 180 | - | ||||
| 181 | - | # ============================================================ | |||
| 182 | - | # OPTIONAL: FULL CLEANUP - Wipe /mnt (use --full flag) | |||
| 183 | - | # ============================================================ | |||
| 184 | - | ||||
| 185 | - | cleanup_full() { | |||
| 186 | - | log_cleanup "Performing FULL cleanup - deleting /mnt content..." | |||
| 187 | - | ||||
| 188 | - | if [ -d /mnt ]; then | |||
| 189 | - | log_cleanup "Removing all files and directories in /mnt..." | |||
| 190 | - | # Safety check: only remove if /mnt exists and is not empty | |||
| 191 | - | if [ -d "/mnt" ] && [ "$(ls -A /mnt 2>/dev/null)" ]; then | |||
| 192 | - | if rm -rf /mnt/./* /mnt/..?* /mnt/.[!.]* 2>/dev/null; then | |||
| 193 | - | log_success "Removed /mnt content" | |||
| 194 | - | else | |||
| 195 | - | # Try alternate approach | |||
| 196 | - | log_cleanup "Retry: Using find to remove /mnt content..." | |||
| 197 | - | find /mnt -mindepth 1 -delete 2>/dev/null || true | |||
| 198 | - | log_success "Removed /mnt content (with find)" | |||
| 199 | - | fi | |||
| 200 | - | fi | |||
| 201 | - | fi | |||
| 202 | - | ||||
| 203 | - | # Ensure /mnt directory exists for next installation | |||
| 204 | - | mkdir -p /mnt 2>/dev/null || true | |||
| 205 | - | log_success "Prepared /mnt for fresh installation" | |||
| 206 | - | } | |||
| 207 | - | ||||
| 208 | - | # ============================================================ | |||
| 209 | - | # OPTIONAL: UEFI BOOT ENTRY CLEANUP (advanced/manual only) | |||
| 210 | - | # ============================================================ | |||
| 211 | - | ||||
| 212 | - | cleanup_uefi_entries() { | |||
| 213 | - | log_cleanup "Listing existing UEFI boot entries..." | |||
| 214 | - | echo | |||
| 215 | - | echo "Current UEFI boot entries:" | |||
| 216 | - | efibootmgr 2>/dev/null || log_error "efibootmgr not available" | |||
| 217 | - | echo | |||
| 218 | - | echo "To remove archup entries, run:" | |||
| 219 | - | echo " efibootmgr -b XXXX -B (where XXXX is the entry number)" | |||
| 220 | - | echo | |||
| 221 | - | log_cleanup "UEFI cleanup requires manual intervention" | |||
| 222 | - | } | |||
| 223 | - | ||||
| 224 | - | # ============================================================ | |||
| 225 | - | # DIAGNOSTIC: Check current state | |||
| 226 | - | # ============================================================ | |||
| 227 | - | ||||
| 228 | - | cleanup_diagnostic() { | |||
| 229 | - | log_cleanup "=== SYSTEM STATE DIAGNOSTIC ===" | |||
| 230 | - | ||||
| 231 | - | echo "Mounted filesystems at /mnt:" | |||
| 232 | - | mount | grep /mnt || echo " (none)" | |||
| 233 | - | echo | |||
| 234 | - | ||||
| 235 | - | echo "Active dm-crypt mappings:" | |||
| 236 | - | dmsetup ls --target crypt 2>/dev/null || echo " (none)" | |||
| 237 | - | echo | |||
| 238 | - | ||||
| 239 | - | echo "Active swap:" | |||
| 240 | - | swapon --show 2>/dev/null || echo " (none)" | |||
| 241 | - | echo | |||
| 242 | - | ||||
| 243 | - | echo "Partitions:" | |||
| 244 | - | lsblk 2>/dev/null | head -20 | |||
| 245 | - | } | |||
| 246 | - | ||||
| 247 | - | # ============================================================ | |||
| 248 | - | # MAIN EXECUTION | |||
| 249 | - | # ============================================================ | |||
| 250 | - | ||||
| 251 | - | case "$CLEANUP_MODE" in | |||
| 252 | - | default) | |||
| 253 | - | log_cleanup "=== ArchUp Cleanup (DEFAULT) ===" | |||
| 254 | - | cleanup_mounts | |||
| 255 | - | cleanup_encryption | |||
| 256 | - | cleanup_swap | |||
| 257 | - | cleanup_processes | |||
| 258 | - | cleanup_config | |||
| 259 | - | cleanup_sync | |||
| 260 | - | log_success "=== Default cleanup complete ===" | |||
| 261 | - | ;; | |||
| 262 | - | ||||
| 263 | - | full) | |||
| 264 | - | log_cleanup "=== ArchUp Cleanup (FULL - DESTRUCTIVE) ===" | |||
| 265 | - | cleanup_mounts | |||
| 266 | - | cleanup_encryption | |||
| 267 | - | cleanup_swap | |||
| 268 | - | cleanup_processes | |||
| 269 | - | cleanup_full | |||
| 270 | - | cleanup_config | |||
| 271 | - | cleanup_sync | |||
| 272 | - | log_success "=== Full cleanup complete ===" | |||
| 273 | - | ;; | |||
| 274 | - | ||||
| 275 | - | uefi-cleanup) | |||
| 276 | - | cleanup_uefi_entries | |||
| 277 | - | ;; | |||
| 278 | - | ||||
| 279 | - | diagnostic) | |||
| 280 | - | cleanup_diagnostic | |||
| 281 | - | ;; | |||
| 282 | - | ||||
| 283 | - | *) | |||
| 284 | - | echo "Usage: cleanup.sh [default|full|uefi-cleanup|diagnostic]" | |||
| 285 | - | echo "" | |||
| 286 | - | echo "Modes:" | |||
| 287 | - | echo " default - Unmount, close LUKS, disable swap (safe, always done)" | |||
| 288 | - | echo " full - Also delete /mnt content (destructive)" | |||
| 289 | - | echo " uefi-cleanup - Show UEFI boot entries (manual cleanup)" | |||
| 290 | - | echo " diagnostic - Show current system state" | |||
| 291 | - | exit 1 | |||
| 292 | - | ;; | |||
| 293 | - | esac | |||
D install/deprecated/helpers/config.sh +0 -63
| @@ -1,63 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # ArchUp Configuration Manager - .env-based config system | |
| 3 | - | # Stores preflight settings in KEY=VALUE format for reliable access across scripts | |
| 4 | - | ||
| 5 | - | # Initialize empty config file if it doesn't exist | |
| 6 | - | init_config() { | |
| 7 | - | if [ ! -f "$ARCHUP_INSTALL_CONFIG" ]; then | |
| 8 | - | touch "$ARCHUP_INSTALL_CONFIG" | |
| 9 | - | chmod 600 "$ARCHUP_INSTALL_CONFIG" | |
| 10 | - | fi | |
| 11 | - | # Ensure permissions are restricted (owner read/write only) | |
| 12 | - | chmod 600 "$ARCHUP_INSTALL_CONFIG" 2>/dev/null || true | |
| 13 | - | } | |
| 14 | - | ||
| 15 | - | # Write a value to config | |
| 16 | - | # Usage: config_set "ARCHUP_USERNAME" "brice" | |
| 17 | - | config_set() { | |
| 18 | - | local key="$1" | |
| 19 | - | local value="$2" | |
| 20 | - | ||
| 21 | - | init_config | |
| 22 | - | ||
| 23 | - | # Remove existing key if present, then append new value | |
| 24 | - | sed -i "/^${key}=/d" "$ARCHUP_INSTALL_CONFIG" | |
| 25 | - | echo "${key}=${value}" >> "$ARCHUP_INSTALL_CONFIG" | |
| 26 | - | } | |
| 27 | - | ||
| 28 | - | # Read a value from config | |
| 29 | - | # Usage: config_get "ARCHUP_USERNAME" | |
| 30 | - | config_get() { | |
| 31 | - | local key="$1" | |
| 32 | - | ||
| 33 | - | init_config | |
| 34 | - | ||
| 35 | - | grep "^${key}=" "$ARCHUP_INSTALL_CONFIG" | cut -d'=' -f2- || echo "" | |
| 36 | - | } | |
| 37 | - | ||
| 38 | - | # Source entire config file into current shell | |
| 39 | - | # Usage: config_source | |
| 40 | - | config_source() { | |
| 41 | - | init_config | |
| 42 | - | ||
| 43 | - | if [ -f "$ARCHUP_INSTALL_CONFIG" ]; then | |
| 44 | - | # Source the file but handle values with spaces/special chars | |
| 45 | - | set -a | |
| 46 | - | source "$ARCHUP_INSTALL_CONFIG" | |
| 47 | - | set +a | |
| 48 | - | fi | |
| 49 | - | } | |
| 50 | - | ||
| 51 | - | # Display config (for debugging) | |
| 52 | - | config_show() { | |
| 53 | - | init_config | |
| 54 | - | if [ -f "$ARCHUP_INSTALL_CONFIG" ]; then | |
| 55 | - | cat "$ARCHUP_INSTALL_CONFIG" | |
| 56 | - | fi | |
| 57 | - | } | |
| 58 | - | ||
| 59 | - | # Clear config | |
| 60 | - | config_clear() { | |
| 61 | - | rm -f "$ARCHUP_INSTALL_CONFIG" | |
| 62 | - | init_config | |
| 63 | - | } | |
| @@ -1,63 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # ArchUp Configuration Manager - .env-based config system | |||
| 3 | - | # Stores preflight settings in KEY=VALUE format for reliable access across scripts | |||
| 4 | - | ||||
| 5 | - | # Initialize empty config file if it doesn't exist | |||
| 6 | - | init_config() { | |||
| 7 | - | if [ ! -f "$ARCHUP_INSTALL_CONFIG" ]; then | |||
| 8 | - | touch "$ARCHUP_INSTALL_CONFIG" | |||
| 9 | - | chmod 600 "$ARCHUP_INSTALL_CONFIG" | |||
| 10 | - | fi | |||
| 11 | - | # Ensure permissions are restricted (owner read/write only) | |||
| 12 | - | chmod 600 "$ARCHUP_INSTALL_CONFIG" 2>/dev/null || true | |||
| 13 | - | } | |||
| 14 | - | ||||
| 15 | - | # Write a value to config | |||
| 16 | - | # Usage: config_set "ARCHUP_USERNAME" "brice" | |||
| 17 | - | config_set() { | |||
| 18 | - | local key="$1" | |||
| 19 | - | local value="$2" | |||
| 20 | - | ||||
| 21 | - | init_config | |||
| 22 | - | ||||
| 23 | - | # Remove existing key if present, then append new value | |||
| 24 | - | sed -i "/^${key}=/d" "$ARCHUP_INSTALL_CONFIG" | |||
| 25 | - | echo "${key}=${value}" >> "$ARCHUP_INSTALL_CONFIG" | |||
| 26 | - | } | |||
| 27 | - | ||||
| 28 | - | # Read a value from config | |||
| 29 | - | # Usage: config_get "ARCHUP_USERNAME" | |||
| 30 | - | config_get() { | |||
| 31 | - | local key="$1" | |||
| 32 | - | ||||
| 33 | - | init_config | |||
| 34 | - | ||||
| 35 | - | grep "^${key}=" "$ARCHUP_INSTALL_CONFIG" | cut -d'=' -f2- || echo "" | |||
| 36 | - | } | |||
| 37 | - | ||||
| 38 | - | # Source entire config file into current shell | |||
| 39 | - | # Usage: config_source | |||
| 40 | - | config_source() { | |||
| 41 | - | init_config | |||
| 42 | - | ||||
| 43 | - | if [ -f "$ARCHUP_INSTALL_CONFIG" ]; then | |||
| 44 | - | # Source the file but handle values with spaces/special chars | |||
| 45 | - | set -a | |||
| 46 | - | source "$ARCHUP_INSTALL_CONFIG" | |||
| 47 | - | set +a | |||
| 48 | - | fi | |||
| 49 | - | } | |||
| 50 | - | ||||
| 51 | - | # Display config (for debugging) | |||
| 52 | - | config_show() { | |||
| 53 | - | init_config | |||
| 54 | - | if [ -f "$ARCHUP_INSTALL_CONFIG" ]; then | |||
| 55 | - | cat "$ARCHUP_INSTALL_CONFIG" | |||
| 56 | - | fi | |||
| 57 | - | } | |||
| 58 | - | ||||
| 59 | - | # Clear config | |||
| 60 | - | config_clear() { | |||
| 61 | - | rm -f "$ARCHUP_INSTALL_CONFIG" | |||
| 62 | - | init_config | |||
| 63 | - | } | |||
D install/deprecated/helpers/download.sh +0 -75
| @@ -1,75 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Download all required ArchUp installation files from GitHub | |
| 3 | - | ||
| 4 | - | download_section() { | |
| 5 | - | local title="$1" | |
| 6 | - | local target_dir="$2" | |
| 7 | - | shift 2 | |
| 8 | - | local files=("$@") | |
| 9 | - | ||
| 10 | - | for file in "${files[@]}"; do | |
| 11 | - | curl -sL "$GITHUB_RAW/install/$target_dir/$file" -o "$ARCHUP_INSTALL/$target_dir/$file" 2>/dev/null | |
| 12 | - | done | |
| 13 | - | gum style --foreground 2 "[OK] ${title/Downloading /Downloaded }" | |
| 14 | - | } | |
| 15 | - | ||
| 16 | - | download_archup_files() { | |
| 17 | - | echo "" | |
| 18 | - | gum style --foreground 212 --bold "ArchUp Installer Download" | |
| 19 | - | echo "" | |
| 20 | - | ||
| 21 | - | local GITHUB_RAW="$ARCHUP_RAW_URL" | |
| 22 | - | ||
| 23 | - | # Create directory structure | |
| 24 | - | mkdir -p "$ARCHUP_INSTALL"/{helpers,preflight,partitioning,base,config,boot,repos,post-install,post-boot} | |
| 25 | - | ||
| 26 | - | # Core files | |
| 27 | - | curl -sL "$GITHUB_RAW/install/bootstrap.sh" -o "$ARCHUP_INSTALL/bootstrap.sh" 2>/dev/null | |
| 28 | - | curl -sL "$GITHUB_RAW/logo.txt" -o "$ARCHUP_PATH/logo.txt" 2>/dev/null | |
| 29 | - | gum style --foreground 2 "[OK] Core files downloaded" | |
| 30 | - | ||
| 31 | - | # Helpers | |
| 32 | - | download_section "Downloading helpers..." "helpers" \ | |
| 33 | - | all.sh config.sh logging.sh errors.sh presentation.sh chroot.sh cleanup.sh multilib.sh | |
| 34 | - | ||
| 35 | - | # Preflight | |
| 36 | - | download_section "Downloading preflight checks..." "preflight" \ | |
| 37 | - | all.sh guards.sh begin.sh identify.sh detect-environment.sh | |
| 38 | - | ||
| 39 | - | # Partitioning | |
| 40 | - | download_section "Downloading partitioning scripts..." "partitioning" \ | |
| 41 | - | all.sh detect-disk.sh partition.sh format.sh mount.sh | |
| 42 | - | ||
| 43 | - | # Base system | |
| 44 | - | download_section "Downloading base system scripts..." "base" \ | |
| 45 | - | all.sh kernel.sh enable-multilib.sh cachyos-repo.sh pacman.sh pacstrap.sh fstab.sh | |
| 46 | - | ||
| 47 | - | # Configuration | |
| 48 | - | download_section "Downloading config scripts..." "config" \ | |
| 49 | - | all.sh system.sh user.sh network.sh zram.sh | |
| 50 | - | ||
| 51 | - | # Bootloader | |
| 52 | - | download_section "Downloading bootloader setup..." "boot" \ | |
| 53 | - | all.sh limine.sh | |
| 54 | - | ||
| 55 | - | # Repositories | |
| 56 | - | download_section "Downloading repository setup..." "repos" \ | |
| 57 | - | all.sh multilib.sh aur.sh chaotic.sh | |
| 58 | - | ||
| 59 | - | # Post-install | |
| 60 | - | download_section "Downloading post-install scripts..." "post-install" \ | |
| 61 | - | all.sh boot-logo.sh plymouth.sh snapper.sh pacman.sh post-boot-setup.sh hooks.sh shell-config.sh verify.sh unmount.sh | |
| 62 | - | ||
| 63 | - | # Post-boot | |
| 64 | - | download_section "Downloading post-boot scripts..." "post-boot" \ | |
| 65 | - | all.sh snapper.sh ufw.sh ssh-keygen.sh archup-cli.sh blesh.sh archup-first-boot.service | |
| 66 | - | ||
| 67 | - | # Package lists | |
| 68 | - | curl -sL "$GITHUB_RAW/install/base.packages" -o "$ARCHUP_INSTALL/base.packages" 2>/dev/null | |
| 69 | - | curl -sL "$GITHUB_RAW/install/extra.packages" -o "$ARCHUP_INSTALL/extra.packages" 2>/dev/null | |
| 70 | - | gum style --foreground 2 "[OK] Package lists downloaded" | |
| 71 | - | ||
| 72 | - | echo "" | |
| 73 | - | gum style --foreground 2 --bold "[OK] All files downloaded successfully" | |
| 74 | - | echo "" | |
| 75 | - | } | |
| @@ -1,75 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Download all required ArchUp installation files from GitHub | |||
| 3 | - | ||||
| 4 | - | download_section() { | |||
| 5 | - | local title="$1" | |||
| 6 | - | local target_dir="$2" | |||
| 7 | - | shift 2 | |||
| 8 | - | local files=("$@") | |||
| 9 | - | ||||
| 10 | - | for file in "${files[@]}"; do | |||
| 11 | - | curl -sL "$GITHUB_RAW/install/$target_dir/$file" -o "$ARCHUP_INSTALL/$target_dir/$file" 2>/dev/null | |||
| 12 | - | done | |||
| 13 | - | gum style --foreground 2 "[OK] ${title/Downloading /Downloaded }" | |||
| 14 | - | } | |||
| 15 | - | ||||
| 16 | - | download_archup_files() { | |||
| 17 | - | echo "" | |||
| 18 | - | gum style --foreground 212 --bold "ArchUp Installer Download" | |||
| 19 | - | echo "" | |||
| 20 | - | ||||
| 21 | - | local GITHUB_RAW="$ARCHUP_RAW_URL" | |||
| 22 | - | ||||
| 23 | - | # Create directory structure | |||
| 24 | - | mkdir -p "$ARCHUP_INSTALL"/{helpers,preflight,partitioning,base,config,boot,repos,post-install,post-boot} | |||
| 25 | - | ||||
| 26 | - | # Core files | |||
| 27 | - | curl -sL "$GITHUB_RAW/install/bootstrap.sh" -o "$ARCHUP_INSTALL/bootstrap.sh" 2>/dev/null | |||
| 28 | - | curl -sL "$GITHUB_RAW/logo.txt" -o "$ARCHUP_PATH/logo.txt" 2>/dev/null | |||
| 29 | - | gum style --foreground 2 "[OK] Core files downloaded" | |||
| 30 | - | ||||
| 31 | - | # Helpers | |||
| 32 | - | download_section "Downloading helpers..." "helpers" \ | |||
| 33 | - | all.sh config.sh logging.sh errors.sh presentation.sh chroot.sh cleanup.sh multilib.sh | |||
| 34 | - | ||||
| 35 | - | # Preflight | |||
| 36 | - | download_section "Downloading preflight checks..." "preflight" \ | |||
| 37 | - | all.sh guards.sh begin.sh identify.sh detect-environment.sh | |||
| 38 | - | ||||
| 39 | - | # Partitioning | |||
| 40 | - | download_section "Downloading partitioning scripts..." "partitioning" \ | |||
| 41 | - | all.sh detect-disk.sh partition.sh format.sh mount.sh | |||
| 42 | - | ||||
| 43 | - | # Base system | |||
| 44 | - | download_section "Downloading base system scripts..." "base" \ | |||
| 45 | - | all.sh kernel.sh enable-multilib.sh cachyos-repo.sh pacman.sh pacstrap.sh fstab.sh | |||
| 46 | - | ||||
| 47 | - | # Configuration | |||
| 48 | - | download_section "Downloading config scripts..." "config" \ | |||
| 49 | - | all.sh system.sh user.sh network.sh zram.sh | |||
| 50 | - | ||||
| 51 | - | # Bootloader | |||
| 52 | - | download_section "Downloading bootloader setup..." "boot" \ | |||
| 53 | - | all.sh limine.sh | |||
| 54 | - | ||||
| 55 | - | # Repositories | |||
| 56 | - | download_section "Downloading repository setup..." "repos" \ | |||
| 57 | - | all.sh multilib.sh aur.sh chaotic.sh | |||
| 58 | - | ||||
| 59 | - | # Post-install | |||
| 60 | - | download_section "Downloading post-install scripts..." "post-install" \ | |||
| 61 | - | all.sh boot-logo.sh plymouth.sh snapper.sh pacman.sh post-boot-setup.sh hooks.sh shell-config.sh verify.sh unmount.sh | |||
| 62 | - | ||||
| 63 | - | # Post-boot | |||
| 64 | - | download_section "Downloading post-boot scripts..." "post-boot" \ | |||
| 65 | - | all.sh snapper.sh ufw.sh ssh-keygen.sh archup-cli.sh blesh.sh archup-first-boot.service | |||
| 66 | - | ||||
| 67 | - | # Package lists | |||
| 68 | - | curl -sL "$GITHUB_RAW/install/base.packages" -o "$ARCHUP_INSTALL/base.packages" 2>/dev/null | |||
| 69 | - | curl -sL "$GITHUB_RAW/install/extra.packages" -o "$ARCHUP_INSTALL/extra.packages" 2>/dev/null | |||
| 70 | - | gum style --foreground 2 "[OK] Package lists downloaded" | |||
| 71 | - | ||||
| 72 | - | echo "" | |||
| 73 | - | gum style --foreground 2 --bold "[OK] All files downloaded successfully" | |||
| 74 | - | echo "" | |||
| 75 | - | } | |||
D install/deprecated/helpers/errors.sh +0 -186
| @@ -1,186 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Error handling for ArchUp installer - improved with logging and interactivity | |
| 3 | - | ||
| 4 | - | # Track error handling state | |
| 5 | - | ERROR_HANDLING=false | |
| 6 | - | ||
| 7 | - | # Show cursor | |
| 8 | - | show_cursor() { | |
| 9 | - | printf "\033[?25h" | |
| 10 | - | } | |
| 11 | - | ||
| 12 | - | # Hide cursor | |
| 13 | - | hide_cursor() { | |
| 14 | - | printf "\033[?25l" | |
| 15 | - | } | |
| 16 | - | ||
| 17 | - | # Display truncated log lines | |
| 18 | - | show_log_tail() { | |
| 19 | - | if [[ -f $ARCHUP_INSTALL_LOG_FILE ]]; then | |
| 20 | - | local log_lines=$((TERM_HEIGHT - LOGO_HEIGHT - 35)) | |
| 21 | - | local max_line_width=$((LOGO_WIDTH - 4)) | |
| 22 | - | ||
| 23 | - | echo | |
| 24 | - | gum style --foreground 3 "Recent log entries:" | |
| 25 | - | echo | |
| 26 | - | ||
| 27 | - | tail -n $log_lines "$ARCHUP_INSTALL_LOG_FILE" 2>/dev/null | while IFS= read -r line; do | |
| 28 | - | if ((${#line} > max_line_width)); then | |
| 29 | - | local truncated_line="${line:0:$max_line_width}..." | |
| 30 | - | else | |
| 31 | - | local truncated_line="$line" | |
| 32 | - | fi | |
| 33 | - | ||
| 34 | - | gum style "$truncated_line" | |
| 35 | - | done | |
| 36 | - | ||
| 37 | - | echo | |
| 38 | - | fi | |
| 39 | - | } | |
| 40 | - | ||
| 41 | - | # Display failed script or command | |
| 42 | - | show_failed_script_or_command() { | |
| 43 | - | if [[ -n ${CURRENT_SCRIPT:-} ]]; then | |
| 44 | - | gum style "Failed script: $CURRENT_SCRIPT" | |
| 45 | - | else | |
| 46 | - | local cmd="$BASH_COMMAND" | |
| 47 | - | local max_cmd_width=$((LOGO_WIDTH - 4)) | |
| 48 | - | ||
| 49 | - | if ((${#cmd} > max_cmd_width)); then | |
| 50 | - | cmd="${cmd:0:$max_cmd_width}..." | |
| 51 | - | fi | |
| 52 | - | ||
| 53 | - | gum style "Command: $cmd" | |
| 54 | - | fi | |
| 55 | - | } | |
| 56 | - | ||
| 57 | - | # Save original file descriptors | |
| 58 | - | save_original_outputs() { | |
| 59 | - | exec 3>&1 4>&2 | |
| 60 | - | } | |
| 61 | - | ||
| 62 | - | # Restore original file descriptors | |
| 63 | - | restore_outputs() { | |
| 64 | - | if [ -e /proc/self/fd/3 ] && [ -e /proc/self/fd/4 ]; then | |
| 65 | - | exec 1>&3 2>&4 | |
| 66 | - | fi | |
| 67 | - | } | |
| 68 | - | ||
| 69 | - | # Main error handler | |
| 70 | - | catch_errors() { | |
| 71 | - | # Prevent recursive error handling | |
| 72 | - | if [[ $ERROR_HANDLING == true ]]; then | |
| 73 | - | return | |
| 74 | - | else | |
| 75 | - | ERROR_HANDLING=true | |
| 76 | - | fi | |
| 77 | - | ||
| 78 | - | # Store exit code immediately (BEFORE any other commands!) | |
| 79 | - | local exit_code=$? | |
| 80 | - | local failed_command="${BASH_COMMAND}" | |
| 81 | - | local failed_script="${CURRENT_SCRIPT:-}" | |
| 82 | - | ||
| 83 | - | # Exit code 130 means user pressed Ctrl+C - handle gracefully | |
| 84 | - | if [[ $exit_code -eq 130 ]]; then | |
| 85 | - | ERROR_HANDLING=false | |
| 86 | - | interrupt_handler | |
| 87 | - | return | |
| 88 | - | fi | |
| 89 | - | ||
| 90 | - | # Log error to file IMMEDIATELY with direct file write | |
| 91 | - | # This must happen before any stdout/stderr restoration | |
| 92 | - | { | |
| 93 | - | echo "" | |
| 94 | - | echo "=== INSTALLATION ERROR ===" | |
| 95 | - | echo "Timestamp: $(date '+%Y-%m-%d %H:%M:%S')" | |
| 96 | - | echo "Exit Code: $exit_code" | |
| 97 | - | if [[ -n "$failed_script" ]]; then | |
| 98 | - | echo "Failed Script: $failed_script" | |
| 99 | - | fi | |
| 100 | - | echo "Failed Command: $failed_command" | |
| 101 | - | echo "=== END ERROR ===" | |
| 102 | - | echo "" | |
| 103 | - | } >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 104 | - | ||
| 105 | - | # Stop background log monitor | |
| 106 | - | stop_log_output | |
| 107 | - | restore_outputs | |
| 108 | - | ||
| 109 | - | # Clear and show error screen | |
| 110 | - | clear_logo | |
| 111 | - | show_cursor | |
| 112 | - | ||
| 113 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "ArchUp installation stopped!" | |
| 114 | - | show_log_tail | |
| 115 | - | ||
| 116 | - | echo | |
| 117 | - | gum style "This command halted with exit code $exit_code:" | |
| 118 | - | show_failed_script_or_command | |
| 119 | - | echo | |
| 120 | - | ||
| 121 | - | gum style "Check logs: $ARCHUP_INSTALL_LOG_FILE" | |
| 122 | - | gum style "Report issues: ${ARCHUP_REPO_URL:-https://github.com/bnema/ArchUp}/issues" | |
| 123 | - | echo | |
| 124 | - | ||
| 125 | - | # Interactive menu | |
| 126 | - | while true; do | |
| 127 | - | options=("View full log" "Exit") | |
| 128 | - | ||
| 129 | - | choice=$(gum choose "${options[@]}" --header "What would you like to do?" --height 4 --padding "0 0 0 $PADDING_LEFT") | |
| 130 | - | ||
| 131 | - | case "$choice" in | |
| 132 | - | "View full log") | |
| 133 | - | if command -v less &>/dev/null; then | |
| 134 | - | less "$ARCHUP_INSTALL_LOG_FILE" | |
| 135 | - | else | |
| 136 | - | cat "$ARCHUP_INSTALL_LOG_FILE" | tail -n 100 | |
| 137 | - | fi | |
| 138 | - | clear_logo | |
| 139 | - | ;; | |
| 140 | - | "Exit" | "") | |
| 141 | - | exit 1 | |
| 142 | - | ;; | |
| 143 | - | esac | |
| 144 | - | done | |
| 145 | - | } | |
| 146 | - | ||
| 147 | - | # Interrupt handler (Ctrl+C) | |
| 148 | - | interrupt_handler() { | |
| 149 | - | if [[ $ERROR_HANDLING == true ]]; then | |
| 150 | - | return | |
| 151 | - | fi | |
| 152 | - | ||
| 153 | - | ERROR_HANDLING=true | |
| 154 | - | ||
| 155 | - | stop_log_output | |
| 156 | - | restore_outputs | |
| 157 | - | show_cursor | |
| 158 | - | ||
| 159 | - | echo | |
| 160 | - | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation interrupted by user" | |
| 161 | - | echo "Installation cancelled at: $(date '+%Y-%m-%d %H:%M:%S')" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 162 | - | echo | |
| 163 | - | ||
| 164 | - | exit 130 | |
| 165 | - | } | |
| 166 | - | ||
| 167 | - | # Exit handler | |
| 168 | - | exit_handler() { | |
| 169 | - | local exit_code=$? | |
| 170 | - | ||
| 171 | - | # Only run if exiting with error and not already handled | |
| 172 | - | if [[ $exit_code -ne 0 && $ERROR_HANDLING != true ]]; then | |
| 173 | - | catch_errors | |
| 174 | - | else | |
| 175 | - | stop_log_output | |
| 176 | - | show_cursor | |
| 177 | - | fi | |
| 178 | - | } | |
| 179 | - | ||
| 180 | - | # Set up traps | |
| 181 | - | trap catch_errors ERR TERM | |
| 182 | - | trap interrupt_handler INT | |
| 183 | - | trap exit_handler EXIT | |
| 184 | - | ||
| 185 | - | # Save original outputs for restoration | |
| 186 | - | save_original_outputs | |
| @@ -1,186 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Error handling for ArchUp installer - improved with logging and interactivity | |||
| 3 | - | ||||
| 4 | - | # Track error handling state | |||
| 5 | - | ERROR_HANDLING=false | |||
| 6 | - | ||||
| 7 | - | # Show cursor | |||
| 8 | - | show_cursor() { | |||
| 9 | - | printf "\033[?25h" | |||
| 10 | - | } | |||
| 11 | - | ||||
| 12 | - | # Hide cursor | |||
| 13 | - | hide_cursor() { | |||
| 14 | - | printf "\033[?25l" | |||
| 15 | - | } | |||
| 16 | - | ||||
| 17 | - | # Display truncated log lines | |||
| 18 | - | show_log_tail() { | |||
| 19 | - | if [[ -f $ARCHUP_INSTALL_LOG_FILE ]]; then | |||
| 20 | - | local log_lines=$((TERM_HEIGHT - LOGO_HEIGHT - 35)) | |||
| 21 | - | local max_line_width=$((LOGO_WIDTH - 4)) | |||
| 22 | - | ||||
| 23 | - | echo | |||
| 24 | - | gum style --foreground 3 "Recent log entries:" | |||
| 25 | - | echo | |||
| 26 | - | ||||
| 27 | - | tail -n $log_lines "$ARCHUP_INSTALL_LOG_FILE" 2>/dev/null | while IFS= read -r line; do | |||
| 28 | - | if ((${#line} > max_line_width)); then | |||
| 29 | - | local truncated_line="${line:0:$max_line_width}..." | |||
| 30 | - | else | |||
| 31 | - | local truncated_line="$line" | |||
| 32 | - | fi | |||
| 33 | - | ||||
| 34 | - | gum style "$truncated_line" | |||
| 35 | - | done | |||
| 36 | - | ||||
| 37 | - | echo | |||
| 38 | - | fi | |||
| 39 | - | } | |||
| 40 | - | ||||
| 41 | - | # Display failed script or command | |||
| 42 | - | show_failed_script_or_command() { | |||
| 43 | - | if [[ -n ${CURRENT_SCRIPT:-} ]]; then | |||
| 44 | - | gum style "Failed script: $CURRENT_SCRIPT" | |||
| 45 | - | else | |||
| 46 | - | local cmd="$BASH_COMMAND" | |||
| 47 | - | local max_cmd_width=$((LOGO_WIDTH - 4)) | |||
| 48 | - | ||||
| 49 | - | if ((${#cmd} > max_cmd_width)); then | |||
| 50 | - | cmd="${cmd:0:$max_cmd_width}..." | |||
| 51 | - | fi | |||
| 52 | - | ||||
| 53 | - | gum style "Command: $cmd" | |||
| 54 | - | fi | |||
| 55 | - | } | |||
| 56 | - | ||||
| 57 | - | # Save original file descriptors | |||
| 58 | - | save_original_outputs() { | |||
| 59 | - | exec 3>&1 4>&2 | |||
| 60 | - | } | |||
| 61 | - | ||||
| 62 | - | # Restore original file descriptors | |||
| 63 | - | restore_outputs() { | |||
| 64 | - | if [ -e /proc/self/fd/3 ] && [ -e /proc/self/fd/4 ]; then | |||
| 65 | - | exec 1>&3 2>&4 | |||
| 66 | - | fi | |||
| 67 | - | } | |||
| 68 | - | ||||
| 69 | - | # Main error handler | |||
| 70 | - | catch_errors() { | |||
| 71 | - | # Prevent recursive error handling | |||
| 72 | - | if [[ $ERROR_HANDLING == true ]]; then | |||
| 73 | - | return | |||
| 74 | - | else | |||
| 75 | - | ERROR_HANDLING=true | |||
| 76 | - | fi | |||
| 77 | - | ||||
| 78 | - | # Store exit code immediately (BEFORE any other commands!) | |||
| 79 | - | local exit_code=$? | |||
| 80 | - | local failed_command="${BASH_COMMAND}" | |||
| 81 | - | local failed_script="${CURRENT_SCRIPT:-}" | |||
| 82 | - | ||||
| 83 | - | # Exit code 130 means user pressed Ctrl+C - handle gracefully | |||
| 84 | - | if [[ $exit_code -eq 130 ]]; then | |||
| 85 | - | ERROR_HANDLING=false | |||
| 86 | - | interrupt_handler | |||
| 87 | - | return | |||
| 88 | - | fi | |||
| 89 | - | ||||
| 90 | - | # Log error to file IMMEDIATELY with direct file write | |||
| 91 | - | # This must happen before any stdout/stderr restoration | |||
| 92 | - | { | |||
| 93 | - | echo "" | |||
| 94 | - | echo "=== INSTALLATION ERROR ===" | |||
| 95 | - | echo "Timestamp: $(date '+%Y-%m-%d %H:%M:%S')" | |||
| 96 | - | echo "Exit Code: $exit_code" | |||
| 97 | - | if [[ -n "$failed_script" ]]; then | |||
| 98 | - | echo "Failed Script: $failed_script" | |||
| 99 | - | fi | |||
| 100 | - | echo "Failed Command: $failed_command" | |||
| 101 | - | echo "=== END ERROR ===" | |||
| 102 | - | echo "" | |||
| 103 | - | } >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 104 | - | ||||
| 105 | - | # Stop background log monitor | |||
| 106 | - | stop_log_output | |||
| 107 | - | restore_outputs | |||
| 108 | - | ||||
| 109 | - | # Clear and show error screen | |||
| 110 | - | clear_logo | |||
| 111 | - | show_cursor | |||
| 112 | - | ||||
| 113 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "ArchUp installation stopped!" | |||
| 114 | - | show_log_tail | |||
| 115 | - | ||||
| 116 | - | echo | |||
| 117 | - | gum style "This command halted with exit code $exit_code:" | |||
| 118 | - | show_failed_script_or_command | |||
| 119 | - | echo | |||
| 120 | - | ||||
| 121 | - | gum style "Check logs: $ARCHUP_INSTALL_LOG_FILE" | |||
| 122 | - | gum style "Report issues: ${ARCHUP_REPO_URL:-https://github.com/bnema/ArchUp}/issues" | |||
| 123 | - | echo | |||
| 124 | - | ||||
| 125 | - | # Interactive menu | |||
| 126 | - | while true; do | |||
| 127 | - | options=("View full log" "Exit") | |||
| 128 | - | ||||
| 129 | - | choice=$(gum choose "${options[@]}" --header "What would you like to do?" --height 4 --padding "0 0 0 $PADDING_LEFT") | |||
| 130 | - | ||||
| 131 | - | case "$choice" in | |||
| 132 | - | "View full log") | |||
| 133 | - | if command -v less &>/dev/null; then | |||
| 134 | - | less "$ARCHUP_INSTALL_LOG_FILE" | |||
| 135 | - | else | |||
| 136 | - | cat "$ARCHUP_INSTALL_LOG_FILE" | tail -n 100 | |||
| 137 | - | fi | |||
| 138 | - | clear_logo | |||
| 139 | - | ;; | |||
| 140 | - | "Exit" | "") | |||
| 141 | - | exit 1 | |||
| 142 | - | ;; | |||
| 143 | - | esac | |||
| 144 | - | done | |||
| 145 | - | } | |||
| 146 | - | ||||
| 147 | - | # Interrupt handler (Ctrl+C) | |||
| 148 | - | interrupt_handler() { | |||
| 149 | - | if [[ $ERROR_HANDLING == true ]]; then | |||
| 150 | - | return | |||
| 151 | - | fi | |||
| 152 | - | ||||
| 153 | - | ERROR_HANDLING=true | |||
| 154 | - | ||||
| 155 | - | stop_log_output | |||
| 156 | - | restore_outputs | |||
| 157 | - | show_cursor | |||
| 158 | - | ||||
| 159 | - | echo | |||
| 160 | - | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation interrupted by user" | |||
| 161 | - | echo "Installation cancelled at: $(date '+%Y-%m-%d %H:%M:%S')" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 162 | - | echo | |||
| 163 | - | ||||
| 164 | - | exit 130 | |||
| 165 | - | } | |||
| 166 | - | ||||
| 167 | - | # Exit handler | |||
| 168 | - | exit_handler() { | |||
| 169 | - | local exit_code=$? | |||
| 170 | - | ||||
| 171 | - | # Only run if exiting with error and not already handled | |||
| 172 | - | if [[ $exit_code -ne 0 && $ERROR_HANDLING != true ]]; then | |||
| 173 | - | catch_errors | |||
| 174 | - | else | |||
| 175 | - | stop_log_output | |||
| 176 | - | show_cursor | |||
| 177 | - | fi | |||
| 178 | - | } | |||
| 179 | - | ||||
| 180 | - | # Set up traps | |||
| 181 | - | trap catch_errors ERR TERM | |||
| 182 | - | trap interrupt_handler INT | |||
| 183 | - | trap exit_handler EXIT | |||
| 184 | - | ||||
| 185 | - | # Save original outputs for restoration | |||
| 186 | - | save_original_outputs | |||
D install/deprecated/helpers/logging.sh +0 -69
| @@ -1,69 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Logging system for ArchUp installer | |
| 3 | - | # All output logged to $ARCHUP_INSTALL_LOG_FILE | |
| 4 | - | # Spinners handle display, errors shown automatically via --show-error | |
| 5 | - | ||
| 6 | - | # No-op stubs for compatibility (log monitor removed) | |
| 7 | - | start_log_output() { | |
| 8 | - | true | |
| 9 | - | } | |
| 10 | - | ||
| 11 | - | stop_log_output() { | |
| 12 | - | true | |
| 13 | - | } | |
| 14 | - | ||
| 15 | - | start_install_log() { | |
| 16 | - | touch "$ARCHUP_INSTALL_LOG_FILE" | |
| 17 | - | chmod 666 "$ARCHUP_INSTALL_LOG_FILE" | |
| 18 | - | ||
| 19 | - | export ARCHUP_START_TIME=$(date '+%Y-%m-%d %H:%M:%S') | |
| 20 | - | echo "=== ArchUp Installation Started: $ARCHUP_START_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 21 | - | ||
| 22 | - | # Don't start log monitor here - run_logged will handle it dynamically | |
| 23 | - | } | |
| 24 | - | ||
| 25 | - | stop_install_log() { | |
| 26 | - | stop_log_output | |
| 27 | - | show_cursor | |
| 28 | - | ||
| 29 | - | if [[ -n ${ARCHUP_INSTALL_LOG_FILE:-} ]]; then | |
| 30 | - | ARCHUP_END_TIME=$(date '+%Y-%m-%d %H:%M:%S') | |
| 31 | - | echo "" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 32 | - | echo "=== ArchUp Installation Completed: $ARCHUP_END_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 33 | - | ||
| 34 | - | if [ -n "$ARCHUP_START_TIME" ]; then | |
| 35 | - | ARCHUP_START_EPOCH=$(date -d "$ARCHUP_START_TIME" +%s) | |
| 36 | - | ARCHUP_END_EPOCH=$(date -d "$ARCHUP_END_TIME" +%s) | |
| 37 | - | ARCHUP_DURATION=$((ARCHUP_END_EPOCH - ARCHUP_START_EPOCH)) | |
| 38 | - | ||
| 39 | - | ARCHUP_MINS=$((ARCHUP_DURATION / 60)) | |
| 40 | - | ARCHUP_SECS=$((ARCHUP_DURATION % 60)) | |
| 41 | - | ||
| 42 | - | echo "Duration: ${ARCHUP_MINS}m ${ARCHUP_SECS}s" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 43 | - | fi | |
| 44 | - | echo "=================================" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 45 | - | fi | |
| 46 | - | } | |
| 47 | - | ||
| 48 | - | run_logged() { | |
| 49 | - | local script="$1" | |
| 50 | - | ||
| 51 | - | export CURRENT_SCRIPT="$script" | |
| 52 | - | ||
| 53 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 54 | - | ||
| 55 | - | # Source helpers in subshell before running the script so functions are available | |
| 56 | - | # Redirect output to log file only | |
| 57 | - | bash -c "source '$ARCHUP_INSTALL/helpers/all.sh' && source '$script'" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 58 | - | ||
| 59 | - | local exit_code=$? | |
| 60 | - | ||
| 61 | - | if [ $exit_code -eq 0 ]; then | |
| 62 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Completed: $script" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 63 | - | unset CURRENT_SCRIPT | |
| 64 | - | else | |
| 65 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Failed: $script (exit code: $exit_code)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 66 | - | fi | |
| 67 | - | ||
| 68 | - | return $exit_code | |
| 69 | - | } | |
| @@ -1,69 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Logging system for ArchUp installer | |||
| 3 | - | # All output logged to $ARCHUP_INSTALL_LOG_FILE | |||
| 4 | - | # Spinners handle display, errors shown automatically via --show-error | |||
| 5 | - | ||||
| 6 | - | # No-op stubs for compatibility (log monitor removed) | |||
| 7 | - | start_log_output() { | |||
| 8 | - | true | |||
| 9 | - | } | |||
| 10 | - | ||||
| 11 | - | stop_log_output() { | |||
| 12 | - | true | |||
| 13 | - | } | |||
| 14 | - | ||||
| 15 | - | start_install_log() { | |||
| 16 | - | touch "$ARCHUP_INSTALL_LOG_FILE" | |||
| 17 | - | chmod 666 "$ARCHUP_INSTALL_LOG_FILE" | |||
| 18 | - | ||||
| 19 | - | export ARCHUP_START_TIME=$(date '+%Y-%m-%d %H:%M:%S') | |||
| 20 | - | echo "=== ArchUp Installation Started: $ARCHUP_START_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 21 | - | ||||
| 22 | - | # Don't start log monitor here - run_logged will handle it dynamically | |||
| 23 | - | } | |||
| 24 | - | ||||
| 25 | - | stop_install_log() { | |||
| 26 | - | stop_log_output | |||
| 27 | - | show_cursor | |||
| 28 | - | ||||
| 29 | - | if [[ -n ${ARCHUP_INSTALL_LOG_FILE:-} ]]; then | |||
| 30 | - | ARCHUP_END_TIME=$(date '+%Y-%m-%d %H:%M:%S') | |||
| 31 | - | echo "" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 32 | - | echo "=== ArchUp Installation Completed: $ARCHUP_END_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 33 | - | ||||
| 34 | - | if [ -n "$ARCHUP_START_TIME" ]; then | |||
| 35 | - | ARCHUP_START_EPOCH=$(date -d "$ARCHUP_START_TIME" +%s) | |||
| 36 | - | ARCHUP_END_EPOCH=$(date -d "$ARCHUP_END_TIME" +%s) | |||
| 37 | - | ARCHUP_DURATION=$((ARCHUP_END_EPOCH - ARCHUP_START_EPOCH)) | |||
| 38 | - | ||||
| 39 | - | ARCHUP_MINS=$((ARCHUP_DURATION / 60)) | |||
| 40 | - | ARCHUP_SECS=$((ARCHUP_DURATION % 60)) | |||
| 41 | - | ||||
| 42 | - | echo "Duration: ${ARCHUP_MINS}m ${ARCHUP_SECS}s" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 43 | - | fi | |||
| 44 | - | echo "=================================" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 45 | - | fi | |||
| 46 | - | } | |||
| 47 | - | ||||
| 48 | - | run_logged() { | |||
| 49 | - | local script="$1" | |||
| 50 | - | ||||
| 51 | - | export CURRENT_SCRIPT="$script" | |||
| 52 | - | ||||
| 53 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 54 | - | ||||
| 55 | - | # Source helpers in subshell before running the script so functions are available | |||
| 56 | - | # Redirect output to log file only | |||
| 57 | - | bash -c "source '$ARCHUP_INSTALL/helpers/all.sh' && source '$script'" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 58 | - | ||||
| 59 | - | local exit_code=$? | |||
| 60 | - | ||||
| 61 | - | if [ $exit_code -eq 0 ]; then | |||
| 62 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Completed: $script" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 63 | - | unset CURRENT_SCRIPT | |||
| 64 | - | else | |||
| 65 | - | echo "[$(date '+%Y-%m-%d %H:%M:%S')] Failed: $script (exit code: $exit_code)" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 66 | - | fi | |||
| 67 | - | ||||
| 68 | - | return $exit_code | |||
| 69 | - | } | |||
D install/deprecated/helpers/multilib.sh +0 -25
| @@ -1,25 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Helper function to enable multilib repository | |
| 3 | - | ||
| 4 | - | ####################################### | |
| 5 | - | # Description: Enable multilib in pacman.conf | |
| 6 | - | # Arguments: | |
| 7 | - | # $1 - Path to pacman.conf (optional, defaults to /etc/pacman.conf) | |
| 8 | - | # Returns: | |
| 9 | - | # 0 if successful, 1 on error | |
| 10 | - | ####################################### | |
| 11 | - | enable_multilib() { | |
| 12 | - | local pacman_conf="${1:-/etc/pacman.conf}" | |
| 13 | - | ||
| 14 | - | # Check if multilib is already enabled | |
| 15 | - | if grep -q "^\[multilib\]" "$pacman_conf"; then | |
| 16 | - | echo "Multilib already enabled in $pacman_conf" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 17 | - | return 0 | |
| 18 | - | fi | |
| 19 | - | ||
| 20 | - | # Uncomment multilib section | |
| 21 | - | sed -i '/^#\[multilib\]/,/^#Include = \/etc\/pacman.d\/mirrorlist/ s/^#//' "$pacman_conf" | |
| 22 | - | ||
| 23 | - | echo "Multilib enabled in $pacman_conf" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 24 | - | return 0 | |
| 25 | - | } | |
| @@ -1,25 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Helper function to enable multilib repository | |||
| 3 | - | ||||
| 4 | - | ####################################### | |||
| 5 | - | # Description: Enable multilib in pacman.conf | |||
| 6 | - | # Arguments: | |||
| 7 | - | # $1 - Path to pacman.conf (optional, defaults to /etc/pacman.conf) | |||
| 8 | - | # Returns: | |||
| 9 | - | # 0 if successful, 1 on error | |||
| 10 | - | ####################################### | |||
| 11 | - | enable_multilib() { | |||
| 12 | - | local pacman_conf="${1:-/etc/pacman.conf}" | |||
| 13 | - | ||||
| 14 | - | # Check if multilib is already enabled | |||
| 15 | - | if grep -q "^\[multilib\]" "$pacman_conf"; then | |||
| 16 | - | echo "Multilib already enabled in $pacman_conf" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 17 | - | return 0 | |||
| 18 | - | fi | |||
| 19 | - | ||||
| 20 | - | # Uncomment multilib section | |||
| 21 | - | sed -i '/^#\[multilib\]/,/^#Include = \/etc\/pacman.d\/mirrorlist/ s/^#//' "$pacman_conf" | |||
| 22 | - | ||||
| 23 | - | echo "Multilib enabled in $pacman_conf" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 24 | - | return 0 | |||
| 25 | - | } | |||
D install/deprecated/helpers/presentation.sh +0 -93
| @@ -1,93 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Presentation utilities for ArchUp installer | |
| 3 | - | # Adapted from Omarchy presentation.sh | |
| 4 | - | # NOTE: Requires gum to be installed via bootstrap.sh first! | |
| 5 | - | ||
| 6 | - | # Get terminal size from /dev/tty (works in all scenarios: direct, sourced, or piped) | |
| 7 | - | if [ -e /dev/tty ]; then | |
| 8 | - | TERM_SIZE=$(stty size 2>/dev/null </dev/tty) | |
| 9 | - | ||
| 10 | - | if [ -n "$TERM_SIZE" ]; then | |
| 11 | - | export TERM_HEIGHT=$(echo "$TERM_SIZE" | cut -d' ' -f1) | |
| 12 | - | export TERM_WIDTH=$(echo "$TERM_SIZE" | cut -d' ' -f2) | |
| 13 | - | else | |
| 14 | - | # Fallback to reasonable defaults if stty fails | |
| 15 | - | export TERM_WIDTH=80 | |
| 16 | - | export TERM_HEIGHT=24 | |
| 17 | - | fi | |
| 18 | - | else | |
| 19 | - | # No terminal available (e.g., non-interactive environment) | |
| 20 | - | export TERM_WIDTH=80 | |
| 21 | - | export TERM_HEIGHT=24 | |
| 22 | - | fi | |
| 23 | - | ||
| 24 | - | export LOGO_PATH="$ARCHUP_PATH/logo.txt" | |
| 25 | - | export LOGO_WIDTH=$(awk '{ if (length > max) max = length } END { print max+0 }' "$LOGO_PATH" 2>/dev/null || echo 0) | |
| 26 | - | export LOGO_HEIGHT=$(wc -l <"$LOGO_PATH" 2>/dev/null || echo 0) | |
| 27 | - | ||
| 28 | - | export PADDING_LEFT=$((($TERM_WIDTH - $LOGO_WIDTH) / 2)) | |
| 29 | - | export PADDING_LEFT_SPACES=$(printf "%*s" $PADDING_LEFT "") | |
| 30 | - | ||
| 31 | - | # Arch blue theme for gum | |
| 32 | - | export GUM_CONFIRM_PROMPT_FOREGROUND="6" # Cyan for prompt | |
| 33 | - | export GUM_CONFIRM_SELECTED_FOREGROUND="0" # Black text on selected | |
| 34 | - | export GUM_CONFIRM_SELECTED_BACKGROUND="4" # Blue background for selected (Arch blue) | |
| 35 | - | export GUM_CONFIRM_UNSELECTED_FOREGROUND="7" # White for unselected | |
| 36 | - | export GUM_CONFIRM_UNSELECTED_BACKGROUND="0" # Black background for unselected | |
| 37 | - | export PADDING="0 0 0 $PADDING_LEFT" # Gum Style | |
| 38 | - | export GUM_CHOOSE_PADDING="$PADDING" | |
| 39 | - | export GUM_FILTER_PADDING="$PADDING" | |
| 40 | - | export GUM_INPUT_PADDING="$PADDING" | |
| 41 | - | export GUM_SPIN_PADDING="$PADDING" | |
| 42 | - | export GUM_TABLE_PADDING="$PADDING" | |
| 43 | - | export GUM_CONFIRM_PADDING="$PADDING" | |
| 44 | - | ||
| 45 | - | clear_logo() { | |
| 46 | - | # Redirect all output to stderr to prevent capture by command substitution | |
| 47 | - | { | |
| 48 | - | printf "\033[H\033[2J" # Clear screen and move cursor to top-left | |
| 49 | - | ||
| 50 | - | # ANSI color codes: cyan=36, white=37 | |
| 51 | - | local CYAN="\033[36m" | |
| 52 | - | local WHITE="\033[37m" | |
| 53 | - | local RESET="\033[0m" | |
| 54 | - | local split_pos=34 | |
| 55 | - | ||
| 56 | - | # Print with padding and color split | |
| 57 | - | printf "\n" # Top padding | |
| 58 | - | while IFS= read -r line; do | |
| 59 | - | if [ -n "$line" ]; then | |
| 60 | - | printf "%s${CYAN}%s${WHITE}%s${RESET}\n" "$PADDING_LEFT_SPACES" "${line:0:$split_pos}" "${line:$split_pos}" | |
| 61 | - | else | |
| 62 | - | printf "\n" | |
| 63 | - | fi | |
| 64 | - | done < "$LOGO_PATH" | |
| 65 | - | } >&2 | |
| 66 | - | } | |
| 67 | - | ||
| 68 | - | # Show cursor (used in cleanup) | |
| 69 | - | show_cursor() { | |
| 70 | - | printf "\033[?25h" | |
| 71 | - | } | |
| 72 | - | ||
| 73 | - | # Hide cursor (used during installation) | |
| 74 | - | hide_cursor() { | |
| 75 | - | printf "\033[?25l" | |
| 76 | - | } | |
| 77 | - | ||
| 78 | - | # Run a command with a gum spinner, logging output to file | |
| 79 | - | # Usage: run_with_spinner "Title text" "command to run" | |
| 80 | - | run_with_spinner() { | |
| 81 | - | local title="$1" | |
| 82 | - | local command="$2" | |
| 83 | - | ||
| 84 | - | # Run command with spinner, output goes only to log file | |
| 85 | - | # Spinner UI (stderr) goes to /dev/tty so it's always visible even when stdout is redirected | |
| 86 | - | # If command fails, error will be caught by ERR trap and shown in error handler | |
| 87 | - | if gum spin --spinner dot --title "$title" -- \ | |
| 88 | - | bash -c "$command >> \"$ARCHUP_INSTALL_LOG_FILE\" 2>&1" 2>/dev/tty; then | |
| 89 | - | return 0 | |
| 90 | - | else | |
| 91 | - | return 1 | |
| 92 | - | fi | |
| 93 | - | } | |
| @@ -1,93 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Presentation utilities for ArchUp installer | |||
| 3 | - | # Adapted from Omarchy presentation.sh | |||
| 4 | - | # NOTE: Requires gum to be installed via bootstrap.sh first! | |||
| 5 | - | ||||
| 6 | - | # Get terminal size from /dev/tty (works in all scenarios: direct, sourced, or piped) | |||
| 7 | - | if [ -e /dev/tty ]; then | |||
| 8 | - | TERM_SIZE=$(stty size 2>/dev/null </dev/tty) | |||
| 9 | - | ||||
| 10 | - | if [ -n "$TERM_SIZE" ]; then | |||
| 11 | - | export TERM_HEIGHT=$(echo "$TERM_SIZE" | cut -d' ' -f1) | |||
| 12 | - | export TERM_WIDTH=$(echo "$TERM_SIZE" | cut -d' ' -f2) | |||
| 13 | - | else | |||
| 14 | - | # Fallback to reasonable defaults if stty fails | |||
| 15 | - | export TERM_WIDTH=80 | |||
| 16 | - | export TERM_HEIGHT=24 | |||
| 17 | - | fi | |||
| 18 | - | else | |||
| 19 | - | # No terminal available (e.g., non-interactive environment) | |||
| 20 | - | export TERM_WIDTH=80 | |||
| 21 | - | export TERM_HEIGHT=24 | |||
| 22 | - | fi | |||
| 23 | - | ||||
| 24 | - | export LOGO_PATH="$ARCHUP_PATH/logo.txt" | |||
| 25 | - | export LOGO_WIDTH=$(awk '{ if (length > max) max = length } END { print max+0 }' "$LOGO_PATH" 2>/dev/null || echo 0) | |||
| 26 | - | export LOGO_HEIGHT=$(wc -l <"$LOGO_PATH" 2>/dev/null || echo 0) | |||
| 27 | - | ||||
| 28 | - | export PADDING_LEFT=$((($TERM_WIDTH - $LOGO_WIDTH) / 2)) | |||
| 29 | - | export PADDING_LEFT_SPACES=$(printf "%*s" $PADDING_LEFT "") | |||
| 30 | - | ||||
| 31 | - | # Arch blue theme for gum | |||
| 32 | - | export GUM_CONFIRM_PROMPT_FOREGROUND="6" # Cyan for prompt | |||
| 33 | - | export GUM_CONFIRM_SELECTED_FOREGROUND="0" # Black text on selected | |||
| 34 | - | export GUM_CONFIRM_SELECTED_BACKGROUND="4" # Blue background for selected (Arch blue) | |||
| 35 | - | export GUM_CONFIRM_UNSELECTED_FOREGROUND="7" # White for unselected | |||
| 36 | - | export GUM_CONFIRM_UNSELECTED_BACKGROUND="0" # Black background for unselected | |||
| 37 | - | export PADDING="0 0 0 $PADDING_LEFT" # Gum Style | |||
| 38 | - | export GUM_CHOOSE_PADDING="$PADDING" | |||
| 39 | - | export GUM_FILTER_PADDING="$PADDING" | |||
| 40 | - | export GUM_INPUT_PADDING="$PADDING" | |||
| 41 | - | export GUM_SPIN_PADDING="$PADDING" | |||
| 42 | - | export GUM_TABLE_PADDING="$PADDING" | |||
| 43 | - | export GUM_CONFIRM_PADDING="$PADDING" | |||
| 44 | - | ||||
| 45 | - | clear_logo() { | |||
| 46 | - | # Redirect all output to stderr to prevent capture by command substitution | |||
| 47 | - | { | |||
| 48 | - | printf "\033[H\033[2J" # Clear screen and move cursor to top-left | |||
| 49 | - | ||||
| 50 | - | # ANSI color codes: cyan=36, white=37 | |||
| 51 | - | local CYAN="\033[36m" | |||
| 52 | - | local WHITE="\033[37m" | |||
| 53 | - | local RESET="\033[0m" | |||
| 54 | - | local split_pos=34 | |||
| 55 | - | ||||
| 56 | - | # Print with padding and color split | |||
| 57 | - | printf "\n" # Top padding | |||
| 58 | - | while IFS= read -r line; do | |||
| 59 | - | if [ -n "$line" ]; then | |||
| 60 | - | printf "%s${CYAN}%s${WHITE}%s${RESET}\n" "$PADDING_LEFT_SPACES" "${line:0:$split_pos}" "${line:$split_pos}" | |||
| 61 | - | else | |||
| 62 | - | printf "\n" | |||
| 63 | - | fi | |||
| 64 | - | done < "$LOGO_PATH" | |||
| 65 | - | } >&2 | |||
| 66 | - | } | |||
| 67 | - | ||||
| 68 | - | # Show cursor (used in cleanup) | |||
| 69 | - | show_cursor() { | |||
| 70 | - | printf "\033[?25h" | |||
| 71 | - | } | |||
| 72 | - | ||||
| 73 | - | # Hide cursor (used during installation) | |||
| 74 | - | hide_cursor() { | |||
| 75 | - | printf "\033[?25l" | |||
| 76 | - | } | |||
| 77 | - | ||||
| 78 | - | # Run a command with a gum spinner, logging output to file | |||
| 79 | - | # Usage: run_with_spinner "Title text" "command to run" | |||
| 80 | - | run_with_spinner() { | |||
| 81 | - | local title="$1" | |||
| 82 | - | local command="$2" | |||
| 83 | - | ||||
| 84 | - | # Run command with spinner, output goes only to log file | |||
| 85 | - | # Spinner UI (stderr) goes to /dev/tty so it's always visible even when stdout is redirected | |||
| 86 | - | # If command fails, error will be caught by ERR trap and shown in error handler | |||
| 87 | - | if gum spin --spinner dot --title "$title" -- \ | |||
| 88 | - | bash -c "$command >> \"$ARCHUP_INSTALL_LOG_FILE\" 2>&1" 2>/dev/tty; then | |||
| 89 | - | return 0 | |||
| 90 | - | else | |||
| 91 | - | return 1 | |||
| 92 | - | fi | |||
| 93 | - | } | |||
D install/deprecated/partitioning/all.sh +0 -9
| @@ -1,9 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Partitioning phase | |
| 3 | - | ||
| 4 | - | stop_log_output # Stop for interactive prompts and partition display | |
| 5 | - | source "$ARCHUP_INSTALL/partitioning/detect-disk.sh" # Interactive (gum confirm) | |
| 6 | - | source "$ARCHUP_INSTALL/partitioning/partition.sh" # Exports ARCHUP_EFI_PART, ARCHUP_ROOT_PART (has gum output) | |
| 7 | - | source "$ARCHUP_INSTALL/partitioning/format.sh" # Interactive (prompts for separate encryption password if chosen) + exports ARCHUP_CRYPT_ROOT | |
| 8 | - | source "$ARCHUP_INSTALL/partitioning/mount.sh" # Uses exported partition variables (has gum output) | |
| 9 | - | start_log_output # Resume after all partitioning is done | |
| @@ -1,9 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Partitioning phase | |||
| 3 | - | ||||
| 4 | - | stop_log_output # Stop for interactive prompts and partition display | |||
| 5 | - | source "$ARCHUP_INSTALL/partitioning/detect-disk.sh" # Interactive (gum confirm) | |||
| 6 | - | source "$ARCHUP_INSTALL/partitioning/partition.sh" # Exports ARCHUP_EFI_PART, ARCHUP_ROOT_PART (has gum output) | |||
| 7 | - | source "$ARCHUP_INSTALL/partitioning/format.sh" # Interactive (prompts for separate encryption password if chosen) + exports ARCHUP_CRYPT_ROOT | |||
| 8 | - | source "$ARCHUP_INSTALL/partitioning/mount.sh" # Uses exported partition variables (has gum output) | |||
| 9 | - | start_log_output # Resume after all partitioning is done | |||
D install/deprecated/partitioning/detect-disk.sh +0 -47
| @@ -1,47 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Detect and select installation disk | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Disk Selection" | |
| 5 | - | echo | |
| 6 | - | ||
| 7 | - | # List available disks with detailed information using JSON output | |
| 8 | - | mapfile -t disks < <(lsblk -J -d -o NAME,SIZE,TYPE,MODEL,SERIAL,VENDOR | jq -r ' | |
| 9 | - | .blockdevices[] | | |
| 10 | - | select(.type == "disk") | | |
| 11 | - | ( | |
| 12 | - | "/dev/\(.name) (\(.size))" + | |
| 13 | - | (if .model then " \(.model)" else "" end) + | |
| 14 | - | (if .serial then " [\(.serial)]" else "" end) + | |
| 15 | - | (if .vendor then " \(.vendor)" else "" end) | |
| 16 | - | ) | |
| 17 | - | ') | |
| 18 | - | ||
| 19 | - | if [ ${#disks[@]} -eq 0 ]; then | |
| 20 | - | gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "No disks found!" | |
| 21 | - | echo "ERROR: No disks found" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 22 | - | exit 1 | |
| 23 | - | fi | |
| 24 | - | ||
| 25 | - | # Let user select disk | |
| 26 | - | ARCHUP_DISK=$(gum choose "${disks[@]}" \ | |
| 27 | - | --header "Select installation disk (ALL DATA WILL BE ERASED):" \ | |
| 28 | - | --height $((${#disks[@]} + 3)) \ | |
| 29 | - | --padding "0 0 0 $PADDING_LEFT" | awk '{print $1}') | |
| 30 | - | ||
| 31 | - | export ARCHUP_DISK | |
| 32 | - | ||
| 33 | - | # Display selected disk info | |
| 34 | - | gum style --padding "1 0 0 $PADDING_LEFT" "Selected disk: $ARCHUP_DISK" | |
| 35 | - | lsblk "$ARCHUP_DISK" | while IFS= read -r line; do | |
| 36 | - | gum style --padding "0 0 0 $PADDING_LEFT" " $line" | |
| 37 | - | done | |
| 38 | - | echo | |
| 39 | - | ||
| 40 | - | # Final confirmation | |
| 41 | - | if ! gum confirm "WARNING: All data on $ARCHUP_DISK will be permanently erased. Continue?" --padding "0 0 1 $PADDING_LEFT"; then | |
| 42 | - | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user" | |
| 43 | - | echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 44 | - | exit 0 | |
| 45 | - | fi | |
| 46 | - | ||
| 47 | - | echo "Disk selected: $ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,47 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Detect and select installation disk | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Disk Selection" | |||
| 5 | - | echo | |||
| 6 | - | ||||
| 7 | - | # List available disks with detailed information using JSON output | |||
| 8 | - | mapfile -t disks < <(lsblk -J -d -o NAME,SIZE,TYPE,MODEL,SERIAL,VENDOR | jq -r ' | |||
| 9 | - | .blockdevices[] | | |||
| 10 | - | select(.type == "disk") | | |||
| 11 | - | ( | |||
| 12 | - | "/dev/\(.name) (\(.size))" + | |||
| 13 | - | (if .model then " \(.model)" else "" end) + | |||
| 14 | - | (if .serial then " [\(.serial)]" else "" end) + | |||
| 15 | - | (if .vendor then " \(.vendor)" else "" end) | |||
| 16 | - | ) | |||
| 17 | - | ') | |||
| 18 | - | ||||
| 19 | - | if [ ${#disks[@]} -eq 0 ]; then | |||
| 20 | - | gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "No disks found!" | |||
| 21 | - | echo "ERROR: No disks found" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 22 | - | exit 1 | |||
| 23 | - | fi | |||
| 24 | - | ||||
| 25 | - | # Let user select disk | |||
| 26 | - | ARCHUP_DISK=$(gum choose "${disks[@]}" \ | |||
| 27 | - | --header "Select installation disk (ALL DATA WILL BE ERASED):" \ | |||
| 28 | - | --height $((${#disks[@]} + 3)) \ | |||
| 29 | - | --padding "0 0 0 $PADDING_LEFT" | awk '{print $1}') | |||
| 30 | - | ||||
| 31 | - | export ARCHUP_DISK | |||
| 32 | - | ||||
| 33 | - | # Display selected disk info | |||
| 34 | - | gum style --padding "1 0 0 $PADDING_LEFT" "Selected disk: $ARCHUP_DISK" | |||
| 35 | - | lsblk "$ARCHUP_DISK" | while IFS= read -r line; do | |||
| 36 | - | gum style --padding "0 0 0 $PADDING_LEFT" " $line" | |||
| 37 | - | done | |||
| 38 | - | echo | |||
| 39 | - | ||||
| 40 | - | # Final confirmation | |||
| 41 | - | if ! gum confirm "WARNING: All data on $ARCHUP_DISK will be permanently erased. Continue?" --padding "0 0 1 $PADDING_LEFT"; then | |||
| 42 | - | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user" | |||
| 43 | - | echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 44 | - | exit 0 | |||
| 45 | - | fi | |||
| 46 | - | ||||
| 47 | - | echo "Disk selected: $ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
D install/deprecated/partitioning/format.sh +0 -131
| @@ -1,131 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Format partitions with btrfs and optional LUKS encryption | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Formatting partitions..." | |
| 5 | - | ||
| 6 | - | # Wipe any existing signatures on EFI partition | |
| 7 | - | wipefs -af "$ARCHUP_EFI_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 8 | - | ||
| 9 | - | # Format EFI partition as FAT32 | |
| 10 | - | mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 11 | - | echo "Formatted $ARCHUP_EFI_PART as FAT32" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 12 | - | ||
| 13 | - | # Handle root partition - with or without encryption | |
| 14 | - | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |
| 15 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Setting up LUKS encryption..." | |
| 16 | - | ||
| 17 | - | # Check if user wants to use same password or separate password | |
| 18 | - | ARCHUP_ENCRYPTION_USE_SAME_PASSWORD=$(config_get "ARCHUP_ENCRYPTION_USE_SAME_PASSWORD") | |
| 19 | - | ||
| 20 | - | if [ "$ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" = "true" ]; then | |
| 21 | - | # Use account password for encryption | |
| 22 | - | LUKS_PASSWORD=$(config_get "ARCHUP_PASSWORD") | |
| 23 | - | ||
| 24 | - | if [ -z "$LUKS_PASSWORD" ]; then | |
| 25 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "ERROR: Account password not set!" | |
| 26 | - | echo "ERROR: Account password is empty during LUKS setup" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 27 | - | exit 1 | |
| 28 | - | fi | |
| 29 | - | else | |
| 30 | - | # Prompt for separate encryption password | |
| 31 | - | echo | |
| 32 | - | gum style --foreground 6 --padding "0 0 0 $PADDING_LEFT" "Disk Encryption Password" | |
| 33 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Enter a password to encrypt your disk (different from your account password)" | |
| 34 | - | gum style --foreground 8 --padding "0 0 0 $PADDING_LEFT" "Press Ctrl+C to cancel or leave empty to abort" | |
| 35 | - | ||
| 36 | - | while true; do | |
| 37 | - | LUKS_PASSWORD=$(gum input --password --placeholder "Enter encryption password" \ | |
| 38 | - | --prompt "Password: " \ | |
| 39 | - | --padding "0 0 0 $PADDING_LEFT") | |
| 40 | - | ||
| 41 | - | # Check if gum was cancelled (Ctrl+C returns exit code 130) | |
| 42 | - | if [ $? -ne 0 ]; then | |
| 43 | - | echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 44 | - | exit 130 | |
| 45 | - | fi | |
| 46 | - | ||
| 47 | - | # Allow empty password to abort | |
| 48 | - | if [ -z "$LUKS_PASSWORD" ]; then | |
| 49 | - | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation aborted by user" | |
| 50 | - | echo "Installation aborted: empty encryption password" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 51 | - | exit 1 | |
| 52 | - | fi | |
| 53 | - | ||
| 54 | - | LUKS_PASSWORD_CONFIRM=$(gum input --password --placeholder "Confirm encryption password" \ | |
| 55 | - | --prompt "Confirm: " \ | |
| 56 | - | --padding "0 0 0 $PADDING_LEFT") | |
| 57 | - | ||
| 58 | - | # Check if confirmation was cancelled | |
| 59 | - | if [ $? -ne 0 ]; then | |
| 60 | - | echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 61 | - | exit 130 | |
| 62 | - | fi | |
| 63 | - | ||
| 64 | - | if [ "$LUKS_PASSWORD" = "$LUKS_PASSWORD_CONFIRM" ]; then | |
| 65 | - | break | |
| 66 | - | else | |
| 67 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "Passwords do not match. Try again." | |
| 68 | - | fi | |
| 69 | - | done | |
| 70 | - | fi | |
| 71 | - | ||
| 72 | - | # Wipe any existing signatures on root partition to avoid conflicts | |
| 73 | - | wipefs -af "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 74 | - | ||
| 75 | - | # Setup LUKS with Argon2id and 2000ms iteration time | |
| 76 | - | # Use printf to avoid trailing newline that <<< adds | |
| 77 | - | printf '%s' "$LUKS_PASSWORD" | cryptsetup luksFormat \ | |
| 78 | - | --type luks2 \ | |
| 79 | - | --batch-mode \ | |
| 80 | - | --pbkdf argon2id \ | |
| 81 | - | --iter-time 2000 \ | |
| 82 | - | --label ARCHUP_LUKS \ | |
| 83 | - | --key-file - \ | |
| 84 | - | "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 85 | - | ||
| 86 | - | echo "LUKS container created" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 87 | - | ||
| 88 | - | # Open the encrypted container | |
| 89 | - | printf '%s' "$LUKS_PASSWORD" | cryptsetup open --key-file=- "$ARCHUP_ROOT_PART" cryptroot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 90 | - | ||
| 91 | - | echo "LUKS container opened" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 92 | - | ||
| 93 | - | # Clear password variables from memory | |
| 94 | - | unset LUKS_PASSWORD | |
| 95 | - | unset LUKS_PASSWORD_CONFIRM | |
| 96 | - | ||
| 97 | - | # Export the mapped device path | |
| 98 | - | export ARCHUP_CRYPT_ROOT="/dev/mapper/cryptroot" | |
| 99 | - | ||
| 100 | - | # Format the encrypted container with btrfs | |
| 101 | - | mkfs.btrfs -f -L ROOT "$ARCHUP_CRYPT_ROOT" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 102 | - | ||
| 103 | - | echo "Created LUKS container on $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 104 | - | echo "Formatted $ARCHUP_CRYPT_ROOT as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 105 | - | ||
| 106 | - | # Mount temporarily to create subvolumes | |
| 107 | - | mount "$ARCHUP_CRYPT_ROOT" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 108 | - | ||
| 109 | - | else | |
| 110 | - | # No encryption - format directly with btrfs | |
| 111 | - | mkfs.btrfs -f -L ROOT "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 112 | - | echo "Formatted $ARCHUP_ROOT_PART as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 113 | - | ||
| 114 | - | # Mount temporarily to create subvolumes | |
| 115 | - | mount "$ARCHUP_ROOT_PART" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 116 | - | fi | |
| 117 | - | ||
| 118 | - | # Create btrfs subvolumes | |
| 119 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating btrfs subvolumes..." | |
| 120 | - | ||
| 121 | - | btrfs subvolume create /mnt/@ >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 122 | - | btrfs subvolume create /mnt/@home >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 123 | - | ||
| 124 | - | echo "Created btrfs subvolume: @" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 125 | - | echo "Created btrfs subvolume: @home" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 126 | - | ||
| 127 | - | # Unmount temporary mount | |
| 128 | - | umount /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 129 | - | ||
| 130 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Partitions formatted and subvolumes created" | |
| 131 | - | echo "Partitions formatted and subvolumes created successfully" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,131 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Format partitions with btrfs and optional LUKS encryption | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Formatting partitions..." | |||
| 5 | - | ||||
| 6 | - | # Wipe any existing signatures on EFI partition | |||
| 7 | - | wipefs -af "$ARCHUP_EFI_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 8 | - | ||||
| 9 | - | # Format EFI partition as FAT32 | |||
| 10 | - | mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 11 | - | echo "Formatted $ARCHUP_EFI_PART as FAT32" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 12 | - | ||||
| 13 | - | # Handle root partition - with or without encryption | |||
| 14 | - | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |||
| 15 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Setting up LUKS encryption..." | |||
| 16 | - | ||||
| 17 | - | # Check if user wants to use same password or separate password | |||
| 18 | - | ARCHUP_ENCRYPTION_USE_SAME_PASSWORD=$(config_get "ARCHUP_ENCRYPTION_USE_SAME_PASSWORD") | |||
| 19 | - | ||||
| 20 | - | if [ "$ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" = "true" ]; then | |||
| 21 | - | # Use account password for encryption | |||
| 22 | - | LUKS_PASSWORD=$(config_get "ARCHUP_PASSWORD") | |||
| 23 | - | ||||
| 24 | - | if [ -z "$LUKS_PASSWORD" ]; then | |||
| 25 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "ERROR: Account password not set!" | |||
| 26 | - | echo "ERROR: Account password is empty during LUKS setup" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 27 | - | exit 1 | |||
| 28 | - | fi | |||
| 29 | - | else | |||
| 30 | - | # Prompt for separate encryption password | |||
| 31 | - | echo | |||
| 32 | - | gum style --foreground 6 --padding "0 0 0 $PADDING_LEFT" "Disk Encryption Password" | |||
| 33 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Enter a password to encrypt your disk (different from your account password)" | |||
| 34 | - | gum style --foreground 8 --padding "0 0 0 $PADDING_LEFT" "Press Ctrl+C to cancel or leave empty to abort" | |||
| 35 | - | ||||
| 36 | - | while true; do | |||
| 37 | - | LUKS_PASSWORD=$(gum input --password --placeholder "Enter encryption password" \ | |||
| 38 | - | --prompt "Password: " \ | |||
| 39 | - | --padding "0 0 0 $PADDING_LEFT") | |||
| 40 | - | ||||
| 41 | - | # Check if gum was cancelled (Ctrl+C returns exit code 130) | |||
| 42 | - | if [ $? -ne 0 ]; then | |||
| 43 | - | echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 44 | - | exit 130 | |||
| 45 | - | fi | |||
| 46 | - | ||||
| 47 | - | # Allow empty password to abort | |||
| 48 | - | if [ -z "$LUKS_PASSWORD" ]; then | |||
| 49 | - | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation aborted by user" | |||
| 50 | - | echo "Installation aborted: empty encryption password" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 51 | - | exit 1 | |||
| 52 | - | fi | |||
| 53 | - | ||||
| 54 | - | LUKS_PASSWORD_CONFIRM=$(gum input --password --placeholder "Confirm encryption password" \ | |||
| 55 | - | --prompt "Confirm: " \ | |||
| 56 | - | --padding "0 0 0 $PADDING_LEFT") | |||
| 57 | - | ||||
| 58 | - | # Check if confirmation was cancelled | |||
| 59 | - | if [ $? -ne 0 ]; then | |||
| 60 | - | echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 61 | - | exit 130 | |||
| 62 | - | fi | |||
| 63 | - | ||||
| 64 | - | if [ "$LUKS_PASSWORD" = "$LUKS_PASSWORD_CONFIRM" ]; then | |||
| 65 | - | break | |||
| 66 | - | else | |||
| 67 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "Passwords do not match. Try again." | |||
| 68 | - | fi | |||
| 69 | - | done | |||
| 70 | - | fi | |||
| 71 | - | ||||
| 72 | - | # Wipe any existing signatures on root partition to avoid conflicts | |||
| 73 | - | wipefs -af "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 74 | - | ||||
| 75 | - | # Setup LUKS with Argon2id and 2000ms iteration time | |||
| 76 | - | # Use printf to avoid trailing newline that <<< adds | |||
| 77 | - | printf '%s' "$LUKS_PASSWORD" | cryptsetup luksFormat \ | |||
| 78 | - | --type luks2 \ | |||
| 79 | - | --batch-mode \ | |||
| 80 | - | --pbkdf argon2id \ | |||
| 81 | - | --iter-time 2000 \ | |||
| 82 | - | --label ARCHUP_LUKS \ | |||
| 83 | - | --key-file - \ | |||
| 84 | - | "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 85 | - | ||||
| 86 | - | echo "LUKS container created" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 87 | - | ||||
| 88 | - | # Open the encrypted container | |||
| 89 | - | printf '%s' "$LUKS_PASSWORD" | cryptsetup open --key-file=- "$ARCHUP_ROOT_PART" cryptroot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 90 | - | ||||
| 91 | - | echo "LUKS container opened" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 92 | - | ||||
| 93 | - | # Clear password variables from memory | |||
| 94 | - | unset LUKS_PASSWORD | |||
| 95 | - | unset LUKS_PASSWORD_CONFIRM | |||
| 96 | - | ||||
| 97 | - | # Export the mapped device path | |||
| 98 | - | export ARCHUP_CRYPT_ROOT="/dev/mapper/cryptroot" | |||
| 99 | - | ||||
| 100 | - | # Format the encrypted container with btrfs | |||
| 101 | - | mkfs.btrfs -f -L ROOT "$ARCHUP_CRYPT_ROOT" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 102 | - | ||||
| 103 | - | echo "Created LUKS container on $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 104 | - | echo "Formatted $ARCHUP_CRYPT_ROOT as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 105 | - | ||||
| 106 | - | # Mount temporarily to create subvolumes | |||
| 107 | - | mount "$ARCHUP_CRYPT_ROOT" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 108 | - | ||||
| 109 | - | else | |||
| 110 | - | # No encryption - format directly with btrfs | |||
| 111 | - | mkfs.btrfs -f -L ROOT "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 112 | - | echo "Formatted $ARCHUP_ROOT_PART as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 113 | - | ||||
| 114 | - | # Mount temporarily to create subvolumes | |||
| 115 | - | mount "$ARCHUP_ROOT_PART" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 116 | - | fi | |||
| 117 | - | ||||
| 118 | - | # Create btrfs subvolumes | |||
| 119 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating btrfs subvolumes..." | |||
| 120 | - | ||||
| 121 | - | btrfs subvolume create /mnt/@ >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 122 | - | btrfs subvolume create /mnt/@home >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 123 | - | ||||
| 124 | - | echo "Created btrfs subvolume: @" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 125 | - | echo "Created btrfs subvolume: @home" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 126 | - | ||||
| 127 | - | # Unmount temporary mount | |||
| 128 | - | umount /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 129 | - | ||||
| 130 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Partitions formatted and subvolumes created" | |||
| 131 | - | echo "Partitions formatted and subvolumes created successfully" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
D install/deprecated/partitioning/mount.sh +0 -33
| @@ -1,33 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Mount btrfs subvolumes to /mnt | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Mounting partitions..." | |
| 5 | - | ||
| 6 | - | # Determine which device to mount (encrypted or not) | |
| 7 | - | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |
| 8 | - | MOUNT_DEVICE="$ARCHUP_CRYPT_ROOT" | |
| 9 | - | else | |
| 10 | - | MOUNT_DEVICE="$ARCHUP_ROOT_PART" | |
| 11 | - | fi | |
| 12 | - | ||
| 13 | - | # Mount @ subvolume as root with optimal btrfs options | |
| 14 | - | mount -o noatime,compress=zstd,subvol=@ "$MOUNT_DEVICE" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 15 | - | ||
| 16 | - | echo "Mounted @ subvolume to /mnt" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 17 | - | ||
| 18 | - | # Create home directory | |
| 19 | - | mkdir -p /mnt/home >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 20 | - | ||
| 21 | - | # Mount @home subvolume | |
| 22 | - | mount -o noatime,compress=zstd,subvol=@home "$MOUNT_DEVICE" /mnt/home >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 23 | - | ||
| 24 | - | echo "Mounted @home subvolume to /mnt/home" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 25 | - | ||
| 26 | - | # Create and mount EFI directory | |
| 27 | - | mkdir -p /mnt/boot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 28 | - | mount "$ARCHUP_EFI_PART" /mnt/boot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 29 | - | ||
| 30 | - | echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 31 | - | ||
| 32 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Partitions mounted" | |
| 33 | - | echo "Partitions mounted successfully" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,33 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Mount btrfs subvolumes to /mnt | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Mounting partitions..." | |||
| 5 | - | ||||
| 6 | - | # Determine which device to mount (encrypted or not) | |||
| 7 | - | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |||
| 8 | - | MOUNT_DEVICE="$ARCHUP_CRYPT_ROOT" | |||
| 9 | - | else | |||
| 10 | - | MOUNT_DEVICE="$ARCHUP_ROOT_PART" | |||
| 11 | - | fi | |||
| 12 | - | ||||
| 13 | - | # Mount @ subvolume as root with optimal btrfs options | |||
| 14 | - | mount -o noatime,compress=zstd,subvol=@ "$MOUNT_DEVICE" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 15 | - | ||||
| 16 | - | echo "Mounted @ subvolume to /mnt" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 17 | - | ||||
| 18 | - | # Create home directory | |||
| 19 | - | mkdir -p /mnt/home >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 20 | - | ||||
| 21 | - | # Mount @home subvolume | |||
| 22 | - | mount -o noatime,compress=zstd,subvol=@home "$MOUNT_DEVICE" /mnt/home >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 23 | - | ||||
| 24 | - | echo "Mounted @home subvolume to /mnt/home" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 25 | - | ||||
| 26 | - | # Create and mount EFI directory | |||
| 27 | - | mkdir -p /mnt/boot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 28 | - | mount "$ARCHUP_EFI_PART" /mnt/boot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 29 | - | ||||
| 30 | - | echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 31 | - | ||||
| 32 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Partitions mounted" | |||
| 33 | - | echo "Partitions mounted successfully" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
D install/deprecated/partitioning/partition.sh +0 -36
| @@ -1,36 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Auto-partition disk with GPT layout (EFI + root) | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating partitions..." | |
| 5 | - | ||
| 6 | - | # Wipe disk and create GPT partition table | |
| 7 | - | wipefs -af "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 8 | - | sgdisk --zap-all "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 9 | - | ||
| 10 | - | # Create partitions | |
| 11 | - | # 1. EFI partition (512MB) | |
| 12 | - | # 2. Root partition (remaining space) | |
| 13 | - | sgdisk --clear \ | |
| 14 | - | --new=1:0:+512M --typecode=1:ef00 --change-name=1:"EFI" \ | |
| 15 | - | --new=2:0:0 --typecode=2:8300 --change-name=2:"ROOT" \ | |
| 16 | - | "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 17 | - | ||
| 18 | - | # Inform kernel of partition changes | |
| 19 | - | partprobe "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 20 | - | sleep 1 | |
| 21 | - | ||
| 22 | - | # Set partition variables | |
| 23 | - | if [[ "$ARCHUP_DISK" =~ nvme ]]; then | |
| 24 | - | export ARCHUP_EFI_PART="${ARCHUP_DISK}p1" | |
| 25 | - | export ARCHUP_ROOT_PART="${ARCHUP_DISK}p2" | |
| 26 | - | else | |
| 27 | - | export ARCHUP_EFI_PART="${ARCHUP_DISK}1" | |
| 28 | - | export ARCHUP_ROOT_PART="${ARCHUP_DISK}2" | |
| 29 | - | fi | |
| 30 | - | ||
| 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)" | |
| 33 | - | gum style --padding "0 0 1 $PADDING_LEFT" " Root: $ARCHUP_ROOT_PART" | |
| 34 | - | ||
| 35 | - | echo "EFI partition: $ARCHUP_EFI_PART" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 36 | - | echo "Root partition: $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,36 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Auto-partition disk with GPT layout (EFI + root) | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating partitions..." | |||
| 5 | - | ||||
| 6 | - | # Wipe disk and create GPT partition table | |||
| 7 | - | wipefs -af "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 8 | - | sgdisk --zap-all "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 9 | - | ||||
| 10 | - | # Create partitions | |||
| 11 | - | # 1. EFI partition (512MB) | |||
| 12 | - | # 2. Root partition (remaining space) | |||
| 13 | - | sgdisk --clear \ | |||
| 14 | - | --new=1:0:+512M --typecode=1:ef00 --change-name=1:"EFI" \ | |||
| 15 | - | --new=2:0:0 --typecode=2:8300 --change-name=2:"ROOT" \ | |||
| 16 | - | "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 17 | - | ||||
| 18 | - | # Inform kernel of partition changes | |||
| 19 | - | partprobe "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 20 | - | sleep 1 | |||
| 21 | - | ||||
| 22 | - | # Set partition variables | |||
| 23 | - | if [[ "$ARCHUP_DISK" =~ nvme ]]; then | |||
| 24 | - | export ARCHUP_EFI_PART="${ARCHUP_DISK}p1" | |||
| 25 | - | export ARCHUP_ROOT_PART="${ARCHUP_DISK}p2" | |||
| 26 | - | else | |||
| 27 | - | export ARCHUP_EFI_PART="${ARCHUP_DISK}1" | |||
| 28 | - | export ARCHUP_ROOT_PART="${ARCHUP_DISK}2" | |||
| 29 | - | fi | |||
| 30 | - | ||||
| 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)" | |||
| 33 | - | gum style --padding "0 0 1 $PADDING_LEFT" " Root: $ARCHUP_ROOT_PART" | |||
| 34 | - | ||||
| 35 | - | echo "EFI partition: $ARCHUP_EFI_PART" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 36 | - | echo "Root partition: $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
D install/deprecated/post-install/all.sh +0 -12
| @@ -1,12 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Post-install phase: Final touches after system is configured | |
| 3 | - | ||
| 4 | - | source "$ARCHUP_INSTALL/post-install/boot-logo.sh" | |
| 5 | - | source "$ARCHUP_INSTALL/post-install/plymouth.sh" | |
| 6 | - | source "$ARCHUP_INSTALL/post-install/snapper.sh" | |
| 7 | - | source "$ARCHUP_INSTALL/post-install/pacman.sh" | |
| 8 | - | source "$ARCHUP_INSTALL/post-install/post-boot-setup.sh" | |
| 9 | - | source "$ARCHUP_INSTALL/post-install/hooks.sh" | |
| 10 | - | source "$ARCHUP_INSTALL/post-install/shell-config.sh" | |
| 11 | - | source "$ARCHUP_INSTALL/post-install/verify.sh" | |
| 12 | - | # source "$ARCHUP_INSTALL/post-install/unmount.sh" # DISABLED FOR DEBUGGING | |
| @@ -1,12 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Post-install phase: Final touches after system is configured | |||
| 3 | - | ||||
| 4 | - | source "$ARCHUP_INSTALL/post-install/boot-logo.sh" | |||
| 5 | - | source "$ARCHUP_INSTALL/post-install/plymouth.sh" | |||
| 6 | - | source "$ARCHUP_INSTALL/post-install/snapper.sh" | |||
| 7 | - | source "$ARCHUP_INSTALL/post-install/pacman.sh" | |||
| 8 | - | source "$ARCHUP_INSTALL/post-install/post-boot-setup.sh" | |||
| 9 | - | source "$ARCHUP_INSTALL/post-install/hooks.sh" | |||
| 10 | - | source "$ARCHUP_INSTALL/post-install/shell-config.sh" | |||
| 11 | - | source "$ARCHUP_INSTALL/post-install/verify.sh" | |||
| 12 | - | # source "$ARCHUP_INSTALL/post-install/unmount.sh" # DISABLED FOR DEBUGGING | |||
D install/deprecated/post-install/boot-logo.sh +0 -16
| @@ -1,16 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Download and configure Limine boot logo | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing boot logo..." | |
| 5 | - | ||
| 6 | - | # Download logo directly to boot partition (no chroot needed, boot is mounted at /mnt/boot) | |
| 7 | - | curl -fsSL "$ARCHUP_RAW_URL/assets/Arch_Linux__Crystal__icon.png" \ | |
| 8 | - | -o /mnt/boot/arch-logo.png >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 9 | - | ||
| 10 | - | if [ -f /mnt/boot/arch-logo.png ]; then | |
| 11 | - | if [ -f /mnt/boot/EFI/limine/limine.conf ]; then | |
| 12 | - | sed -i '/^graphics: yes$/a wallpaper: boot():/arch-logo.png\nwallpaper_style: centered\nbackdrop: 000000' \ | |
| 13 | - | /mnt/boot/EFI/limine/limine.conf | |
| 14 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Boot logo installed" | |
| 15 | - | fi | |
| 16 | - | fi | |
| @@ -1,16 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Download and configure Limine boot logo | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing boot logo..." | |||
| 5 | - | ||||
| 6 | - | # Download logo directly to boot partition (no chroot needed, boot is mounted at /mnt/boot) | |||
| 7 | - | curl -fsSL "$ARCHUP_RAW_URL/assets/Arch_Linux__Crystal__icon.png" \ | |||
| 8 | - | -o /mnt/boot/arch-logo.png >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 9 | - | ||||
| 10 | - | if [ -f /mnt/boot/arch-logo.png ]; then | |||
| 11 | - | if [ -f /mnt/boot/EFI/limine/limine.conf ]; then | |||
| 12 | - | sed -i '/^graphics: yes$/a wallpaper: boot():/arch-logo.png\nwallpaper_style: centered\nbackdrop: 000000' \ | |||
| 13 | - | /mnt/boot/EFI/limine/limine.conf | |||
| 14 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Boot logo installed" | |||
| 15 | - | fi | |||
| 16 | - | fi | |||
D install/deprecated/post-install/hooks.sh +0 -24
| @@ -1,24 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Install pacman hooks for automatic system maintenance | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing pacman hooks..." | |
| 5 | - | ||
| 6 | - | mkdir -p /mnt/etc/pacman.d/hooks | |
| 7 | - | ||
| 8 | - | # Limine bootloader auto-update hook | |
| 9 | - | cat > /mnt/etc/pacman.d/hooks/99-limine.hook <<'EOF' | |
| 10 | - | [Trigger] | |
| 11 | - | Operation = Install | |
| 12 | - | Operation = Upgrade | |
| 13 | - | Type = Package | |
| 14 | - | Target = limine | |
| 15 | - | ||
| 16 | - | [Action] | |
| 17 | - | Description = Deploying Limine after upgrade... | |
| 18 | - | When = PostTransaction | |
| 19 | - | Exec = /usr/bin/cp /usr/share/limine/BOOTX64.EFI /boot/EFI/limine/ | |
| 20 | - | EOF | |
| 21 | - | ||
| 22 | - | echo "Installed Limine update hook" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 23 | - | ||
| 24 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Pacman hooks installed" | |
| @@ -1,24 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Install pacman hooks for automatic system maintenance | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing pacman hooks..." | |||
| 5 | - | ||||
| 6 | - | mkdir -p /mnt/etc/pacman.d/hooks | |||
| 7 | - | ||||
| 8 | - | # Limine bootloader auto-update hook | |||
| 9 | - | cat > /mnt/etc/pacman.d/hooks/99-limine.hook <<'EOF' | |||
| 10 | - | [Trigger] | |||
| 11 | - | Operation = Install | |||
| 12 | - | Operation = Upgrade | |||
| 13 | - | Type = Package | |||
| 14 | - | Target = limine | |||
| 15 | - | ||||
| 16 | - | [Action] | |||
| 17 | - | Description = Deploying Limine after upgrade... | |||
| 18 | - | When = PostTransaction | |||
| 19 | - | Exec = /usr/bin/cp /usr/share/limine/BOOTX64.EFI /boot/EFI/limine/ | |||
| 20 | - | EOF | |||
| 21 | - | ||||
| 22 | - | echo "Installed Limine update hook" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 23 | - | ||||
| 24 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Pacman hooks installed" | |||
D install/deprecated/post-install/pacman.sh +0 -17
| @@ -1,17 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Configure pacman for better UX | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring pacman..." | |
| 5 | - | ||
| 6 | - | # Enable Color output | |
| 7 | - | sed -i 's/^#Color$/Color/' /mnt/etc/pacman.conf | |
| 8 | - | ||
| 9 | - | # Enable ParallelDownloads | |
| 10 | - | sed -i 's/^#ParallelDownloads = 5$/ParallelDownloads = 5/' /mnt/etc/pacman.conf | |
| 11 | - | ||
| 12 | - | # Enable ILoveCandy (Pac-Man progress bar) | |
| 13 | - | sed -i '/^Color$/a ILoveCandy' /mnt/etc/pacman.conf | |
| 14 | - | ||
| 15 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Pacman configured (color, parallel downloads, candy)" | |
| 16 | - | ||
| 17 | - | echo "Pacman configured: Color, ParallelDownloads=5, ILoveCandy" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,17 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Configure pacman for better UX | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring pacman..." | |||
| 5 | - | ||||
| 6 | - | # Enable Color output | |||
| 7 | - | sed -i 's/^#Color$/Color/' /mnt/etc/pacman.conf | |||
| 8 | - | ||||
| 9 | - | # Enable ParallelDownloads | |||
| 10 | - | sed -i 's/^#ParallelDownloads = 5$/ParallelDownloads = 5/' /mnt/etc/pacman.conf | |||
| 11 | - | ||||
| 12 | - | # Enable ILoveCandy (Pac-Man progress bar) | |||
| 13 | - | sed -i '/^Color$/a ILoveCandy' /mnt/etc/pacman.conf | |||
| 14 | - | ||||
| 15 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Pacman configured (color, parallel downloads, candy)" | |||
| 16 | - | ||||
| 17 | - | echo "Pacman configured: Color, ParallelDownloads=5, ILoveCandy" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
D install/deprecated/post-install/plymouth.sh +0 -38
| @@ -1,38 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Configure Plymouth splash screen with ArchUp theme | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring Plymouth splash screen..." | |
| 5 | - | ||
| 6 | - | THEME_NAME="archup" | |
| 7 | - | THEME_DIR="/mnt/usr/share/plymouth/themes/$THEME_NAME" | |
| 8 | - | ||
| 9 | - | # Create theme directory | |
| 10 | - | mkdir -p "$THEME_DIR" | |
| 11 | - | ||
| 12 | - | # Download all Plymouth theme files from GitHub | |
| 13 | - | PLYMOUTH_FILES=( | |
| 14 | - | "archup.plymouth" | |
| 15 | - | "archup.script" | |
| 16 | - | "logo.png" | |
| 17 | - | "bullet.png" | |
| 18 | - | "entry.png" | |
| 19 | - | "lock.png" | |
| 20 | - | "progress_bar.png" | |
| 21 | - | "progress_box.png" | |
| 22 | - | ) | |
| 23 | - | ||
| 24 | - | for file in "${PLYMOUTH_FILES[@]}"; do | |
| 25 | - | curl -fsSL "$ARCHUP_RAW_URL/assets/plymouth/$file" \ | |
| 26 | - | -o "$THEME_DIR/$file" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 27 | - | done | |
| 28 | - | ||
| 29 | - | # Set permissions | |
| 30 | - | chmod 644 "$THEME_DIR"/* | |
| 31 | - | ||
| 32 | - | # Set as default theme | |
| 33 | - | arch-chroot /mnt plymouth-set-default-theme "$THEME_NAME" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 34 | - | ||
| 35 | - | # Regenerate initramfs with Plymouth | |
| 36 | - | arch-chroot /mnt mkinitcpio -P >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 37 | - | ||
| 38 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Plymouth configured" | |
| @@ -1,38 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Configure Plymouth splash screen with ArchUp theme | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring Plymouth splash screen..." | |||
| 5 | - | ||||
| 6 | - | THEME_NAME="archup" | |||
| 7 | - | THEME_DIR="/mnt/usr/share/plymouth/themes/$THEME_NAME" | |||
| 8 | - | ||||
| 9 | - | # Create theme directory | |||
| 10 | - | mkdir -p "$THEME_DIR" | |||
| 11 | - | ||||
| 12 | - | # Download all Plymouth theme files from GitHub | |||
| 13 | - | PLYMOUTH_FILES=( | |||
| 14 | - | "archup.plymouth" | |||
| 15 | - | "archup.script" | |||
| 16 | - | "logo.png" | |||
| 17 | - | "bullet.png" | |||
| 18 | - | "entry.png" | |||
| 19 | - | "lock.png" | |||
| 20 | - | "progress_bar.png" | |||
| 21 | - | "progress_box.png" | |||
| 22 | - | ) | |||
| 23 | - | ||||
| 24 | - | for file in "${PLYMOUTH_FILES[@]}"; do | |||
| 25 | - | curl -fsSL "$ARCHUP_RAW_URL/assets/plymouth/$file" \ | |||
| 26 | - | -o "$THEME_DIR/$file" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 27 | - | done | |||
| 28 | - | ||||
| 29 | - | # Set permissions | |||
| 30 | - | chmod 644 "$THEME_DIR"/* | |||
| 31 | - | ||||
| 32 | - | # Set as default theme | |||
| 33 | - | arch-chroot /mnt plymouth-set-default-theme "$THEME_NAME" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 34 | - | ||||
| 35 | - | # Regenerate initramfs with Plymouth | |||
| 36 | - | arch-chroot /mnt mkinitcpio -P >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 37 | - | ||||
| 38 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Plymouth configured" | |||
D install/deprecated/post-install/post-boot-setup.sh +0 -36
| @@ -1,36 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Setup post-boot scripts and first-boot service | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Setting up first-boot service..." | |
| 5 | - | ||
| 6 | - | # Create post-boot directory | |
| 7 | - | mkdir -p /mnt/usr/local/share/archup/post-boot | |
| 8 | - | ||
| 9 | - | # Copy logo | |
| 10 | - | cp "$ARCHUP_PATH/logo.txt" /mnt/usr/local/share/archup/ | |
| 11 | - | ||
| 12 | - | # Copy all post-boot scripts | |
| 13 | - | cp "$ARCHUP_INSTALL/post-boot/all.sh" /mnt/usr/local/share/archup/post-boot/ | |
| 14 | - | cp "$ARCHUP_INSTALL/post-boot/snapper.sh" /mnt/usr/local/share/archup/post-boot/ | |
| 15 | - | cp "$ARCHUP_INSTALL/post-boot/ufw.sh" /mnt/usr/local/share/archup/post-boot/ | |
| 16 | - | cp "$ARCHUP_INSTALL/post-boot/ssh-keygen.sh" /mnt/usr/local/share/archup/post-boot/ | |
| 17 | - | cp "$ARCHUP_INSTALL/post-boot/archup-cli.sh" /mnt/usr/local/share/archup/post-boot/ | |
| 18 | - | cp "$ARCHUP_INSTALL/post-boot/blesh.sh" /mnt/usr/local/share/archup/post-boot/ | |
| 19 | - | ||
| 20 | - | # Make all scripts executable | |
| 21 | - | chmod +x /mnt/usr/local/share/archup/post-boot/*.sh | |
| 22 | - | ||
| 23 | - | # Install systemd service (substitute email and username) | |
| 24 | - | sed "s|__ARCHUP_EMAIL__|$(config_get "ARCHUP_EMAIL")|g; s|__ARCHUP_USERNAME__|$(config_get "ARCHUP_USERNAME")|g" \ | |
| 25 | - | "$ARCHUP_INSTALL/post-boot/archup-first-boot.service" > /mnt/etc/systemd/system/archup-first-boot.service | |
| 26 | - | ||
| 27 | - | # Enable the service | |
| 28 | - | arch-chroot /mnt systemctl enable archup-first-boot.service >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 29 | - | ||
| 30 | - | echo "First-boot service will run on first reboot to:" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 31 | - | echo " - Configure snapper snapshots" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 32 | - | echo " - Generate SSH keys" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 33 | - | echo " - Build and install archup-cli from GitHub" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 34 | - | echo " - Install and configure ble.sh (Bash Line Editor)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 35 | - | ||
| 36 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] First-boot service configured" | |
| @@ -1,36 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Setup post-boot scripts and first-boot service | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Setting up first-boot service..." | |||
| 5 | - | ||||
| 6 | - | # Create post-boot directory | |||
| 7 | - | mkdir -p /mnt/usr/local/share/archup/post-boot | |||
| 8 | - | ||||
| 9 | - | # Copy logo | |||
| 10 | - | cp "$ARCHUP_PATH/logo.txt" /mnt/usr/local/share/archup/ | |||
| 11 | - | ||||
| 12 | - | # Copy all post-boot scripts | |||
| 13 | - | cp "$ARCHUP_INSTALL/post-boot/all.sh" /mnt/usr/local/share/archup/post-boot/ | |||
| 14 | - | cp "$ARCHUP_INSTALL/post-boot/snapper.sh" /mnt/usr/local/share/archup/post-boot/ | |||
| 15 | - | cp "$ARCHUP_INSTALL/post-boot/ufw.sh" /mnt/usr/local/share/archup/post-boot/ | |||
| 16 | - | cp "$ARCHUP_INSTALL/post-boot/ssh-keygen.sh" /mnt/usr/local/share/archup/post-boot/ | |||
| 17 | - | cp "$ARCHUP_INSTALL/post-boot/archup-cli.sh" /mnt/usr/local/share/archup/post-boot/ | |||
| 18 | - | cp "$ARCHUP_INSTALL/post-boot/blesh.sh" /mnt/usr/local/share/archup/post-boot/ | |||
| 19 | - | ||||
| 20 | - | # Make all scripts executable | |||
| 21 | - | chmod +x /mnt/usr/local/share/archup/post-boot/*.sh | |||
| 22 | - | ||||
| 23 | - | # Install systemd service (substitute email and username) | |||
| 24 | - | sed "s|__ARCHUP_EMAIL__|$(config_get "ARCHUP_EMAIL")|g; s|__ARCHUP_USERNAME__|$(config_get "ARCHUP_USERNAME")|g" \ | |||
| 25 | - | "$ARCHUP_INSTALL/post-boot/archup-first-boot.service" > /mnt/etc/systemd/system/archup-first-boot.service | |||
| 26 | - | ||||
| 27 | - | # Enable the service | |||
| 28 | - | arch-chroot /mnt systemctl enable archup-first-boot.service >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 29 | - | ||||
| 30 | - | echo "First-boot service will run on first reboot to:" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 31 | - | echo " - Configure snapper snapshots" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 32 | - | echo " - Generate SSH keys" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 33 | - | echo " - Build and install archup-cli from GitHub" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 34 | - | echo " - Install and configure ble.sh (Bash Line Editor)" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 35 | - | ||||
| 36 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] First-boot service configured" | |||
D install/deprecated/post-install/shell-config.sh +0 -202
| @@ -1,202 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Configure bash shell with archup default structure | |
| 3 | - | ||
| 4 | - | # Get the username created during installation | |
| 5 | - | USERNAME=$(arch-chroot /mnt ls /home | head -1) | |
| 6 | - | ||
| 7 | - | if [[ -z "${USERNAME}" ]]; then | |
| 8 | - | echo "ERROR: Could not find user for shell configuration" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 9 | - | exit 1 | |
| 10 | - | fi | |
| 11 | - | ||
| 12 | - | USER_HOME="/mnt/home/$USERNAME" | |
| 13 | - | ARCHUP_DEFAULT="$USER_HOME/.local/share/archup/default" | |
| 14 | - | ARCHUP_DEFAULT_BASH="$ARCHUP_DEFAULT/bash" | |
| 15 | - | ||
| 16 | - | echo "Configuring bash shell for $USERNAME..." >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 17 | - | ||
| 18 | - | # Create archup default directory structure | |
| 19 | - | mkdir -p "$ARCHUP_DEFAULT_BASH" | |
| 20 | - | ||
| 21 | - | # Create shell configuration (history, bash-completion, PATH) | |
| 22 | - | cat > "$ARCHUP_DEFAULT_BASH/shell" << 'SHELL_END' | |
| 23 | - | # History control | |
| 24 | - | shopt -s histappend | |
| 25 | - | HISTCONTROL=ignoreboth | |
| 26 | - | HISTSIZE=32768 | |
| 27 | - | HISTFILESIZE="${HISTSIZE}" | |
| 28 | - | ||
| 29 | - | # Bash completion | |
| 30 | - | if [[ ! -v BASH_COMPLETION_VERSINFO && -f /usr/share/bash-completion/bash_completion ]]; then | |
| 31 | - | source /usr/share/bash-completion/bash_completion | |
| 32 | - | fi | |
| 33 | - | ||
| 34 | - | # Set complete path | |
| 35 | - | export PATH="$HOME/.local/bin:$PATH" | |
| 36 | - | set +h | |
| 37 | - | SHELL_END | |
| 38 | - | ||
| 39 | - | # Create starship configuration with Arch blue colors | |
| 40 | - | cat > "$ARCHUP_DEFAULT/starship.toml" << 'STARSHIP_END' | |
| 41 | - | # Arch-inspired blue color scheme | |
| 42 | - | add_newline = true | |
| 43 | - | ||
| 44 | - | [username] | |
| 45 | - | show_always = true | |
| 46 | - | style_user = "fg:#87ceeb" | |
| 47 | - | style_root = "fg:#ff6b8a" | |
| 48 | - | format = "[$user]($style) " | |
| 49 | - | ||
| 50 | - | [hostname] | |
| 51 | - | disabled = true | |
| 52 | - | ||
| 53 | - | [directory] | |
| 54 | - | style = "fg:#e8f4f8" | |
| 55 | - | format = "in [$path]($style) " | |
| 56 | - | ||
| 57 | - | [git_branch] | |
| 58 | - | symbol = " " | |
| 59 | - | style = "fg:#6bb6d6" | |
| 60 | - | format = "on [$symbol$branch]($style) " | |
| 61 | - | ||
| 62 | - | [character] | |
| 63 | - | success_symbol = '[❯](fg:#6bb6d6)' | |
| 64 | - | error_symbol = '[✗](fg:#ff6b8a)' | |
| 65 | - | STARSHIP_END | |
| 66 | - | ||
| 67 | - | # Create init configuration (starship, zoxide, fzf) | |
| 68 | - | cat > "$ARCHUP_DEFAULT_BASH/init" << 'INIT_END' | |
| 69 | - | # Starship prompt | |
| 70 | - | if command -v starship &> /dev/null; then | |
| 71 | - | export STARSHIP_CONFIG="$HOME/.local/share/archup/default/starship.toml" | |
| 72 | - | eval "$(starship init bash)" | |
| 73 | - | fi | |
| 74 | - | ||
| 75 | - | # Zoxide (smarter cd) | |
| 76 | - | if command -v zoxide &> /dev/null; then | |
| 77 | - | eval "$(zoxide init bash)" | |
| 78 | - | fi | |
| 79 | - | ||
| 80 | - | # FZF fuzzy finder | |
| 81 | - | if command -v fzf &> /dev/null; then | |
| 82 | - | eval "$(fzf --bash)" | |
| 83 | - | fi | |
| 84 | - | INIT_END | |
| 85 | - | ||
| 86 | - | # Create aliases configuration | |
| 87 | - | cat > "$ARCHUP_DEFAULT_BASH/aliases" << 'ALIASES_END' | |
| 88 | - | # Eza aliases (modern ls replacement) | |
| 89 | - | if command -v eza &> /dev/null; then | |
| 90 | - | alias ls='eza -lh --group-directories-first --icons=auto' | |
| 91 | - | alias lsa='ls -a' | |
| 92 | - | alias lt='eza --tree --level=2 --long --icons --git' | |
| 93 | - | alias lta='lt -a' | |
| 94 | - | alias ll='eza -l --icons=auto' | |
| 95 | - | alias la='eza -la --icons=auto' | |
| 96 | - | fi | |
| 97 | - | ||
| 98 | - | # Bat + FZF integration | |
| 99 | - | if command -v bat &> /dev/null && command -v fzf &> /dev/null; then | |
| 100 | - | alias ff="fzf --preview 'bat -n --color=always {}' --preview-window right:60%:wrap" | |
| 101 | - | fi | |
| 102 | - | ||
| 103 | - | # Bat aliases | |
| 104 | - | if command -v bat &> /dev/null; then | |
| 105 | - | alias cat='bat -pp' | |
| 106 | - | alias less='bat' | |
| 107 | - | fi | |
| 108 | - | ||
| 109 | - | # Fd alias (modern find replacement) | |
| 110 | - | if command -v fd &> /dev/null; then | |
| 111 | - | alias find='fd' | |
| 112 | - | fi | |
| 113 | - | ||
| 114 | - | # Directories | |
| 115 | - | alias ..='cd ..' | |
| 116 | - | alias ...='cd ../..' | |
| 117 | - | alias ....='cd ../../..' | |
| 118 | - | ||
| 119 | - | # Git shortcuts | |
| 120 | - | alias g='git' | |
| 121 | - | alias gs='git status' | |
| 122 | - | alias ga='git add' | |
| 123 | - | alias gc='git commit' | |
| 124 | - | alias gp='git push' | |
| 125 | - | alias gl='git log --oneline --graph --decorate' | |
| 126 | - | ALIASES_END | |
| 127 | - | ||
| 128 | - | # Create envs configuration (environment variables) | |
| 129 | - | cat > "$ARCHUP_DEFAULT_BASH/envs" << 'ENVS_END' | |
| 130 | - | # Bat configuration | |
| 131 | - | if command -v bat &> /dev/null; then | |
| 132 | - | export BAT_THEME="TwoDark" | |
| 133 | - | fi | |
| 134 | - | ||
| 135 | - | # FZF configuration | |
| 136 | - | # Note: Do NOT add --preview to FZF_DEFAULT_OPTS as it breaks non-file operations | |
| 137 | - | if command -v fzf &> /dev/null; then | |
| 138 | - | # CTRL-T file/directory picker options | |
| 139 | - | if command -v bat &> /dev/null; then | |
| 140 | - | export FZF_CTRL_T_OPTS="--preview 'bat -n --color=always {}' --preview-window right:60%:wrap" | |
| 141 | - | fi | |
| 142 | - | ||
| 143 | - | # ALT-C directory navigation options | |
| 144 | - | if command -v tree &> /dev/null; then | |
| 145 | - | export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -200' --preview-window right:60%:wrap" | |
| 146 | - | fi | |
| 147 | - | fi | |
| 148 | - | ENVS_END | |
| 149 | - | ||
| 150 | - | # Create functions configuration | |
| 151 | - | cat > "$ARCHUP_DEFAULT_BASH/functions" << 'FUNCTIONS_END' | |
| 152 | - | # Zoxide cd wrapper | |
| 153 | - | if command -v zoxide &> /dev/null; then | |
| 154 | - | zd() { | |
| 155 | - | if [ $# -eq 0 ]; then | |
| 156 | - | builtin cd ~ && return | |
| 157 | - | elif [ -d "$1" ]; then | |
| 158 | - | builtin cd "$1" | |
| 159 | - | else | |
| 160 | - | z "$@" || echo "Error: Directory not found" | |
| 161 | - | fi | |
| 162 | - | } | |
| 163 | - | alias cd="zd" | |
| 164 | - | fi | |
| 165 | - | FUNCTIONS_END | |
| 166 | - | ||
| 167 | - | # Create rc file that sources everything | |
| 168 | - | cat > "$ARCHUP_DEFAULT_BASH/rc" << 'RC_END' | |
| 169 | - | source ~/.local/share/archup/default/bash/shell | |
| 170 | - | source ~/.local/share/archup/default/bash/init | |
| 171 | - | source ~/.local/share/archup/default/bash/aliases | |
| 172 | - | source ~/.local/share/archup/default/bash/envs | |
| 173 | - | source ~/.local/share/archup/default/bash/functions | |
| 174 | - | RC_END | |
| 175 | - | ||
| 176 | - | # Create user .bashrc that sources archup defaults | |
| 177 | - | cat > "$USER_HOME/.bashrc" << 'BASHRC_END' | |
| 178 | - | # All the default ArchUp aliases and functions | |
| 179 | - | # (don't mess with these directly, just override them here!) | |
| 180 | - | source ~/.local/share/archup/default/bash/rc | |
| 181 | - | ||
| 182 | - | # Add your own exports, aliases, and functions here. | |
| 183 | - | # | |
| 184 | - | # Make an alias for invoking commands you use constantly | |
| 185 | - | # alias p='python' | |
| 186 | - | BASHRC_END | |
| 187 | - | ||
| 188 | - | # Configure git to use delta for diffs | |
| 189 | - | arch-chroot /mnt su - "$USERNAME" -c "git config --global core.pager delta" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 190 | - | arch-chroot /mnt su - "$USERNAME" -c "git config --global interactive.diffFilter 'delta --color-only'" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 191 | - | arch-chroot /mnt su - "$USERNAME" -c "git config --global delta.navigate true" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 192 | - | arch-chroot /mnt su - "$USERNAME" -c "git config --global delta.light false" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 193 | - | arch-chroot /mnt su - "$USERNAME" -c "git config --global delta.side-by-side true" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 194 | - | arch-chroot /mnt su - "$USERNAME" -c "git config --global merge.conflictstyle diff3" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 195 | - | arch-chroot /mnt su - "$USERNAME" -c "git config --global diff.colorMoved default" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 196 | - | ||
| 197 | - | # Set ownership (paths relative to chroot, not host) | |
| 198 | - | arch-chroot /mnt chown -R "$USERNAME:$USERNAME" "/home/$USERNAME/.local" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 199 | - | arch-chroot /mnt chown "$USERNAME:$USERNAME" "/home/$USERNAME/.bashrc" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 200 | - | ||
| 201 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Shell configured" | |
| 202 | - | echo "Configured shell for user: $USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,202 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Configure bash shell with archup default structure | |||
| 3 | - | ||||
| 4 | - | # Get the username created during installation | |||
| 5 | - | USERNAME=$(arch-chroot /mnt ls /home | head -1) | |||
| 6 | - | ||||
| 7 | - | if [[ -z "${USERNAME}" ]]; then | |||
| 8 | - | echo "ERROR: Could not find user for shell configuration" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 9 | - | exit 1 | |||
| 10 | - | fi | |||
| 11 | - | ||||
| 12 | - | USER_HOME="/mnt/home/$USERNAME" | |||
| 13 | - | ARCHUP_DEFAULT="$USER_HOME/.local/share/archup/default" | |||
| 14 | - | ARCHUP_DEFAULT_BASH="$ARCHUP_DEFAULT/bash" | |||
| 15 | - | ||||
| 16 | - | echo "Configuring bash shell for $USERNAME..." >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 17 | - | ||||
| 18 | - | # Create archup default directory structure | |||
| 19 | - | mkdir -p "$ARCHUP_DEFAULT_BASH" | |||
| 20 | - | ||||
| 21 | - | # Create shell configuration (history, bash-completion, PATH) | |||
| 22 | - | cat > "$ARCHUP_DEFAULT_BASH/shell" << 'SHELL_END' | |||
| 23 | - | # History control | |||
| 24 | - | shopt -s histappend | |||
| 25 | - | HISTCONTROL=ignoreboth | |||
| 26 | - | HISTSIZE=32768 | |||
| 27 | - | HISTFILESIZE="${HISTSIZE}" | |||
| 28 | - | ||||
| 29 | - | # Bash completion | |||
| 30 | - | if [[ ! -v BASH_COMPLETION_VERSINFO && -f /usr/share/bash-completion/bash_completion ]]; then | |||
| 31 | - | source /usr/share/bash-completion/bash_completion | |||
| 32 | - | fi | |||
| 33 | - | ||||
| 34 | - | # Set complete path | |||
| 35 | - | export PATH="$HOME/.local/bin:$PATH" | |||
| 36 | - | set +h | |||
| 37 | - | SHELL_END | |||
| 38 | - | ||||
| 39 | - | # Create starship configuration with Arch blue colors | |||
| 40 | - | cat > "$ARCHUP_DEFAULT/starship.toml" << 'STARSHIP_END' | |||
| 41 | - | # Arch-inspired blue color scheme | |||
| 42 | - | add_newline = true | |||
| 43 | - | ||||
| 44 | - | [username] | |||
| 45 | - | show_always = true | |||
| 46 | - | style_user = "fg:#87ceeb" | |||
| 47 | - | style_root = "fg:#ff6b8a" | |||
| 48 | - | format = "[$user]($style) " | |||
| 49 | - | ||||
| 50 | - | [hostname] | |||
| 51 | - | disabled = true | |||
| 52 | - | ||||
| 53 | - | [directory] | |||
| 54 | - | style = "fg:#e8f4f8" | |||
| 55 | - | format = "in [$path]($style) " | |||
| 56 | - | ||||
| 57 | - | [git_branch] | |||
| 58 | - | symbol = " " | |||
| 59 | - | style = "fg:#6bb6d6" | |||
| 60 | - | format = "on [$symbol$branch]($style) " | |||
| 61 | - | ||||
| 62 | - | [character] | |||
| 63 | - | success_symbol = '[❯](fg:#6bb6d6)' | |||
| 64 | - | error_symbol = '[✗](fg:#ff6b8a)' | |||
| 65 | - | STARSHIP_END | |||
| 66 | - | ||||
| 67 | - | # Create init configuration (starship, zoxide, fzf) | |||
| 68 | - | cat > "$ARCHUP_DEFAULT_BASH/init" << 'INIT_END' | |||
| 69 | - | # Starship prompt | |||
| 70 | - | if command -v starship &> /dev/null; then | |||
| 71 | - | export STARSHIP_CONFIG="$HOME/.local/share/archup/default/starship.toml" | |||
| 72 | - | eval "$(starship init bash)" | |||
| 73 | - | fi | |||
| 74 | - | ||||
| 75 | - | # Zoxide (smarter cd) | |||
| 76 | - | if command -v zoxide &> /dev/null; then | |||
| 77 | - | eval "$(zoxide init bash)" | |||
| 78 | - | fi | |||
| 79 | - | ||||
| 80 | - | # FZF fuzzy finder | |||
| 81 | - | if command -v fzf &> /dev/null; then | |||
| 82 | - | eval "$(fzf --bash)" | |||
| 83 | - | fi | |||
| 84 | - | INIT_END | |||
| 85 | - | ||||
| 86 | - | # Create aliases configuration | |||
| 87 | - | cat > "$ARCHUP_DEFAULT_BASH/aliases" << 'ALIASES_END' | |||
| 88 | - | # Eza aliases (modern ls replacement) | |||
| 89 | - | if command -v eza &> /dev/null; then | |||
| 90 | - | alias ls='eza -lh --group-directories-first --icons=auto' | |||
| 91 | - | alias lsa='ls -a' | |||
| 92 | - | alias lt='eza --tree --level=2 --long --icons --git' | |||
| 93 | - | alias lta='lt -a' | |||
| 94 | - | alias ll='eza -l --icons=auto' | |||
| 95 | - | alias la='eza -la --icons=auto' | |||
| 96 | - | fi | |||
| 97 | - | ||||
| 98 | - | # Bat + FZF integration | |||
| 99 | - | if command -v bat &> /dev/null && command -v fzf &> /dev/null; then | |||
| 100 | - | alias ff="fzf --preview 'bat -n --color=always {}' --preview-window right:60%:wrap" | |||
| 101 | - | fi | |||
| 102 | - | ||||
| 103 | - | # Bat aliases | |||
| 104 | - | if command -v bat &> /dev/null; then | |||
| 105 | - | alias cat='bat -pp' | |||
| 106 | - | alias less='bat' | |||
| 107 | - | fi | |||
| 108 | - | ||||
| 109 | - | # Fd alias (modern find replacement) | |||
| 110 | - | if command -v fd &> /dev/null; then | |||
| 111 | - | alias find='fd' | |||
| 112 | - | fi | |||
| 113 | - | ||||
| 114 | - | # Directories | |||
| 115 | - | alias ..='cd ..' | |||
| 116 | - | alias ...='cd ../..' | |||
| 117 | - | alias ....='cd ../../..' | |||
| 118 | - | ||||
| 119 | - | # Git shortcuts | |||
| 120 | - | alias g='git' | |||
| 121 | - | alias gs='git status' | |||
| 122 | - | alias ga='git add' | |||
| 123 | - | alias gc='git commit' | |||
| 124 | - | alias gp='git push' | |||
| 125 | - | alias gl='git log --oneline --graph --decorate' | |||
| 126 | - | ALIASES_END | |||
| 127 | - | ||||
| 128 | - | # Create envs configuration (environment variables) | |||
| 129 | - | cat > "$ARCHUP_DEFAULT_BASH/envs" << 'ENVS_END' | |||
| 130 | - | # Bat configuration | |||
| 131 | - | if command -v bat &> /dev/null; then | |||
| 132 | - | export BAT_THEME="TwoDark" | |||
| 133 | - | fi | |||
| 134 | - | ||||
| 135 | - | # FZF configuration | |||
| 136 | - | # Note: Do NOT add --preview to FZF_DEFAULT_OPTS as it breaks non-file operations | |||
| 137 | - | if command -v fzf &> /dev/null; then | |||
| 138 | - | # CTRL-T file/directory picker options | |||
| 139 | - | if command -v bat &> /dev/null; then | |||
| 140 | - | export FZF_CTRL_T_OPTS="--preview 'bat -n --color=always {}' --preview-window right:60%:wrap" | |||
| 141 | - | fi | |||
| 142 | - | ||||
| 143 | - | # ALT-C directory navigation options | |||
| 144 | - | if command -v tree &> /dev/null; then | |||
| 145 | - | export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -200' --preview-window right:60%:wrap" | |||
| 146 | - | fi | |||
| 147 | - | fi | |||
| 148 | - | ENVS_END | |||
| 149 | - | ||||
| 150 | - | # Create functions configuration | |||
| 151 | - | cat > "$ARCHUP_DEFAULT_BASH/functions" << 'FUNCTIONS_END' | |||
| 152 | - | # Zoxide cd wrapper | |||
| 153 | - | if command -v zoxide &> /dev/null; then | |||
| 154 | - | zd() { | |||
| 155 | - | if [ $# -eq 0 ]; then | |||
| 156 | - | builtin cd ~ && return | |||
| 157 | - | elif [ -d "$1" ]; then | |||
| 158 | - | builtin cd "$1" | |||
| 159 | - | else | |||
| 160 | - | z "$@" || echo "Error: Directory not found" | |||
| 161 | - | fi | |||
| 162 | - | } | |||
| 163 | - | alias cd="zd" | |||
| 164 | - | fi | |||
| 165 | - | FUNCTIONS_END | |||
| 166 | - | ||||
| 167 | - | # Create rc file that sources everything | |||
| 168 | - | cat > "$ARCHUP_DEFAULT_BASH/rc" << 'RC_END' | |||
| 169 | - | source ~/.local/share/archup/default/bash/shell | |||
| 170 | - | source ~/.local/share/archup/default/bash/init | |||
| 171 | - | source ~/.local/share/archup/default/bash/aliases | |||
| 172 | - | source ~/.local/share/archup/default/bash/envs | |||
| 173 | - | source ~/.local/share/archup/default/bash/functions | |||
| 174 | - | RC_END | |||
| 175 | - | ||||
| 176 | - | # Create user .bashrc that sources archup defaults | |||
| 177 | - | cat > "$USER_HOME/.bashrc" << 'BASHRC_END' | |||
| 178 | - | # All the default ArchUp aliases and functions | |||
| 179 | - | # (don't mess with these directly, just override them here!) | |||
| 180 | - | source ~/.local/share/archup/default/bash/rc | |||
| 181 | - | ||||
| 182 | - | # Add your own exports, aliases, and functions here. | |||
| 183 | - | # | |||
| 184 | - | # Make an alias for invoking commands you use constantly | |||
| 185 | - | # alias p='python' | |||
| 186 | - | BASHRC_END | |||
| 187 | - | ||||
| 188 | - | # Configure git to use delta for diffs | |||
| 189 | - | arch-chroot /mnt su - "$USERNAME" -c "git config --global core.pager delta" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 190 | - | arch-chroot /mnt su - "$USERNAME" -c "git config --global interactive.diffFilter 'delta --color-only'" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 191 | - | arch-chroot /mnt su - "$USERNAME" -c "git config --global delta.navigate true" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 192 | - | arch-chroot /mnt su - "$USERNAME" -c "git config --global delta.light false" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 193 | - | arch-chroot /mnt su - "$USERNAME" -c "git config --global delta.side-by-side true" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 194 | - | arch-chroot /mnt su - "$USERNAME" -c "git config --global merge.conflictstyle diff3" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 195 | - | arch-chroot /mnt su - "$USERNAME" -c "git config --global diff.colorMoved default" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 196 | - | ||||
| 197 | - | # Set ownership (paths relative to chroot, not host) | |||
| 198 | - | arch-chroot /mnt chown -R "$USERNAME:$USERNAME" "/home/$USERNAME/.local" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 199 | - | arch-chroot /mnt chown "$USERNAME:$USERNAME" "/home/$USERNAME/.bashrc" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 200 | - | ||||
| 201 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Shell configured" | |||
| 202 | - | echo "Configured shell for user: $USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
D install/deprecated/post-install/snapper.sh +0 -33
| @@ -1,33 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Configure Snapper and Limine integration for btrfs snapshots | |
| 3 | - | ||
| 4 | - | # Install limine-snapper-sync package | |
| 5 | - | if ! run_with_spinner "Installing limine-snapper-sync..." "arch-chroot /mnt pacman -S --noconfirm --needed limine-snapper-sync"; then | |
| 6 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Failed to install limine-snapper-sync" | |
| 7 | - | return 1 | |
| 8 | - | fi | |
| 9 | - | ||
| 10 | - | LIMINE_CONFIG="/mnt/boot/EFI/limine/limine.conf" | |
| 11 | - | CMDLINE=$(grep "^[[:space:]]*cmdline:" "$LIMINE_CONFIG" | head -1 | sed 's/^[[:space:]]*cmdline:[[:space:]]*//') | |
| 12 | - | cat > /mnt/etc/default/limine <<EOF | |
| 13 | - | TARGET_OS_NAME="ArchUp" | |
| 14 | - | ||
| 15 | - | ESP_PATH="/boot" | |
| 16 | - | ||
| 17 | - | KERNEL_CMDLINE[default]="$CMDLINE" | |
| 18 | - | ||
| 19 | - | ENABLE_UKI=no | |
| 20 | - | ENABLE_LIMINE_FALLBACK=yes | |
| 21 | - | ||
| 22 | - | FIND_BOOTLOADERS=yes | |
| 23 | - | ||
| 24 | - | BOOT_ORDER="*, *fallback, Snapshots" | |
| 25 | - | ||
| 26 | - | MAX_SNAPSHOT_ENTRIES=5 | |
| 27 | - | ||
| 28 | - | SNAPSHOT_FORMAT_CHOICE=5 | |
| 29 | - | EOF | |
| 30 | - | ||
| 31 | - | arch-chroot /mnt systemctl enable limine-snapper-sync.service >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 32 | - | ||
| 33 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Btrfs snapshots configured" | |
| @@ -1,33 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Configure Snapper and Limine integration for btrfs snapshots | |||
| 3 | - | ||||
| 4 | - | # Install limine-snapper-sync package | |||
| 5 | - | if ! run_with_spinner "Installing limine-snapper-sync..." "arch-chroot /mnt pacman -S --noconfirm --needed limine-snapper-sync"; then | |||
| 6 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Failed to install limine-snapper-sync" | |||
| 7 | - | return 1 | |||
| 8 | - | fi | |||
| 9 | - | ||||
| 10 | - | LIMINE_CONFIG="/mnt/boot/EFI/limine/limine.conf" | |||
| 11 | - | CMDLINE=$(grep "^[[:space:]]*cmdline:" "$LIMINE_CONFIG" | head -1 | sed 's/^[[:space:]]*cmdline:[[:space:]]*//') | |||
| 12 | - | cat > /mnt/etc/default/limine <<EOF | |||
| 13 | - | TARGET_OS_NAME="ArchUp" | |||
| 14 | - | ||||
| 15 | - | ESP_PATH="/boot" | |||
| 16 | - | ||||
| 17 | - | KERNEL_CMDLINE[default]="$CMDLINE" | |||
| 18 | - | ||||
| 19 | - | ENABLE_UKI=no | |||
| 20 | - | ENABLE_LIMINE_FALLBACK=yes | |||
| 21 | - | ||||
| 22 | - | FIND_BOOTLOADERS=yes | |||
| 23 | - | ||||
| 24 | - | BOOT_ORDER="*, *fallback, Snapshots" | |||
| 25 | - | ||||
| 26 | - | MAX_SNAPSHOT_ENTRIES=5 | |||
| 27 | - | ||||
| 28 | - | SNAPSHOT_FORMAT_CHOICE=5 | |||
| 29 | - | EOF | |||
| 30 | - | ||||
| 31 | - | arch-chroot /mnt systemctl enable limine-snapper-sync.service >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 32 | - | ||||
| 33 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Btrfs snapshots configured" | |||
D install/deprecated/post-install/unmount.sh +0 -21
| @@ -1,21 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Unmount all drives in preparation for reboot | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Unmounting partitions..." | |
| 5 | - | ||
| 6 | - | # Unmount in reverse order (nested mounts first) | |
| 7 | - | umount -R /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 8 | - | ||
| 9 | - | if [ $? -eq 0 ]; then | |
| 10 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] All partitions unmounted" | |
| 11 | - | echo "Unmounted all partitions successfully" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 12 | - | ||
| 13 | - | # Close encrypted volume if encryption was enabled | |
| 14 | - | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |
| 15 | - | cryptsetup close cryptroot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true | |
| 16 | - | echo "Closed encrypted volume" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 17 | - | fi | |
| 18 | - | else | |
| 19 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[WARN] Some partitions may still be mounted" | |
| 20 | - | echo "Warning: Failed to unmount all partitions cleanly" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 21 | - | fi | |
| @@ -1,21 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Unmount all drives in preparation for reboot | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Unmounting partitions..." | |||
| 5 | - | ||||
| 6 | - | # Unmount in reverse order (nested mounts first) | |||
| 7 | - | umount -R /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 8 | - | ||||
| 9 | - | if [ $? -eq 0 ]; then | |||
| 10 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] All partitions unmounted" | |||
| 11 | - | echo "Unmounted all partitions successfully" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 12 | - | ||||
| 13 | - | # Close encrypted volume if encryption was enabled | |||
| 14 | - | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |||
| 15 | - | cryptsetup close cryptroot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true | |||
| 16 | - | echo "Closed encrypted volume" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 17 | - | fi | |||
| 18 | - | else | |||
| 19 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[WARN] Some partitions may still be mounted" | |||
| 20 | - | echo "Warning: Failed to unmount all partitions cleanly" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 21 | - | fi | |||
D install/deprecated/post-install/verify.sh +0 -174
| @@ -1,174 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Post-install verification: Ensure everything is configured correctly | |
| 3 | - | ||
| 4 | - | # Disable exit-on-error and ERR trap for this script since we handle failures gracefully | |
| 5 | - | set +e | |
| 6 | - | trap - ERR | |
| 7 | - | ||
| 8 | - | ####################################### | |
| 9 | - | # Description: Verify installation components | |
| 10 | - | # Globals: | |
| 11 | - | # ARCHUP_INSTALL_LOG_FILE | |
| 12 | - | # ARCHUP_ENCRYPTION | |
| 13 | - | # PADDING_LEFT | |
| 14 | - | # Arguments: | |
| 15 | - | # None | |
| 16 | - | # Outputs: | |
| 17 | - | # Verification status to log and terminal | |
| 18 | - | # Returns: | |
| 19 | - | # 0 if successful, 1 on critical failure | |
| 20 | - | ####################################### | |
| 21 | - | ||
| 22 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Verifying installation..." | |
| 23 | - | ||
| 24 | - | # Track verification failures | |
| 25 | - | VERIFICATION_FAILED=0 | |
| 26 | - | ||
| 27 | - | ####################################### | |
| 28 | - | # Description: Verify a file exists | |
| 29 | - | # Arguments: | |
| 30 | - | # $1 - File path (without /mnt prefix) | |
| 31 | - | # $2 - Description | |
| 32 | - | # Returns: | |
| 33 | - | # 0 if exists, 1 if missing | |
| 34 | - | ####################################### | |
| 35 | - | verify_file() { | |
| 36 | - | local file=$1 | |
| 37 | - | local description=$2 | |
| 38 | - | ||
| 39 | - | if [ -f "/mnt$file" ]; then | |
| 40 | - | echo "[OK] $description: $file" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 41 | - | return 0 | |
| 42 | - | else | |
| 43 | - | echo "[ERROR] $description missing: $file" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 44 | - | VERIFICATION_FAILED=1 | |
| 45 | - | return 1 | |
| 46 | - | fi | |
| 47 | - | } | |
| 48 | - | ||
| 49 | - | verify_dir() { | |
| 50 | - | local dir=$1 | |
| 51 | - | local description=$2 | |
| 52 | - | ||
| 53 | - | if [ -d "/mnt$dir" ]; then | |
| 54 | - | echo "[OK] $description: $dir" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 55 | - | return 0 | |
| 56 | - | else | |
| 57 | - | echo "[ERROR] $description missing: $dir" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 58 | - | VERIFICATION_FAILED=1 | |
| 59 | - | return 1 | |
| 60 | - | fi | |
| 61 | - | } | |
| 62 | - | # Use the selected kernel name from config | |
| 63 | - | KERNEL_NAME="${ARCHUP_KERNEL:-linux}" | |
| 64 | - | ||
| 65 | - | verify_file "/boot/vmlinuz-${KERNEL_NAME}" "Kernel" | |
| 66 | - | verify_file "/boot/initramfs-${KERNEL_NAME}.img" "Initramfs" | |
| 67 | - | ||
| 68 | - | # Fallback initramfs is optional | |
| 69 | - | if [ -f "/mnt/boot/initramfs-${KERNEL_NAME}-fallback.img" ]; then | |
| 70 | - | echo "[OK] Fallback initramfs: /boot/initramfs-${KERNEL_NAME}-fallback.img" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 71 | - | else | |
| 72 | - | echo "[WARN] Fallback initramfs not generated (optional)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 73 | - | fi | |
| 74 | - | ||
| 75 | - | verify_file "/boot/EFI/limine/BOOTX64.EFI" "Limine bootloader" | |
| 76 | - | verify_file "/boot/EFI/limine/limine.conf" "Limine configuration" | |
| 77 | - | ||
| 78 | - | if [ -f "/mnt/boot/EFI/limine/limine.conf" ]; then | |
| 79 | - | if grep -q "^/" /mnt/boot/EFI/limine/limine.conf && \ | |
| 80 | - | grep -q "protocol:" /mnt/boot/EFI/limine/limine.conf && \ | |
| 81 | - | grep -q "path:" /mnt/boot/EFI/limine/limine.conf; then | |
| 82 | - | echo "[OK] Limine config validated" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 83 | - | else | |
| 84 | - | echo "[ERROR] Limine config validation failed" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 85 | - | VERIFICATION_FAILED=1 | |
| 86 | - | fi | |
| 87 | - | fi | |
| 88 | - | verify_file "/etc/fstab" "Filesystem table" | |
| 89 | - | verify_file "/etc/hostname" "Hostname" | |
| 90 | - | verify_file "/etc/locale.conf" "Locale configuration" | |
| 91 | - | verify_file "/etc/locale.gen" "Locale generation file" | |
| 92 | - | verify_file "/etc/systemd/zram-generator.conf" "zram configuration" | |
| 93 | - | verify_file "/etc/sysctl.d/99-vm-zram-parameters.conf" "zram sysctl parameters" | |
| 94 | - | ||
| 95 | - | if arch-chroot /mnt systemctl is-enabled NetworkManager &>/dev/null; then | |
| 96 | - | echo "[OK] NetworkManager enabled" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 97 | - | else | |
| 98 | - | echo "[ERROR] NetworkManager not enabled" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 99 | - | VERIFICATION_FAILED=1 | |
| 100 | - | fi | |
| 101 | - | ||
| 102 | - | if arch-chroot /mnt ls /home 2>/dev/null | grep -q .; then | |
| 103 | - | USERNAME=$(arch-chroot /mnt ls /home 2>/dev/null | head -1) | |
| 104 | - | echo "[OK] User created: $USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 105 | - | verify_dir "/home/$USERNAME" "User home directory" | |
| 106 | - | ||
| 107 | - | # Verify shell configuration | |
| 108 | - | verify_dir "/home/$USERNAME/.local/share/archup/default/bash" "Shell config directory" | |
| 109 | - | verify_file "/home/$USERNAME/.local/share/archup/default/bash/rc" "Shell rc file" | |
| 110 | - | verify_file "/home/$USERNAME/.local/share/archup/default/bash/shell" "Shell config" | |
| 111 | - | verify_file "/home/$USERNAME/.local/share/archup/default/bash/init" "Shell init" | |
| 112 | - | verify_file "/home/$USERNAME/.local/share/archup/default/bash/aliases" "Shell aliases" | |
| 113 | - | verify_file "/home/$USERNAME/.local/share/archup/default/bash/envs" "Shell envs" | |
| 114 | - | verify_file "/home/$USERNAME/.local/share/archup/default/bash/functions" "Shell functions" | |
| 115 | - | verify_file "/home/$USERNAME/.bashrc" "User bashrc" | |
| 116 | - | ||
| 117 | - | # Verify .bashrc sources archup defaults | |
| 118 | - | if grep -q "source ~/.local/share/archup/default/bash/rc" "/mnt/home/$USERNAME/.bashrc" 2>/dev/null; then | |
| 119 | - | echo "[OK] Bashrc sources archup defaults" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 120 | - | else | |
| 121 | - | echo "[ERROR] Bashrc does not source archup defaults" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 122 | - | VERIFICATION_FAILED=1 | |
| 123 | - | fi | |
| 124 | - | ||
| 125 | - | # Verify git delta configuration | |
| 126 | - | if arch-chroot /mnt su - "$USERNAME" -c "git config --global core.pager" 2>/dev/null | grep -q "delta"; then | |
| 127 | - | echo "[OK] Git delta configured" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 128 | - | else | |
| 129 | - | echo "[WARN] Git delta not configured (optional)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 130 | - | fi | |
| 131 | - | else | |
| 132 | - | echo "[ERROR] No user account found" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 133 | - | VERIFICATION_FAILED=1 | |
| 134 | - | fi | |
| 135 | - | ||
| 136 | - | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |
| 137 | - | if grep -q "encrypt" /mnt/etc/mkinitcpio.conf 2>/dev/null; then | |
| 138 | - | echo "[OK] Encryption hooks configured" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 139 | - | else | |
| 140 | - | echo "[ERROR] Encryption hooks missing in mkinitcpio.conf" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 141 | - | VERIFICATION_FAILED=1 | |
| 142 | - | fi | |
| 143 | - | fi | |
| 144 | - | ||
| 145 | - | if [ -f "/mnt/boot/arch-logo.png" ]; then | |
| 146 | - | echo "[OK] Boot logo installed" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 147 | - | else | |
| 148 | - | echo "[WARN] Boot logo not installed (optional)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 149 | - | fi | |
| 150 | - | ||
| 151 | - | # Final verification result | |
| 152 | - | echo "" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 153 | - | if [ $VERIFICATION_FAILED -eq 0 ]; then | |
| 154 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] All critical components verified" | |
| 155 | - | echo "=== POST-INSTALL VERIFICATION: PASSED ===" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 156 | - | else | |
| 157 | - | gum style --foreground 1 --padding "0 0 1 $PADDING_LEFT" "[ERROR] Verification failed - check logs" | |
| 158 | - | echo "=== POST-INSTALL VERIFICATION: FAILED ===" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 159 | - | echo "" | |
| 160 | - | ||
| 161 | - | # Ask user if they want to continue despite errors | |
| 162 | - | if ! gum confirm "Continue with unmounting despite verification errors?" --default=false --padding "0 0 1 $PADDING_LEFT"; then | |
| 163 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Installation aborted by user" | |
| 164 | - | echo "Installation aborted by user after verification failure" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 165 | - | exit 1 | |
| 166 | - | fi | |
| 167 | - | ||
| 168 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[WARN] Continuing despite verification errors" | |
| 169 | - | echo "User chose to continue despite verification errors" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 170 | - | fi | |
| 171 | - | ||
| 172 | - | # Re-enable exit-on-error and ERR trap for subsequent scripts | |
| 173 | - | set -e | |
| 174 | - | trap 'catch_errors' ERR | |
| @@ -1,174 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Post-install verification: Ensure everything is configured correctly | |||
| 3 | - | ||||
| 4 | - | # Disable exit-on-error and ERR trap for this script since we handle failures gracefully | |||
| 5 | - | set +e | |||
| 6 | - | trap - ERR | |||
| 7 | - | ||||
| 8 | - | ####################################### | |||
| 9 | - | # Description: Verify installation components | |||
| 10 | - | # Globals: | |||
| 11 | - | # ARCHUP_INSTALL_LOG_FILE | |||
| 12 | - | # ARCHUP_ENCRYPTION | |||
| 13 | - | # PADDING_LEFT | |||
| 14 | - | # Arguments: | |||
| 15 | - | # None | |||
| 16 | - | # Outputs: | |||
| 17 | - | # Verification status to log and terminal | |||
| 18 | - | # Returns: | |||
| 19 | - | # 0 if successful, 1 on critical failure | |||
| 20 | - | ####################################### | |||
| 21 | - | ||||
| 22 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Verifying installation..." | |||
| 23 | - | ||||
| 24 | - | # Track verification failures | |||
| 25 | - | VERIFICATION_FAILED=0 | |||
| 26 | - | ||||
| 27 | - | ####################################### | |||
| 28 | - | # Description: Verify a file exists | |||
| 29 | - | # Arguments: | |||
| 30 | - | # $1 - File path (without /mnt prefix) | |||
| 31 | - | # $2 - Description | |||
| 32 | - | # Returns: | |||
| 33 | - | # 0 if exists, 1 if missing | |||
| 34 | - | ####################################### | |||
| 35 | - | verify_file() { | |||
| 36 | - | local file=$1 | |||
| 37 | - | local description=$2 | |||
| 38 | - | ||||
| 39 | - | if [ -f "/mnt$file" ]; then | |||
| 40 | - | echo "[OK] $description: $file" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 41 | - | return 0 | |||
| 42 | - | else | |||
| 43 | - | echo "[ERROR] $description missing: $file" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 44 | - | VERIFICATION_FAILED=1 | |||
| 45 | - | return 1 | |||
| 46 | - | fi | |||
| 47 | - | } | |||
| 48 | - | ||||
| 49 | - | verify_dir() { | |||
| 50 | - | local dir=$1 | |||
| 51 | - | local description=$2 | |||
| 52 | - | ||||
| 53 | - | if [ -d "/mnt$dir" ]; then | |||
| 54 | - | echo "[OK] $description: $dir" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 55 | - | return 0 | |||
| 56 | - | else | |||
| 57 | - | echo "[ERROR] $description missing: $dir" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 58 | - | VERIFICATION_FAILED=1 | |||
| 59 | - | return 1 | |||
| 60 | - | fi | |||
| 61 | - | } | |||
| 62 | - | # Use the selected kernel name from config | |||
| 63 | - | KERNEL_NAME="${ARCHUP_KERNEL:-linux}" | |||
| 64 | - | ||||
| 65 | - | verify_file "/boot/vmlinuz-${KERNEL_NAME}" "Kernel" | |||
| 66 | - | verify_file "/boot/initramfs-${KERNEL_NAME}.img" "Initramfs" | |||
| 67 | - | ||||
| 68 | - | # Fallback initramfs is optional | |||
| 69 | - | if [ -f "/mnt/boot/initramfs-${KERNEL_NAME}-fallback.img" ]; then | |||
| 70 | - | echo "[OK] Fallback initramfs: /boot/initramfs-${KERNEL_NAME}-fallback.img" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 71 | - | else | |||
| 72 | - | echo "[WARN] Fallback initramfs not generated (optional)" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 73 | - | fi | |||
| 74 | - | ||||
| 75 | - | verify_file "/boot/EFI/limine/BOOTX64.EFI" "Limine bootloader" | |||
| 76 | - | verify_file "/boot/EFI/limine/limine.conf" "Limine configuration" | |||
| 77 | - | ||||
| 78 | - | if [ -f "/mnt/boot/EFI/limine/limine.conf" ]; then | |||
| 79 | - | if grep -q "^/" /mnt/boot/EFI/limine/limine.conf && \ | |||
| 80 | - | grep -q "protocol:" /mnt/boot/EFI/limine/limine.conf && \ | |||
| 81 | - | grep -q "path:" /mnt/boot/EFI/limine/limine.conf; then | |||
| 82 | - | echo "[OK] Limine config validated" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 83 | - | else | |||
| 84 | - | echo "[ERROR] Limine config validation failed" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 85 | - | VERIFICATION_FAILED=1 | |||
| 86 | - | fi | |||
| 87 | - | fi | |||
| 88 | - | verify_file "/etc/fstab" "Filesystem table" | |||
| 89 | - | verify_file "/etc/hostname" "Hostname" | |||
| 90 | - | verify_file "/etc/locale.conf" "Locale configuration" | |||
| 91 | - | verify_file "/etc/locale.gen" "Locale generation file" | |||
| 92 | - | verify_file "/etc/systemd/zram-generator.conf" "zram configuration" | |||
| 93 | - | verify_file "/etc/sysctl.d/99-vm-zram-parameters.conf" "zram sysctl parameters" | |||
| 94 | - | ||||
| 95 | - | if arch-chroot /mnt systemctl is-enabled NetworkManager &>/dev/null; then | |||
| 96 | - | echo "[OK] NetworkManager enabled" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 97 | - | else | |||
| 98 | - | echo "[ERROR] NetworkManager not enabled" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 99 | - | VERIFICATION_FAILED=1 | |||
| 100 | - | fi | |||
| 101 | - | ||||
| 102 | - | if arch-chroot /mnt ls /home 2>/dev/null | grep -q .; then | |||
| 103 | - | USERNAME=$(arch-chroot /mnt ls /home 2>/dev/null | head -1) | |||
| 104 | - | echo "[OK] User created: $USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 105 | - | verify_dir "/home/$USERNAME" "User home directory" | |||
| 106 | - | ||||
| 107 | - | # Verify shell configuration | |||
| 108 | - | verify_dir "/home/$USERNAME/.local/share/archup/default/bash" "Shell config directory" | |||
| 109 | - | verify_file "/home/$USERNAME/.local/share/archup/default/bash/rc" "Shell rc file" | |||
| 110 | - | verify_file "/home/$USERNAME/.local/share/archup/default/bash/shell" "Shell config" | |||
| 111 | - | verify_file "/home/$USERNAME/.local/share/archup/default/bash/init" "Shell init" | |||
| 112 | - | verify_file "/home/$USERNAME/.local/share/archup/default/bash/aliases" "Shell aliases" | |||
| 113 | - | verify_file "/home/$USERNAME/.local/share/archup/default/bash/envs" "Shell envs" | |||
| 114 | - | verify_file "/home/$USERNAME/.local/share/archup/default/bash/functions" "Shell functions" | |||
| 115 | - | verify_file "/home/$USERNAME/.bashrc" "User bashrc" | |||
| 116 | - | ||||
| 117 | - | # Verify .bashrc sources archup defaults | |||
| 118 | - | if grep -q "source ~/.local/share/archup/default/bash/rc" "/mnt/home/$USERNAME/.bashrc" 2>/dev/null; then | |||
| 119 | - | echo "[OK] Bashrc sources archup defaults" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 120 | - | else | |||
| 121 | - | echo "[ERROR] Bashrc does not source archup defaults" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 122 | - | VERIFICATION_FAILED=1 | |||
| 123 | - | fi | |||
| 124 | - | ||||
| 125 | - | # Verify git delta configuration | |||
| 126 | - | if arch-chroot /mnt su - "$USERNAME" -c "git config --global core.pager" 2>/dev/null | grep -q "delta"; then | |||
| 127 | - | echo "[OK] Git delta configured" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 128 | - | else | |||
| 129 | - | echo "[WARN] Git delta not configured (optional)" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 130 | - | fi | |||
| 131 | - | else | |||
| 132 | - | echo "[ERROR] No user account found" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 133 | - | VERIFICATION_FAILED=1 | |||
| 134 | - | fi | |||
| 135 | - | ||||
| 136 | - | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |||
| 137 | - | if grep -q "encrypt" /mnt/etc/mkinitcpio.conf 2>/dev/null; then | |||
| 138 | - | echo "[OK] Encryption hooks configured" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 139 | - | else | |||
| 140 | - | echo "[ERROR] Encryption hooks missing in mkinitcpio.conf" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 141 | - | VERIFICATION_FAILED=1 | |||
| 142 | - | fi | |||
| 143 | - | fi | |||
| 144 | - | ||||
| 145 | - | if [ -f "/mnt/boot/arch-logo.png" ]; then | |||
| 146 | - | echo "[OK] Boot logo installed" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 147 | - | else | |||
| 148 | - | echo "[WARN] Boot logo not installed (optional)" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 149 | - | fi | |||
| 150 | - | ||||
| 151 | - | # Final verification result | |||
| 152 | - | echo "" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 153 | - | if [ $VERIFICATION_FAILED -eq 0 ]; then | |||
| 154 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] All critical components verified" | |||
| 155 | - | echo "=== POST-INSTALL VERIFICATION: PASSED ===" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 156 | - | else | |||
| 157 | - | gum style --foreground 1 --padding "0 0 1 $PADDING_LEFT" "[ERROR] Verification failed - check logs" | |||
| 158 | - | echo "=== POST-INSTALL VERIFICATION: FAILED ===" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 159 | - | echo "" | |||
| 160 | - | ||||
| 161 | - | # Ask user if they want to continue despite errors | |||
| 162 | - | if ! gum confirm "Continue with unmounting despite verification errors?" --default=false --padding "0 0 1 $PADDING_LEFT"; then | |||
| 163 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Installation aborted by user" | |||
| 164 | - | echo "Installation aborted by user after verification failure" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 165 | - | exit 1 | |||
| 166 | - | fi | |||
| 167 | - | ||||
| 168 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[WARN] Continuing despite verification errors" | |||
| 169 | - | echo "User chose to continue despite verification errors" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 170 | - | fi | |||
| 171 | - | ||||
| 172 | - | # Re-enable exit-on-error and ERR trap for subsequent scripts | |||
| 173 | - | set -e | |||
| 174 | - | trap 'catch_errors' ERR | |||
D install/deprecated/preflight/all.sh +0 -6
| @@ -1,6 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Preflight phase | |
| 3 | - | ||
| 4 | - | source "$ARCHUP_INSTALL/preflight/guards.sh" # Interactive (gum confirm) | |
| 5 | - | source "$ARCHUP_INSTALL/preflight/detect-environment.sh" # Exports ARCHUP_KEYMAP | |
| 6 | - | source "$ARCHUP_INSTALL/preflight/begin.sh" # Interactive (gum confirm) + exports ARCHUP_BOOTLOADER, ARCHUP_ENCRYPTION | |
| @@ -1,6 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Preflight phase | |||
| 3 | - | ||||
| 4 | - | source "$ARCHUP_INSTALL/preflight/guards.sh" # Interactive (gum confirm) | |||
| 5 | - | source "$ARCHUP_INSTALL/preflight/detect-environment.sh" # Exports ARCHUP_KEYMAP | |||
| 6 | - | source "$ARCHUP_INSTALL/preflight/begin.sh" # Interactive (gum confirm) + exports ARCHUP_BOOTLOADER, ARCHUP_ENCRYPTION | |||
D install/deprecated/preflight/begin.sh +0 -44
| @@ -1,44 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Begin ArchUp installation | |
| 3 | - | # Display welcome message and gather initial configuration choices | |
| 4 | - | ||
| 5 | - | # Display welcome message | |
| 6 | - | gum style --foreground 4 --padding "1 0 1 $PADDING_LEFT" "Welcome to ArchUp!" | |
| 7 | - | gum style --padding "0 0 0 $PADDING_LEFT" "A minimal, slightly opinionated Arch Linux installer." | |
| 8 | - | echo | |
| 9 | - | ||
| 10 | - | # Confirm installation start | |
| 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" | |
| 13 | - | echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 14 | - | exit 0 | |
| 15 | - | fi | |
| 16 | - | ||
| 17 | - | # ArchUp uses Limine bootloader exclusively | |
| 18 | - | export ARCHUP_BOOTLOADER="limine" | |
| 19 | - | config_set "ARCHUP_BOOTLOADER" "limine" | |
| 20 | - | echo "Bootloader: limine" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 21 | - | ||
| 22 | - | # Gather user identity (username, password, email, hostname, timezone) | |
| 23 | - | echo | |
| 24 | - | source "$ARCHUP_INSTALL/preflight/identify.sh" | |
| 25 | - | ||
| 26 | - | # Ask for encryption preference | |
| 27 | - | echo | |
| 28 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Disk Encryption" | |
| 29 | - | gum style --padding "0 0 0 $PADDING_LEFT" "LUKS encryption protects your data with Argon2id (2000ms iteration)" | |
| 30 | - | echo | |
| 31 | - | ||
| 32 | - | if gum confirm "Enable full-disk encryption?" --padding "0 0 1 $PADDING_LEFT"; then | |
| 33 | - | export ARCHUP_ENCRYPTION="enabled" | |
| 34 | - | config_set "ARCHUP_ENCRYPTION" "enabled" | |
| 35 | - | echo "Encryption: enabled" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 36 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "Note: Using account password for disk encryption" | |
| 37 | - | else | |
| 38 | - | export ARCHUP_ENCRYPTION="disabled" | |
| 39 | - | config_set "ARCHUP_ENCRYPTION" "disabled" | |
| 40 | - | echo "Encryption: disabled" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 41 | - | fi | |
| 42 | - | ||
| 43 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Configuration saved" | |
| 44 | - | echo "Configuration saved" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,44 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Begin ArchUp installation | |||
| 3 | - | # Display welcome message and gather initial configuration choices | |||
| 4 | - | ||||
| 5 | - | # Display welcome message | |||
| 6 | - | gum style --foreground 4 --padding "1 0 1 $PADDING_LEFT" "Welcome to ArchUp!" | |||
| 7 | - | gum style --padding "0 0 0 $PADDING_LEFT" "A minimal, slightly opinionated Arch Linux installer." | |||
| 8 | - | echo | |||
| 9 | - | ||||
| 10 | - | # Confirm installation start | |||
| 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" | |||
| 13 | - | echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 14 | - | exit 0 | |||
| 15 | - | fi | |||
| 16 | - | ||||
| 17 | - | # ArchUp uses Limine bootloader exclusively | |||
| 18 | - | export ARCHUP_BOOTLOADER="limine" | |||
| 19 | - | config_set "ARCHUP_BOOTLOADER" "limine" | |||
| 20 | - | echo "Bootloader: limine" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 21 | - | ||||
| 22 | - | # Gather user identity (username, password, email, hostname, timezone) | |||
| 23 | - | echo | |||
| 24 | - | source "$ARCHUP_INSTALL/preflight/identify.sh" | |||
| 25 | - | ||||
| 26 | - | # Ask for encryption preference | |||
| 27 | - | echo | |||
| 28 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Disk Encryption" | |||
| 29 | - | gum style --padding "0 0 0 $PADDING_LEFT" "LUKS encryption protects your data with Argon2id (2000ms iteration)" | |||
| 30 | - | echo | |||
| 31 | - | ||||
| 32 | - | if gum confirm "Enable full-disk encryption?" --padding "0 0 1 $PADDING_LEFT"; then | |||
| 33 | - | export ARCHUP_ENCRYPTION="enabled" | |||
| 34 | - | config_set "ARCHUP_ENCRYPTION" "enabled" | |||
| 35 | - | echo "Encryption: enabled" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 36 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "Note: Using account password for disk encryption" | |||
| 37 | - | else | |||
| 38 | - | export ARCHUP_ENCRYPTION="disabled" | |||
| 39 | - | config_set "ARCHUP_ENCRYPTION" "disabled" | |||
| 40 | - | echo "Encryption: disabled" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 41 | - | fi | |||
| 42 | - | ||||
| 43 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Configuration saved" | |||
| 44 | - | echo "Configuration saved" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
D install/deprecated/preflight/detect-environment.sh +0 -83
| @@ -1,83 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Detect keyboard layout and WiFi settings from the live ISO | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Detecting ISO environment..." | |
| 5 | - | ||
| 6 | - | # Detect keyboard layout from current console | |
| 7 | - | # Try to get the layout from loadkeys or localectl | |
| 8 | - | DETECTED_KEYMAP="" | |
| 9 | - | ||
| 10 | - | if command -v localectl >/dev/null 2>&1; then | |
| 11 | - | DETECTED_KEYMAP=$(localectl status | grep "VC Keymap" | awk '{print $3}') | |
| 12 | - | fi | |
| 13 | - | ||
| 14 | - | # Fallback: check /etc/vconsole.conf if it exists | |
| 15 | - | if [ -z "$DETECTED_KEYMAP" ] && [ -f /etc/vconsole.conf ]; then | |
| 16 | - | DETECTED_KEYMAP=$(grep "^KEYMAP=" /etc/vconsole.conf | cut -d'=' -f2) | |
| 17 | - | fi | |
| 18 | - | ||
| 19 | - | # Default to us if nothing detected or if set to "(unset)" | |
| 20 | - | if [ -z "$DETECTED_KEYMAP" ] || [ "$DETECTED_KEYMAP" = "(unset)" ]; then | |
| 21 | - | DETECTED_KEYMAP="us" | |
| 22 | - | fi | |
| 23 | - | ||
| 24 | - | export ARCHUP_KEYMAP="$DETECTED_KEYMAP" | |
| 25 | - | config_set "ARCHUP_KEYMAP" "$ARCHUP_KEYMAP" | |
| 26 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Keyboard layout: $ARCHUP_KEYMAP" | |
| 27 | - | echo "Keyboard layout detected: $ARCHUP_KEYMAP" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 28 | - | ||
| 29 | - | # Check for network connectivity | |
| 30 | - | # First check if we have an active ethernet connection | |
| 31 | - | HAS_ETHERNET=false | |
| 32 | - | if ip link show | grep -E "^[0-9]+: (eth|enp|eno)" | grep -q "state UP"; then | |
| 33 | - | HAS_ETHERNET=true | |
| 34 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Ethernet connection detected" | |
| 35 | - | echo "Network: Ethernet connected" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 36 | - | fi | |
| 37 | - | ||
| 38 | - | # Only check for WiFi if no ethernet connection is available | |
| 39 | - | WIFI_SSID="" | |
| 40 | - | WIFI_PASSPHRASE="" | |
| 41 | - | ||
| 42 | - | if [ "$HAS_ETHERNET" = false ] && command -v iwctl >/dev/null 2>&1; then | |
| 43 | - | # Get the first wireless device | |
| 44 | - | WIFI_DEVICE=$(iwctl device list | grep -oP 'wlan\d+' | head -1) || true | |
| 45 | - | ||
| 46 | - | if [ -n "$WIFI_DEVICE" ]; then | |
| 47 | - | # Check if connected to a network | |
| 48 | - | WIFI_SSID=$(iwctl station "$WIFI_DEVICE" show | grep "Connected network" | awk '{print $3}') || true | |
| 49 | - | ||
| 50 | - | if [ -n "$WIFI_SSID" ]; then | |
| 51 | - | # iwd stores credentials in /var/lib/iwd/ | |
| 52 | - | # The PSK is stored in a file named SSID.psk | |
| 53 | - | IWD_CONFIG="/var/lib/iwd/${WIFI_SSID}.psk" | |
| 54 | - | ||
| 55 | - | if [ -f "$IWD_CONFIG" ]; then | |
| 56 | - | # Extract passphrase from iwd config (stored in [Security] section as PreSharedKey) | |
| 57 | - | WIFI_PASSPHRASE=$(grep "^PreSharedKey=" "$IWD_CONFIG" | cut -d'=' -f2 || true) | |
| 58 | - | fi | |
| 59 | - | ||
| 60 | - | export ARCHUP_WIFI_SSID="$WIFI_SSID" | |
| 61 | - | export ARCHUP_WIFI_DEVICE="$WIFI_DEVICE" | |
| 62 | - | export ARCHUP_WIFI_PASSPHRASE="$WIFI_PASSPHRASE" | |
| 63 | - | ||
| 64 | - | config_set "ARCHUP_WIFI_SSID" "$WIFI_SSID" | |
| 65 | - | config_set "ARCHUP_WIFI_DEVICE" "$WIFI_DEVICE" | |
| 66 | - | config_set "ARCHUP_WIFI_PASSPHRASE" "$WIFI_PASSPHRASE" | |
| 67 | - | ||
| 68 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] WiFi network: $WIFI_SSID (device: $WIFI_DEVICE)" | |
| 69 | - | echo "WiFi detected: SSID=$WIFI_SSID, device=$WIFI_DEVICE" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 70 | - | else | |
| 71 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No active WiFi connection detected" | |
| 72 | - | echo "WiFi: not connected" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 73 | - | fi | |
| 74 | - | else | |
| 75 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No WiFi device found" | |
| 76 | - | echo "WiFi: no device" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 77 | - | fi | |
| 78 | - | elif [ "$HAS_ETHERNET" = false ]; then | |
| 79 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] iwd not available" | |
| 80 | - | echo "WiFi: iwd not available" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 81 | - | fi | |
| 82 | - | ||
| 83 | - | echo | |
| @@ -1,83 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Detect keyboard layout and WiFi settings from the live ISO | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Detecting ISO environment..." | |||
| 5 | - | ||||
| 6 | - | # Detect keyboard layout from current console | |||
| 7 | - | # Try to get the layout from loadkeys or localectl | |||
| 8 | - | DETECTED_KEYMAP="" | |||
| 9 | - | ||||
| 10 | - | if command -v localectl >/dev/null 2>&1; then | |||
| 11 | - | DETECTED_KEYMAP=$(localectl status | grep "VC Keymap" | awk '{print $3}') | |||
| 12 | - | fi | |||
| 13 | - | ||||
| 14 | - | # Fallback: check /etc/vconsole.conf if it exists | |||
| 15 | - | if [ -z "$DETECTED_KEYMAP" ] && [ -f /etc/vconsole.conf ]; then | |||
| 16 | - | DETECTED_KEYMAP=$(grep "^KEYMAP=" /etc/vconsole.conf | cut -d'=' -f2) | |||
| 17 | - | fi | |||
| 18 | - | ||||
| 19 | - | # Default to us if nothing detected or if set to "(unset)" | |||
| 20 | - | if [ -z "$DETECTED_KEYMAP" ] || [ "$DETECTED_KEYMAP" = "(unset)" ]; then | |||
| 21 | - | DETECTED_KEYMAP="us" | |||
| 22 | - | fi | |||
| 23 | - | ||||
| 24 | - | export ARCHUP_KEYMAP="$DETECTED_KEYMAP" | |||
| 25 | - | config_set "ARCHUP_KEYMAP" "$ARCHUP_KEYMAP" | |||
| 26 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Keyboard layout: $ARCHUP_KEYMAP" | |||
| 27 | - | echo "Keyboard layout detected: $ARCHUP_KEYMAP" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 28 | - | ||||
| 29 | - | # Check for network connectivity | |||
| 30 | - | # First check if we have an active ethernet connection | |||
| 31 | - | HAS_ETHERNET=false | |||
| 32 | - | if ip link show | grep -E "^[0-9]+: (eth|enp|eno)" | grep -q "state UP"; then | |||
| 33 | - | HAS_ETHERNET=true | |||
| 34 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Ethernet connection detected" | |||
| 35 | - | echo "Network: Ethernet connected" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 36 | - | fi | |||
| 37 | - | ||||
| 38 | - | # Only check for WiFi if no ethernet connection is available | |||
| 39 | - | WIFI_SSID="" | |||
| 40 | - | WIFI_PASSPHRASE="" | |||
| 41 | - | ||||
| 42 | - | if [ "$HAS_ETHERNET" = false ] && command -v iwctl >/dev/null 2>&1; then | |||
| 43 | - | # Get the first wireless device | |||
| 44 | - | WIFI_DEVICE=$(iwctl device list | grep -oP 'wlan\d+' | head -1) || true | |||
| 45 | - | ||||
| 46 | - | if [ -n "$WIFI_DEVICE" ]; then | |||
| 47 | - | # Check if connected to a network | |||
| 48 | - | WIFI_SSID=$(iwctl station "$WIFI_DEVICE" show | grep "Connected network" | awk '{print $3}') || true | |||
| 49 | - | ||||
| 50 | - | if [ -n "$WIFI_SSID" ]; then | |||
| 51 | - | # iwd stores credentials in /var/lib/iwd/ | |||
| 52 | - | # The PSK is stored in a file named SSID.psk | |||
| 53 | - | IWD_CONFIG="/var/lib/iwd/${WIFI_SSID}.psk" | |||
| 54 | - | ||||
| 55 | - | if [ -f "$IWD_CONFIG" ]; then | |||
| 56 | - | # Extract passphrase from iwd config (stored in [Security] section as PreSharedKey) | |||
| 57 | - | WIFI_PASSPHRASE=$(grep "^PreSharedKey=" "$IWD_CONFIG" | cut -d'=' -f2 || true) | |||
| 58 | - | fi | |||
| 59 | - | ||||
| 60 | - | export ARCHUP_WIFI_SSID="$WIFI_SSID" | |||
| 61 | - | export ARCHUP_WIFI_DEVICE="$WIFI_DEVICE" | |||
| 62 | - | export ARCHUP_WIFI_PASSPHRASE="$WIFI_PASSPHRASE" | |||
| 63 | - | ||||
| 64 | - | config_set "ARCHUP_WIFI_SSID" "$WIFI_SSID" | |||
| 65 | - | config_set "ARCHUP_WIFI_DEVICE" "$WIFI_DEVICE" | |||
| 66 | - | config_set "ARCHUP_WIFI_PASSPHRASE" "$WIFI_PASSPHRASE" | |||
| 67 | - | ||||
| 68 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] WiFi network: $WIFI_SSID (device: $WIFI_DEVICE)" | |||
| 69 | - | echo "WiFi detected: SSID=$WIFI_SSID, device=$WIFI_DEVICE" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 70 | - | else | |||
| 71 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No active WiFi connection detected" | |||
| 72 | - | echo "WiFi: not connected" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 73 | - | fi | |||
| 74 | - | else | |||
| 75 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No WiFi device found" | |||
| 76 | - | echo "WiFi: no device" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 77 | - | fi | |||
| 78 | - | elif [ "$HAS_ETHERNET" = false ]; then | |||
| 79 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] iwd not available" | |||
| 80 | - | echo "WiFi: iwd not available" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 81 | - | fi | |||
| 82 | - | ||||
| 83 | - | echo | |||
D install/deprecated/preflight/guards.sh +0 -42
| @@ -1,42 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Preflight guards for ArchUp installer | |
| 3 | - | # Validates system requirements before installation | |
| 4 | - | ||
| 5 | - | abort() { | |
| 6 | - | gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "ArchUp install requires: $1" | |
| 7 | - | echo | |
| 8 | - | echo "Preflight check failed: $1" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 9 | - | gum confirm "Proceed anyway on your own accord and without assistance?" --padding "0 0 0 $PADDING_LEFT" || exit 1 | |
| 10 | - | } | |
| 11 | - | ||
| 12 | - | gum style --foreground 4 --padding "1 0 0 $PADDING_LEFT" "Running preflight checks..." | |
| 13 | - | ||
| 14 | - | # Must be running from Arch ISO or vanilla Arch | |
| 15 | - | if [[ ! -f /etc/arch-release ]]; then | |
| 16 | - | abort "Vanilla Arch Linux or Arch ISO" | |
| 17 | - | fi | |
| 18 | - | ||
| 19 | - | # Must not be an Arch derivative distro | |
| 20 | - | for marker in /etc/cachyos-release /etc/eos-release /etc/garuda-release /etc/manjaro-release; do | |
| 21 | - | if [[ -f "$marker" ]]; then | |
| 22 | - | abort "Vanilla Arch (detected derivative distro)" | |
| 23 | - | fi | |
| 24 | - | done | |
| 25 | - | ||
| 26 | - | # Must be x86_64 architecture | |
| 27 | - | if [ "$(uname -m)" != "x86_64" ]; then | |
| 28 | - | abort "x86_64 CPU architecture" | |
| 29 | - | fi | |
| 30 | - | ||
| 31 | - | # Must have UEFI boot (check for EFI variables) | |
| 32 | - | if [[ ! -d /sys/firmware/efi/efivars ]]; then | |
| 33 | - | abort "UEFI boot mode (legacy BIOS not supported)" | |
| 34 | - | fi | |
| 35 | - | ||
| 36 | - | # Must have Secure Boot disabled | |
| 37 | - | if bootctl status 2>/dev/null | grep -q 'Secure Boot: enabled'; then | |
| 38 | - | abort "Secure Boot disabled" | |
| 39 | - | fi | |
| 40 | - | ||
| 41 | - | # Cleared all guards | |
| 42 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "All preflight checks passed" | |
| @@ -1,42 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Preflight guards for ArchUp installer | |||
| 3 | - | # Validates system requirements before installation | |||
| 4 | - | ||||
| 5 | - | abort() { | |||
| 6 | - | gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "ArchUp install requires: $1" | |||
| 7 | - | echo | |||
| 8 | - | echo "Preflight check failed: $1" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 9 | - | gum confirm "Proceed anyway on your own accord and without assistance?" --padding "0 0 0 $PADDING_LEFT" || exit 1 | |||
| 10 | - | } | |||
| 11 | - | ||||
| 12 | - | gum style --foreground 4 --padding "1 0 0 $PADDING_LEFT" "Running preflight checks..." | |||
| 13 | - | ||||
| 14 | - | # Must be running from Arch ISO or vanilla Arch | |||
| 15 | - | if [[ ! -f /etc/arch-release ]]; then | |||
| 16 | - | abort "Vanilla Arch Linux or Arch ISO" | |||
| 17 | - | fi | |||
| 18 | - | ||||
| 19 | - | # Must not be an Arch derivative distro | |||
| 20 | - | for marker in /etc/cachyos-release /etc/eos-release /etc/garuda-release /etc/manjaro-release; do | |||
| 21 | - | if [[ -f "$marker" ]]; then | |||
| 22 | - | abort "Vanilla Arch (detected derivative distro)" | |||
| 23 | - | fi | |||
| 24 | - | done | |||
| 25 | - | ||||
| 26 | - | # Must be x86_64 architecture | |||
| 27 | - | if [ "$(uname -m)" != "x86_64" ]; then | |||
| 28 | - | abort "x86_64 CPU architecture" | |||
| 29 | - | fi | |||
| 30 | - | ||||
| 31 | - | # Must have UEFI boot (check for EFI variables) | |||
| 32 | - | if [[ ! -d /sys/firmware/efi/efivars ]]; then | |||
| 33 | - | abort "UEFI boot mode (legacy BIOS not supported)" | |||
| 34 | - | fi | |||
| 35 | - | ||||
| 36 | - | # Must have Secure Boot disabled | |||
| 37 | - | if bootctl status 2>/dev/null | grep -q 'Secure Boot: enabled'; then | |||
| 38 | - | abort "Secure Boot disabled" | |||
| 39 | - | fi | |||
| 40 | - | ||||
| 41 | - | # Cleared all guards | |||
| 42 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "All preflight checks passed" | |||
D install/deprecated/preflight/identify.sh +0 -123
| @@ -1,123 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # User Identity Configuration - All identity prompts consolidated | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "User Identity" | |
| 5 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Configure your user account and system details" | |
| 6 | - | echo | |
| 7 | - | ||
| 8 | - | # Username | |
| 9 | - | ARCHUP_USERNAME=$(gum input --placeholder "username" \ | |
| 10 | - | --prompt "Username: " \ | |
| 11 | - | --padding "0 0 0 $PADDING_LEFT") | |
| 12 | - | ||
| 13 | - | if [ -z "$ARCHUP_USERNAME" ]; then | |
| 14 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "ERROR: Username cannot be empty" | |
| 15 | - | exit 1 | |
| 16 | - | fi | |
| 17 | - | ||
| 18 | - | # Password (with confirmation) | |
| 19 | - | while true; do | |
| 20 | - | ARCHUP_PASSWORD=$(gum input --password --placeholder "Enter password" \ | |
| 21 | - | --prompt "Password: " \ | |
| 22 | - | --padding "0 0 0 $PADDING_LEFT") | |
| 23 | - | ||
| 24 | - | ARCHUP_PASSWORD_CONFIRM=$(gum input --password --placeholder "Confirm password" \ | |
| 25 | - | --prompt "Confirm: " \ | |
| 26 | - | --padding "0 0 0 $PADDING_LEFT") | |
| 27 | - | ||
| 28 | - | if [ "$ARCHUP_PASSWORD" = "$ARCHUP_PASSWORD_CONFIRM" ]; then | |
| 29 | - | break | |
| 30 | - | else | |
| 31 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "Passwords do not match. Try again." | |
| 32 | - | fi | |
| 33 | - | done | |
| 34 | - | ||
| 35 | - | # Encryption Password Choice | |
| 36 | - | echo | |
| 37 | - | gum style --foreground 6 --padding "0 0 0 $PADDING_LEFT" "Disk Encryption" | |
| 38 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Choose whether to use the same password for disk encryption" | |
| 39 | - | if gum confirm "Use same password for disk encryption?" --padding "0 0 1 $PADDING_LEFT"; then | |
| 40 | - | ARCHUP_ENCRYPTION_USE_SAME_PASSWORD="true" | |
| 41 | - | else | |
| 42 | - | ARCHUP_ENCRYPTION_USE_SAME_PASSWORD="false" | |
| 43 | - | fi | |
| 44 | - | ||
| 45 | - | # Email (optional) | |
| 46 | - | echo | |
| 47 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Email is used for SSH key generation and git configuration" | |
| 48 | - | ARCHUP_EMAIL=$(gum input --placeholder "user@example.com (optional)" \ | |
| 49 | - | --prompt "Email: " \ | |
| 50 | - | --padding "0 0 0 $PADDING_LEFT") | |
| 51 | - | ||
| 52 | - | # Hostname | |
| 53 | - | echo | |
| 54 | - | ARCHUP_HOSTNAME=$(gum input --placeholder "archup" \ | |
| 55 | - | --prompt "Hostname: " \ | |
| 56 | - | --padding "0 0 0 $PADDING_LEFT" \ | |
| 57 | - | --value "archup") | |
| 58 | - | ||
| 59 | - | if [ -z "$ARCHUP_HOSTNAME" ]; then | |
| 60 | - | ARCHUP_HOSTNAME="archup" | |
| 61 | - | fi | |
| 62 | - | ||
| 63 | - | # Timezone (detect via API) | |
| 64 | - | echo | |
| 65 | - | gum style --foreground 6 --padding "0 0 0 $PADDING_LEFT" "Detecting timezone..." | |
| 66 | - | DETECTED_TIMEZONE=$(curl -s "https://ipapi.co/timezone/" 2>/dev/null) | |
| 67 | - | ||
| 68 | - | if [ -n "$DETECTED_TIMEZONE" ]; then | |
| 69 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "Detected: $DETECTED_TIMEZONE" | |
| 70 | - | if gum confirm "Use detected timezone?" --padding "0 0 0 $PADDING_LEFT"; then | |
| 71 | - | ARCHUP_TIMEZONE="$DETECTED_TIMEZONE" | |
| 72 | - | else | |
| 73 | - | ARCHUP_TIMEZONE=$(gum input --placeholder "America/New_York" \ | |
| 74 | - | --prompt "Timezone: " \ | |
| 75 | - | --padding "0 0 0 $PADDING_LEFT") | |
| 76 | - | fi | |
| 77 | - | else | |
| 78 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "Unable to detect timezone" | |
| 79 | - | ARCHUP_TIMEZONE=$(gum input --placeholder "America/New_York" \ | |
| 80 | - | --prompt "Timezone: " \ | |
| 81 | - | --padding "0 0 0 $PADDING_LEFT") | |
| 82 | - | fi | |
| 83 | - | ||
| 84 | - | if [ -z "$ARCHUP_TIMEZONE" ]; then | |
| 85 | - | ARCHUP_TIMEZONE="UTC" | |
| 86 | - | fi | |
| 87 | - | ||
| 88 | - | # Export and save all identity variables | |
| 89 | - | export ARCHUP_USERNAME | |
| 90 | - | export ARCHUP_PASSWORD | |
| 91 | - | export ARCHUP_EMAIL | |
| 92 | - | export ARCHUP_HOSTNAME | |
| 93 | - | export ARCHUP_TIMEZONE | |
| 94 | - | export ARCHUP_ENCRYPTION_USE_SAME_PASSWORD | |
| 95 | - | ||
| 96 | - | config_set "ARCHUP_USERNAME" "$ARCHUP_USERNAME" | |
| 97 | - | config_set "ARCHUP_PASSWORD" "$ARCHUP_PASSWORD" | |
| 98 | - | config_set "ARCHUP_EMAIL" "$ARCHUP_EMAIL" | |
| 99 | - | config_set "ARCHUP_HOSTNAME" "$ARCHUP_HOSTNAME" | |
| 100 | - | config_set "ARCHUP_TIMEZONE" "$ARCHUP_TIMEZONE" | |
| 101 | - | config_set "ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" "$ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" | |
| 102 | - | ||
| 103 | - | # Display summary | |
| 104 | - | echo | |
| 105 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] User: $ARCHUP_USERNAME" | |
| 106 | - | if [ -n "$ARCHUP_EMAIL" ]; then | |
| 107 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Email: $ARCHUP_EMAIL" | |
| 108 | - | else | |
| 109 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] Email: not provided" | |
| 110 | - | fi | |
| 111 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Hostname: $ARCHUP_HOSTNAME" | |
| 112 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Timezone: $ARCHUP_TIMEZONE" | |
| 113 | - | if [ "$ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" = "true" ]; then | |
| 114 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Disk Encryption: using account password" | |
| 115 | - | else | |
| 116 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Disk Encryption: separate password (will be prompted during setup)" | |
| 117 | - | fi | |
| 118 | - | ||
| 119 | - | echo "User: $ARCHUP_USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 120 | - | echo "Email: ${ARCHUP_EMAIL:-<not provided>}" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 121 | - | echo "Hostname: $ARCHUP_HOSTNAME" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 122 | - | echo "Timezone: $ARCHUP_TIMEZONE" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 123 | - | echo "Encryption Password: $ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,123 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # User Identity Configuration - All identity prompts consolidated | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "User Identity" | |||
| 5 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Configure your user account and system details" | |||
| 6 | - | echo | |||
| 7 | - | ||||
| 8 | - | # Username | |||
| 9 | - | ARCHUP_USERNAME=$(gum input --placeholder "username" \ | |||
| 10 | - | --prompt "Username: " \ | |||
| 11 | - | --padding "0 0 0 $PADDING_LEFT") | |||
| 12 | - | ||||
| 13 | - | if [ -z "$ARCHUP_USERNAME" ]; then | |||
| 14 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "ERROR: Username cannot be empty" | |||
| 15 | - | exit 1 | |||
| 16 | - | fi | |||
| 17 | - | ||||
| 18 | - | # Password (with confirmation) | |||
| 19 | - | while true; do | |||
| 20 | - | ARCHUP_PASSWORD=$(gum input --password --placeholder "Enter password" \ | |||
| 21 | - | --prompt "Password: " \ | |||
| 22 | - | --padding "0 0 0 $PADDING_LEFT") | |||
| 23 | - | ||||
| 24 | - | ARCHUP_PASSWORD_CONFIRM=$(gum input --password --placeholder "Confirm password" \ | |||
| 25 | - | --prompt "Confirm: " \ | |||
| 26 | - | --padding "0 0 0 $PADDING_LEFT") | |||
| 27 | - | ||||
| 28 | - | if [ "$ARCHUP_PASSWORD" = "$ARCHUP_PASSWORD_CONFIRM" ]; then | |||
| 29 | - | break | |||
| 30 | - | else | |||
| 31 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "Passwords do not match. Try again." | |||
| 32 | - | fi | |||
| 33 | - | done | |||
| 34 | - | ||||
| 35 | - | # Encryption Password Choice | |||
| 36 | - | echo | |||
| 37 | - | gum style --foreground 6 --padding "0 0 0 $PADDING_LEFT" "Disk Encryption" | |||
| 38 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Choose whether to use the same password for disk encryption" | |||
| 39 | - | if gum confirm "Use same password for disk encryption?" --padding "0 0 1 $PADDING_LEFT"; then | |||
| 40 | - | ARCHUP_ENCRYPTION_USE_SAME_PASSWORD="true" | |||
| 41 | - | else | |||
| 42 | - | ARCHUP_ENCRYPTION_USE_SAME_PASSWORD="false" | |||
| 43 | - | fi | |||
| 44 | - | ||||
| 45 | - | # Email (optional) | |||
| 46 | - | echo | |||
| 47 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Email is used for SSH key generation and git configuration" | |||
| 48 | - | ARCHUP_EMAIL=$(gum input --placeholder "user@example.com (optional)" \ | |||
| 49 | - | --prompt "Email: " \ | |||
| 50 | - | --padding "0 0 0 $PADDING_LEFT") | |||
| 51 | - | ||||
| 52 | - | # Hostname | |||
| 53 | - | echo | |||
| 54 | - | ARCHUP_HOSTNAME=$(gum input --placeholder "archup" \ | |||
| 55 | - | --prompt "Hostname: " \ | |||
| 56 | - | --padding "0 0 0 $PADDING_LEFT" \ | |||
| 57 | - | --value "archup") | |||
| 58 | - | ||||
| 59 | - | if [ -z "$ARCHUP_HOSTNAME" ]; then | |||
| 60 | - | ARCHUP_HOSTNAME="archup" | |||
| 61 | - | fi | |||
| 62 | - | ||||
| 63 | - | # Timezone (detect via API) | |||
| 64 | - | echo | |||
| 65 | - | gum style --foreground 6 --padding "0 0 0 $PADDING_LEFT" "Detecting timezone..." | |||
| 66 | - | DETECTED_TIMEZONE=$(curl -s "https://ipapi.co/timezone/" 2>/dev/null) | |||
| 67 | - | ||||
| 68 | - | if [ -n "$DETECTED_TIMEZONE" ]; then | |||
| 69 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "Detected: $DETECTED_TIMEZONE" | |||
| 70 | - | if gum confirm "Use detected timezone?" --padding "0 0 0 $PADDING_LEFT"; then | |||
| 71 | - | ARCHUP_TIMEZONE="$DETECTED_TIMEZONE" | |||
| 72 | - | else | |||
| 73 | - | ARCHUP_TIMEZONE=$(gum input --placeholder "America/New_York" \ | |||
| 74 | - | --prompt "Timezone: " \ | |||
| 75 | - | --padding "0 0 0 $PADDING_LEFT") | |||
| 76 | - | fi | |||
| 77 | - | else | |||
| 78 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "Unable to detect timezone" | |||
| 79 | - | ARCHUP_TIMEZONE=$(gum input --placeholder "America/New_York" \ | |||
| 80 | - | --prompt "Timezone: " \ | |||
| 81 | - | --padding "0 0 0 $PADDING_LEFT") | |||
| 82 | - | fi | |||
| 83 | - | ||||
| 84 | - | if [ -z "$ARCHUP_TIMEZONE" ]; then | |||
| 85 | - | ARCHUP_TIMEZONE="UTC" | |||
| 86 | - | fi | |||
| 87 | - | ||||
| 88 | - | # Export and save all identity variables | |||
| 89 | - | export ARCHUP_USERNAME | |||
| 90 | - | export ARCHUP_PASSWORD | |||
| 91 | - | export ARCHUP_EMAIL | |||
| 92 | - | export ARCHUP_HOSTNAME | |||
| 93 | - | export ARCHUP_TIMEZONE | |||
| 94 | - | export ARCHUP_ENCRYPTION_USE_SAME_PASSWORD | |||
| 95 | - | ||||
| 96 | - | config_set "ARCHUP_USERNAME" "$ARCHUP_USERNAME" | |||
| 97 | - | config_set "ARCHUP_PASSWORD" "$ARCHUP_PASSWORD" | |||
| 98 | - | config_set "ARCHUP_EMAIL" "$ARCHUP_EMAIL" | |||
| 99 | - | config_set "ARCHUP_HOSTNAME" "$ARCHUP_HOSTNAME" | |||
| 100 | - | config_set "ARCHUP_TIMEZONE" "$ARCHUP_TIMEZONE" | |||
| 101 | - | config_set "ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" "$ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" | |||
| 102 | - | ||||
| 103 | - | # Display summary | |||
| 104 | - | echo | |||
| 105 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] User: $ARCHUP_USERNAME" | |||
| 106 | - | if [ -n "$ARCHUP_EMAIL" ]; then | |||
| 107 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Email: $ARCHUP_EMAIL" | |||
| 108 | - | else | |||
| 109 | - | gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] Email: not provided" | |||
| 110 | - | fi | |||
| 111 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Hostname: $ARCHUP_HOSTNAME" | |||
| 112 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Timezone: $ARCHUP_TIMEZONE" | |||
| 113 | - | if [ "$ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" = "true" ]; then | |||
| 114 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Disk Encryption: using account password" | |||
| 115 | - | else | |||
| 116 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Disk Encryption: separate password (will be prompted during setup)" | |||
| 117 | - | fi | |||
| 118 | - | ||||
| 119 | - | echo "User: $ARCHUP_USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 120 | - | echo "Email: ${ARCHUP_EMAIL:-<not provided>}" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 121 | - | echo "Hostname: $ARCHUP_HOSTNAME" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 122 | - | echo "Timezone: $ARCHUP_TIMEZONE" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 123 | - | echo "Encryption Password: $ARCHUP_ENCRYPTION_USE_SAME_PASSWORD" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
D install/deprecated/repos/all.sh +0 -10
| @@ -1,10 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Repository setup phase | |
| 3 | - | ||
| 4 | - | stop_log_output # Stop for interactive prompts | |
| 5 | - | ||
| 6 | - | run_logged "$ARCHUP_INSTALL/repos/multilib.sh" # Non-interactive - Enable multilib first | |
| 7 | - | source "$ARCHUP_INSTALL/repos/chaotic.sh" # Interactive (gum confirm) - MUST be before AUR | |
| 8 | - | source "$ARCHUP_INSTALL/repos/aur.sh" # Interactive (gum confirm + choose) | |
| 9 | - | ||
| 10 | - | start_log_output # Resume (will be stopped by stop_install_log) | |
| @@ -1,10 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Repository setup phase | |||
| 3 | - | ||||
| 4 | - | stop_log_output # Stop for interactive prompts | |||
| 5 | - | ||||
| 6 | - | run_logged "$ARCHUP_INSTALL/repos/multilib.sh" # Non-interactive - Enable multilib first | |||
| 7 | - | source "$ARCHUP_INSTALL/repos/chaotic.sh" # Interactive (gum confirm) - MUST be before AUR | |||
| 8 | - | source "$ARCHUP_INSTALL/repos/aur.sh" # Interactive (gum confirm + choose) | |||
| 9 | - | ||||
| 10 | - | start_log_output # Resume (will be stopped by stop_install_log) | |||
D install/deprecated/repos/aur.sh +0 -85
| @@ -1,85 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # AUR helper installation - consolidated paru and yay | |
| 3 | - | ||
| 4 | - | # Function to install paru (available in chaotic-aur) | |
| 5 | - | install_paru() { | |
| 6 | - | local username="$1" | |
| 7 | - | echo "Installing paru from chaotic-aur..." >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 8 | - | ||
| 9 | - | if ! run_with_spinner "Installing paru AUR helper..." "arch-chroot /mnt pacman -S --noconfirm paru"; then | |
| 10 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] paru installation failed" | |
| 11 | - | echo "ERROR: paru installation failed" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 12 | - | export ARCHUP_AUR="failed" | |
| 13 | - | return 1 | |
| 14 | - | fi | |
| 15 | - | ||
| 16 | - | # Verify installation | |
| 17 | - | if arch-chroot /mnt su - "${username}" -c "paru --version" >/dev/null 2>&1; then | |
| 18 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] paru installed successfully" | |
| 19 | - | echo "AUR: enabled (paru installed for user: ${username})" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 20 | - | else | |
| 21 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] paru verification failed" | |
| 22 | - | echo "ERROR: paru verification failed" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 23 | - | export ARCHUP_AUR="failed" | |
| 24 | - | return 1 | |
| 25 | - | fi | |
| 26 | - | } | |
| 27 | - | ||
| 28 | - | # Function to install yay (available in chaotic-aur) | |
| 29 | - | install_yay() { | |
| 30 | - | local username="$1" | |
| 31 | - | echo "Installing yay from chaotic-aur..." >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 32 | - | ||
| 33 | - | if ! run_with_spinner "Installing yay AUR helper..." "arch-chroot /mnt pacman -S --noconfirm yay"; then | |
| 34 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay installation failed" | |
| 35 | - | echo "ERROR: yay installation failed" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 36 | - | export ARCHUP_AUR="failed" | |
| 37 | - | return 1 | |
| 38 | - | fi | |
| 39 | - | ||
| 40 | - | # Verify installation | |
| 41 | - | if arch-chroot /mnt su - "${username}" -c "yay --version" >/dev/null 2>&1; then | |
| 42 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] yay installed successfully" | |
| 43 | - | echo "AUR: enabled (yay installed for user: ${username})" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 44 | - | else | |
| 45 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay verification failed" | |
| 46 | - | echo "ERROR: yay verification failed" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 47 | - | export ARCHUP_AUR="failed" | |
| 48 | - | return 1 | |
| 49 | - | fi | |
| 50 | - | } | |
| 51 | - | ||
| 52 | - | # Main execution | |
| 53 | - | # AUR Support prompt | |
| 54 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "AUR Support" | |
| 55 | - | echo | |
| 56 | - | ||
| 57 | - | if ! gum confirm "Enable AUR support?" --padding "0 0 1 $PADDING_LEFT"; then | |
| 58 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping AUR support" | |
| 59 | - | echo "AUR: disabled" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 60 | - | export ARCHUP_AUR="disabled" | |
| 61 | - | return 0 | |
| 62 | - | fi | |
| 63 | - | ||
| 64 | - | export ARCHUP_AUR="enabled" | |
| 65 | - | ||
| 66 | - | # Choose AUR helper | |
| 67 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Choose AUR Helper" | |
| 68 | - | AUR_HELPER=$(gum choose --cursor.foreground 6 --padding "0 0 1 $PADDING_LEFT" "paru" "yay") | |
| 69 | - | ||
| 70 | - | # Get the username created during installation | |
| 71 | - | USERNAME=$(arch-chroot /mnt ls /home | head -1) | |
| 72 | - | ||
| 73 | - | if [[ -z "${USERNAME}" ]]; then | |
| 74 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Could not find user for AUR helper installation" | |
| 75 | - | echo "ERROR: No user found for AUR helper installation" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 76 | - | export ARCHUP_AUR="failed" | |
| 77 | - | return 1 | |
| 78 | - | fi | |
| 79 | - | ||
| 80 | - | # Install selected AUR helper (both available in chaotic-aur) | |
| 81 | - | if [ "$AUR_HELPER" = "paru" ]; then | |
| 82 | - | install_paru "$USERNAME" | |
| 83 | - | else | |
| 84 | - | install_yay "$USERNAME" | |
| 85 | - | fi | |
| @@ -1,85 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # AUR helper installation - consolidated paru and yay | |||
| 3 | - | ||||
| 4 | - | # Function to install paru (available in chaotic-aur) | |||
| 5 | - | install_paru() { | |||
| 6 | - | local username="$1" | |||
| 7 | - | echo "Installing paru from chaotic-aur..." >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 8 | - | ||||
| 9 | - | if ! run_with_spinner "Installing paru AUR helper..." "arch-chroot /mnt pacman -S --noconfirm paru"; then | |||
| 10 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] paru installation failed" | |||
| 11 | - | echo "ERROR: paru installation failed" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 12 | - | export ARCHUP_AUR="failed" | |||
| 13 | - | return 1 | |||
| 14 | - | fi | |||
| 15 | - | ||||
| 16 | - | # Verify installation | |||
| 17 | - | if arch-chroot /mnt su - "${username}" -c "paru --version" >/dev/null 2>&1; then | |||
| 18 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] paru installed successfully" | |||
| 19 | - | echo "AUR: enabled (paru installed for user: ${username})" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 20 | - | else | |||
| 21 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] paru verification failed" | |||
| 22 | - | echo "ERROR: paru verification failed" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 23 | - | export ARCHUP_AUR="failed" | |||
| 24 | - | return 1 | |||
| 25 | - | fi | |||
| 26 | - | } | |||
| 27 | - | ||||
| 28 | - | # Function to install yay (available in chaotic-aur) | |||
| 29 | - | install_yay() { | |||
| 30 | - | local username="$1" | |||
| 31 | - | echo "Installing yay from chaotic-aur..." >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 32 | - | ||||
| 33 | - | if ! run_with_spinner "Installing yay AUR helper..." "arch-chroot /mnt pacman -S --noconfirm yay"; then | |||
| 34 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay installation failed" | |||
| 35 | - | echo "ERROR: yay installation failed" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 36 | - | export ARCHUP_AUR="failed" | |||
| 37 | - | return 1 | |||
| 38 | - | fi | |||
| 39 | - | ||||
| 40 | - | # Verify installation | |||
| 41 | - | if arch-chroot /mnt su - "${username}" -c "yay --version" >/dev/null 2>&1; then | |||
| 42 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] yay installed successfully" | |||
| 43 | - | echo "AUR: enabled (yay installed for user: ${username})" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 44 | - | else | |||
| 45 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay verification failed" | |||
| 46 | - | echo "ERROR: yay verification failed" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 47 | - | export ARCHUP_AUR="failed" | |||
| 48 | - | return 1 | |||
| 49 | - | fi | |||
| 50 | - | } | |||
| 51 | - | ||||
| 52 | - | # Main execution | |||
| 53 | - | # AUR Support prompt | |||
| 54 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "AUR Support" | |||
| 55 | - | echo | |||
| 56 | - | ||||
| 57 | - | if ! gum confirm "Enable AUR support?" --padding "0 0 1 $PADDING_LEFT"; then | |||
| 58 | - | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping AUR support" | |||
| 59 | - | echo "AUR: disabled" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 60 | - | export ARCHUP_AUR="disabled" | |||
| 61 | - | return 0 | |||
| 62 | - | fi | |||
| 63 | - | ||||
| 64 | - | export ARCHUP_AUR="enabled" | |||
| 65 | - | ||||
| 66 | - | # Choose AUR helper | |||
| 67 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Choose AUR Helper" | |||
| 68 | - | AUR_HELPER=$(gum choose --cursor.foreground 6 --padding "0 0 1 $PADDING_LEFT" "paru" "yay") | |||
| 69 | - | ||||
| 70 | - | # Get the username created during installation | |||
| 71 | - | USERNAME=$(arch-chroot /mnt ls /home | head -1) | |||
| 72 | - | ||||
| 73 | - | if [[ -z "${USERNAME}" ]]; then | |||
| 74 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Could not find user for AUR helper installation" | |||
| 75 | - | echo "ERROR: No user found for AUR helper installation" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 76 | - | export ARCHUP_AUR="failed" | |||
| 77 | - | return 1 | |||
| 78 | - | fi | |||
| 79 | - | ||||
| 80 | - | # Install selected AUR helper (both available in chaotic-aur) | |||
| 81 | - | if [ "$AUR_HELPER" = "paru" ]; then | |||
| 82 | - | install_paru "$USERNAME" | |||
| 83 | - | else | |||
| 84 | - | install_yay "$USERNAME" | |||
| 85 | - | fi | |||
D install/deprecated/repos/chaotic.sh +0 -57
| @@ -1,57 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Add Chaotic-AUR repository (required for limine-snapper-sync and other packages) | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Adding Chaotic-AUR repository..." | |
| 5 | - | ||
| 6 | - | export ARCHUP_CHAOTIC="enabled" | |
| 7 | - | ||
| 8 | - | # Install Chaotic-AUR keyring and mirrorlist | |
| 9 | - | arch-chroot /mnt pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 10 | - | arch-chroot /mnt pacman-key --lsign-key 3056513887B78AEB >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 11 | - | ||
| 12 | - | # Install chaotic-keyring and chaotic-mirrorlist | |
| 13 | - | arch-chroot /mnt pacman -U --noconfirm \ | |
| 14 | - | 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' \ | |
| 15 | - | 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 16 | - | ||
| 17 | - | # Add Chaotic-AUR to pacman.conf | |
| 18 | - | if ! grep -q "\[chaotic-aur\]" /mnt/etc/pacman.conf; then | |
| 19 | - | cat >> /mnt/etc/pacman.conf <<EOF | |
| 20 | - | ||
| 21 | - | # Chaotic-AUR repository | |
| 22 | - | [chaotic-aur] | |
| 23 | - | Include = /etc/pacman.d/chaotic-mirrorlist | |
| 24 | - | EOF | |
| 25 | - | ||
| 26 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Added Chaotic-AUR to pacman.conf" | |
| 27 | - | fi | |
| 28 | - | ||
| 29 | - | # Update package databases | |
| 30 | - | arch-chroot /mnt pacman -Sy --noconfirm >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 31 | - | ||
| 32 | - | # Verify Chaotic-AUR is working | |
| 33 | - | if arch-chroot /mnt pacman -Sl chaotic-aur >/dev/null 2>&1; then | |
| 34 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Chaotic-AUR enabled successfully" | |
| 35 | - | echo "Chaotic-AUR: enabled (repo added to pacman.conf)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 36 | - | else | |
| 37 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Chaotic-AUR verification failed" | |
| 38 | - | echo "WARNING: Chaotic-AUR verification failed" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 39 | - | export ARCHUP_CHAOTIC="failed" | |
| 40 | - | return 1 | |
| 41 | - | fi | |
| 42 | - | ||
| 43 | - | # Install extra packages from Chaotic-AUR | |
| 44 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing extra packages..." | |
| 45 | - | ||
| 46 | - | # Read extra package list | |
| 47 | - | mapfile -t extra_packages < <(grep -v '^#' "$ARCHUP_INSTALL/extra.packages" | grep -v '^$') | |
| 48 | - | ||
| 49 | - | echo "Installing ${#extra_packages[@]} extra packages: ${extra_packages[*]}" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 50 | - | ||
| 51 | - | if ! run_with_spinner "Installing extra packages (${#extra_packages[@]} packages)..." "arch-chroot /mnt pacman -S --noconfirm ${extra_packages[*]}"; then | |
| 52 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Extra packages installation failed" | |
| 53 | - | echo "WARNING: Some extra packages failed to install" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 54 | - | else | |
| 55 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Extra packages installed" | |
| 56 | - | echo "Installed ${#extra_packages[@]} extra packages" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 57 | - | fi | |
| @@ -1,57 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Add Chaotic-AUR repository (required for limine-snapper-sync and other packages) | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Adding Chaotic-AUR repository..." | |||
| 5 | - | ||||
| 6 | - | export ARCHUP_CHAOTIC="enabled" | |||
| 7 | - | ||||
| 8 | - | # Install Chaotic-AUR keyring and mirrorlist | |||
| 9 | - | arch-chroot /mnt pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 10 | - | arch-chroot /mnt pacman-key --lsign-key 3056513887B78AEB >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 11 | - | ||||
| 12 | - | # Install chaotic-keyring and chaotic-mirrorlist | |||
| 13 | - | arch-chroot /mnt pacman -U --noconfirm \ | |||
| 14 | - | 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' \ | |||
| 15 | - | 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 16 | - | ||||
| 17 | - | # Add Chaotic-AUR to pacman.conf | |||
| 18 | - | if ! grep -q "\[chaotic-aur\]" /mnt/etc/pacman.conf; then | |||
| 19 | - | cat >> /mnt/etc/pacman.conf <<EOF | |||
| 20 | - | ||||
| 21 | - | # Chaotic-AUR repository | |||
| 22 | - | [chaotic-aur] | |||
| 23 | - | Include = /etc/pacman.d/chaotic-mirrorlist | |||
| 24 | - | EOF | |||
| 25 | - | ||||
| 26 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Added Chaotic-AUR to pacman.conf" | |||
| 27 | - | fi | |||
| 28 | - | ||||
| 29 | - | # Update package databases | |||
| 30 | - | arch-chroot /mnt pacman -Sy --noconfirm >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 31 | - | ||||
| 32 | - | # Verify Chaotic-AUR is working | |||
| 33 | - | if arch-chroot /mnt pacman -Sl chaotic-aur >/dev/null 2>&1; then | |||
| 34 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Chaotic-AUR enabled successfully" | |||
| 35 | - | echo "Chaotic-AUR: enabled (repo added to pacman.conf)" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 36 | - | else | |||
| 37 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Chaotic-AUR verification failed" | |||
| 38 | - | echo "WARNING: Chaotic-AUR verification failed" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 39 | - | export ARCHUP_CHAOTIC="failed" | |||
| 40 | - | return 1 | |||
| 41 | - | fi | |||
| 42 | - | ||||
| 43 | - | # Install extra packages from Chaotic-AUR | |||
| 44 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing extra packages..." | |||
| 45 | - | ||||
| 46 | - | # Read extra package list | |||
| 47 | - | mapfile -t extra_packages < <(grep -v '^#' "$ARCHUP_INSTALL/extra.packages" | grep -v '^$') | |||
| 48 | - | ||||
| 49 | - | echo "Installing ${#extra_packages[@]} extra packages: ${extra_packages[*]}" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 50 | - | ||||
| 51 | - | if ! run_with_spinner "Installing extra packages (${#extra_packages[@]} packages)..." "arch-chroot /mnt pacman -S --noconfirm ${extra_packages[*]}"; then | |||
| 52 | - | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Extra packages installation failed" | |||
| 53 | - | echo "WARNING: Some extra packages failed to install" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 54 | - | else | |||
| 55 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Extra packages installed" | |||
| 56 | - | echo "Installed ${#extra_packages[@]} extra packages" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 57 | - | fi | |||
D install/deprecated/repos/multilib.sh +0 -9
| @@ -1,9 +0,0 @@ | |||
| 1 | - | #!/bin/bash | |
| 2 | - | # Enable multilib in installed system | |
| 3 | - | ||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring multilib repository..." | |
| 5 | - | ||
| 6 | - | # Enable multilib in installed system's pacman.conf | |
| 7 | - | enable_multilib "/mnt/etc/pacman.conf" | |
| 8 | - | ||
| 9 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Multilib configured" | |
| @@ -1,9 +0,0 @@ | |||||
| 1 | - | #!/bin/bash | |||
| 2 | - | # Enable multilib in installed system | |||
| 3 | - | ||||
| 4 | - | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring multilib repository..." | |||
| 5 | - | ||||
| 6 | - | # Enable multilib in installed system's pacman.conf | |||
| 7 | - | enable_multilib "/mnt/etc/pacman.conf" | |||
| 8 | - | ||||
| 9 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Multilib configured" | |||