detached 4fd0033

fix(logging): separate interactive prompts from log monitor to prevent UI conflicts

commit
4fd003327dd32ee975f396334a6e7b462f58651d
author
bnema · · 2025-10-19 17:45 UTC
parent
70dfe8f
signature
unsigned
27 files · +230 -182
M install.sh +9 -5
@@ -2,7 +2,7 @@
22 # archup - Fast, minimal Arch Linux auto-installer
33 # Main installation orchestrator
44
5-set -eEo pipefail
5+set -eo pipefail
66
77 # Export global paths
88 export ARCHUP_PATH="${ARCHUP_PATH:-$HOME/.local/share/archup}"
@@ -64,7 +64,7 @@ if [ ! -d "$ARCHUP_INSTALL" ]; then
6464 echo "Downloading presets..."
6565 curl -sL "$GITHUB_RAW/install/presets/barebone.packages" -o "$ARCHUP_INSTALL/presets/barebone.packages"
6666
67- echo "✓ All files downloaded successfully"
67+ echo "[OK] All files downloaded successfully"
6868 echo ""
6969 fi
7070
@@ -74,17 +74,21 @@ source "$ARCHUP_INSTALL/bootstrap.sh"
7474 # Source all helper utilities (now safe to use gum)
7575 source "$ARCHUP_INSTALL/helpers/all.sh"
7676
77-# Display logo and start installation
77+# Display logo
7878 clear_logo
79-start_install_log
8079
8180 # ============================================================
8281 # PHASE 1: BAREBONE INSTALLER - BASIC
8382 # ============================================================
8483
85-# Preflight validation
84+# Preflight validation (interactive prompts BEFORE logging starts)
8685 source "$ARCHUP_INSTALL/preflight/all.sh"
8786
87+# Start log monitor AFTER all interactive prompts
88+gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing..."
89+echo
90+start_install_log
91+
8892 # Partitioning (auto GPT, ext4, no encryption)
8993 source "$ARCHUP_INSTALL/partitioning/all.sh"
9094
@@ -2,7 +2,7 @@
2 # archup - Fast, minimal Arch Linux auto-installer2 # archup - Fast, minimal Arch Linux auto-installer
3 # Main installation orchestrator3 # Main installation orchestrator
4 4
5-set -eEo pipefail5+set -eo pipefail
6 6
7 # Export global paths7 # Export global paths
8 export ARCHUP_PATH="${ARCHUP_PATH:-$HOME/.local/share/archup}"8 export ARCHUP_PATH="${ARCHUP_PATH:-$HOME/.local/share/archup}"
@@ -64,7 +64,7 @@ if [ ! -d "$ARCHUP_INSTALL" ]; then
64 echo "Downloading presets..."64 echo "Downloading presets..."
65 curl -sL "$GITHUB_RAW/install/presets/barebone.packages" -o "$ARCHUP_INSTALL/presets/barebone.packages"65 curl -sL "$GITHUB_RAW/install/presets/barebone.packages" -o "$ARCHUP_INSTALL/presets/barebone.packages"
66 66
67- echo "✓ All files downloaded successfully"67+ echo "[OK] All files downloaded successfully"
68 echo ""68 echo ""
69 fi69 fi
70 70
@@ -74,17 +74,21 @@ source "$ARCHUP_INSTALL/bootstrap.sh"
74 # Source all helper utilities (now safe to use gum)74 # Source all helper utilities (now safe to use gum)
75 source "$ARCHUP_INSTALL/helpers/all.sh"75 source "$ARCHUP_INSTALL/helpers/all.sh"
76 76
77-# Display logo and start installation77+# Display logo
78 clear_logo78 clear_logo
79-start_install_log
80 79
81 # ============================================================80 # ============================================================
82 # PHASE 1: BAREBONE INSTALLER - BASIC81 # PHASE 1: BAREBONE INSTALLER - BASIC
83 # ============================================================82 # ============================================================
84 83
85-# Preflight validation84+# Preflight validation (interactive prompts BEFORE logging starts)
86 source "$ARCHUP_INSTALL/preflight/all.sh"85 source "$ARCHUP_INSTALL/preflight/all.sh"
87 86
87+# Start log monitor AFTER all interactive prompts
88+gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing..."
89+echo
90+start_install_log
91+
88 # Partitioning (auto GPT, ext4, no encryption)92 # Partitioning (auto GPT, ext4, no encryption)
89 source "$ARCHUP_INSTALL/partitioning/all.sh"93 source "$ARCHUP_INSTALL/partitioning/all.sh"
90 94
M install/base/all.sh +4 -4
@@ -1,6 +1,6 @@
11 #!/bin/bash
2-# Base installation phase orchestrator
2+# Base installation phase
33
4-run_logged "$ARCHUP_INSTALL/base/kernel.sh"
5-run_logged "$ARCHUP_INSTALL/base/pacstrap.sh"
6-run_logged "$ARCHUP_INSTALL/base/fstab.sh"
4+source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose)
5+run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive
6+run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive
@@ -1,6 +1,6 @@
1 #!/bin/bash1 #!/bin/bash
2-# Base installation phase orchestrator2+# Base installation phase
3 3
4-run_logged "$ARCHUP_INSTALL/base/kernel.sh"4+source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose)
5-run_logged "$ARCHUP_INSTALL/base/pacstrap.sh"5+run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive
6-run_logged "$ARCHUP_INSTALL/base/fstab.sh"6+run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive
M install/base/fstab.sh +2 -2
@@ -6,6 +6,6 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Generating fstab..."
66 # Generate fstab using UUIDs
77 genfstab -U /mnt >> /mnt/etc/fstab
88
9-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ fstab generated"
9+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] fstab generated"
1010
11-echo "Generated /etc/fstab" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
11+echo "Generated /etc/fstab"
@@ -6,6 +6,6 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Generating fstab..."
6 # Generate fstab using UUIDs6 # Generate fstab using UUIDs
7 genfstab -U /mnt >> /mnt/etc/fstab7 genfstab -U /mnt >> /mnt/etc/fstab
8 8
9-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ fstab generated"9+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] fstab generated"
10 10
11-echo "Generated /etc/fstab" | tee -a "$ARCHUP_INSTALL_LOG_FILE"11+echo "Generated /etc/fstab"
M install/base/kernel.sh +12 -12
@@ -15,8 +15,8 @@ echo
1515 KERNEL_CHOICE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "linux" "linux-lts" "linux-zen")
1616 export ARCHUP_KERNEL="$KERNEL_CHOICE"
1717
18-gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Selected: $ARCHUP_KERNEL"
19-echo "Kernel: $ARCHUP_KERNEL" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
18+gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Selected: $ARCHUP_KERNEL"
19+echo "Kernel: $ARCHUP_KERNEL" >> "$ARCHUP_INSTALL_LOG_FILE"
2020
2121 # Detect CPU vendor
2222 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Detecting CPU vendor..."
@@ -32,17 +32,17 @@ elif [ "$CPU_VENDOR" = "AuthenticAMD" ]; then
3232 else
3333 MICROCODE=""
3434 CPU_TYPE="Unknown"
35- gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⚠ Unknown CPU vendor: $CPU_VENDOR"
35+ gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[WARN] Unknown CPU vendor: $CPU_VENDOR"
3636 fi
3737
3838 if [ -n "$MICROCODE" ]; then
3939 export ARCHUP_MICROCODE="$MICROCODE"
40- gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Detected: $CPU_TYPE CPU"
40+ gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Detected: $CPU_TYPE CPU"
4141 gum style --padding "0 0 1 $PADDING_LEFT" " Microcode: $MICROCODE"
42- echo "CPU: $CPU_TYPE, Microcode: $MICROCODE" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
42+ echo "CPU: $CPU_TYPE, Microcode: $MICROCODE" >> "$ARCHUP_INSTALL_LOG_FILE"
4343 else
4444 export ARCHUP_MICROCODE=""
45- echo "CPU: Unknown, no microcode" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
45+ echo "CPU: Unknown, no microcode" >> "$ARCHUP_INSTALL_LOG_FILE"
4646 fi
4747
4848 # AMD-specific tuning (P-State driver selection)
@@ -78,13 +78,13 @@ if [ "$CPU_TYPE" = "AMD" ]; then
7878 fi
7979
8080 # Remove duplicates and sort
81- AVAILABLE_MODES=($(printf '%s\n' "${AVAILABLE_MODES[@]}" | sort -u))
81+ mapfile -t AVAILABLE_MODES < <(printf '%s\n' "${AVAILABLE_MODES[@]}" | sort -u)
8282
8383 # Display detected modes
8484 if [ ${#AVAILABLE_MODES[@]} -gt 0 ]; then
85- gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Detected ${#AVAILABLE_MODES[@]} available mode(s): ${AVAILABLE_MODES[*]}"
85+ gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Detected ${#AVAILABLE_MODES[@]} available mode(s): ${AVAILABLE_MODES[*]}"
8686 else
87- gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⚠ Could not detect available modes, using defaults"
87+ gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[WARN] Could not detect available modes, using defaults"
8888 AVAILABLE_MODES=("passive")
8989 fi
9090
@@ -111,8 +111,8 @@ if [ "$CPU_TYPE" = "AMD" ]; then
111111
112112 AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${AVAILABLE_MODES[@]}")
113113 export ARCHUP_AMD_PSTATE="$AMD_PSTATE"
114- gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ P-State: $AMD_PSTATE"
115- echo "AMD P-State: $AMD_PSTATE (kernel parameter)" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
114+ gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] P-State: $AMD_PSTATE"
115+ echo "AMD P-State: $AMD_PSTATE (kernel parameter)" >> "$ARCHUP_INSTALL_LOG_FILE"
116116
117117 # Prepare kernel parameters for AMD P-State
118118 export ARCHUP_AMD_KERNEL_PARAMS="amd_pstate=$AMD_PSTATE"
@@ -121,4 +121,4 @@ else
121121 export ARCHUP_AMD_KERNEL_PARAMS=""
122122 fi
123123
124-gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Kernel configuration complete"
124+gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Kernel configuration complete"
@@ -15,8 +15,8 @@ echo
15 KERNEL_CHOICE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "linux" "linux-lts" "linux-zen")15 KERNEL_CHOICE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "linux" "linux-lts" "linux-zen")
16 export ARCHUP_KERNEL="$KERNEL_CHOICE"16 export ARCHUP_KERNEL="$KERNEL_CHOICE"
17 17
18-gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Selected: $ARCHUP_KERNEL"18+gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Selected: $ARCHUP_KERNEL"
19-echo "Kernel: $ARCHUP_KERNEL" | tee -a "$ARCHUP_INSTALL_LOG_FILE"19+echo "Kernel: $ARCHUP_KERNEL" >> "$ARCHUP_INSTALL_LOG_FILE"
20 20
21 # Detect CPU vendor21 # Detect CPU vendor
22 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Detecting CPU vendor..."22 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Detecting CPU vendor..."
@@ -32,17 +32,17 @@ elif [ "$CPU_VENDOR" = "AuthenticAMD" ]; then
32 else32 else
33 MICROCODE=""33 MICROCODE=""
34 CPU_TYPE="Unknown"34 CPU_TYPE="Unknown"
35- gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⚠ Unknown CPU vendor: $CPU_VENDOR"35+ gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[WARN] Unknown CPU vendor: $CPU_VENDOR"
36 fi36 fi
37 37
38 if [ -n "$MICROCODE" ]; then38 if [ -n "$MICROCODE" ]; then
39 export ARCHUP_MICROCODE="$MICROCODE"39 export ARCHUP_MICROCODE="$MICROCODE"
40- gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Detected: $CPU_TYPE CPU"40+ gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Detected: $CPU_TYPE CPU"
41 gum style --padding "0 0 1 $PADDING_LEFT" " Microcode: $MICROCODE"41 gum style --padding "0 0 1 $PADDING_LEFT" " Microcode: $MICROCODE"
42- echo "CPU: $CPU_TYPE, Microcode: $MICROCODE" | tee -a "$ARCHUP_INSTALL_LOG_FILE"42+ echo "CPU: $CPU_TYPE, Microcode: $MICROCODE" >> "$ARCHUP_INSTALL_LOG_FILE"
43 else43 else
44 export ARCHUP_MICROCODE=""44 export ARCHUP_MICROCODE=""
45- echo "CPU: Unknown, no microcode" | tee -a "$ARCHUP_INSTALL_LOG_FILE"45+ echo "CPU: Unknown, no microcode" >> "$ARCHUP_INSTALL_LOG_FILE"
46 fi46 fi
47 47
48 # AMD-specific tuning (P-State driver selection)48 # AMD-specific tuning (P-State driver selection)
@@ -78,13 +78,13 @@ if [ "$CPU_TYPE" = "AMD" ]; then
78 fi78 fi
79 79
80 # Remove duplicates and sort80 # Remove duplicates and sort
81- AVAILABLE_MODES=($(printf '%s\n' "${AVAILABLE_MODES[@]}" | sort -u))81+ mapfile -t AVAILABLE_MODES < <(printf '%s\n' "${AVAILABLE_MODES[@]}" | sort -u)
82 82
83 # Display detected modes83 # Display detected modes
84 if [ ${#AVAILABLE_MODES[@]} -gt 0 ]; then84 if [ ${#AVAILABLE_MODES[@]} -gt 0 ]; then
85- gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Detected ${#AVAILABLE_MODES[@]} available mode(s): ${AVAILABLE_MODES[*]}"85+ gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Detected ${#AVAILABLE_MODES[@]} available mode(s): ${AVAILABLE_MODES[*]}"
86 else86 else
87- gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⚠ Could not detect available modes, using defaults"87+ gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[WARN] Could not detect available modes, using defaults"
88 AVAILABLE_MODES=("passive")88 AVAILABLE_MODES=("passive")
89 fi89 fi
90 90
@@ -111,8 +111,8 @@ if [ "$CPU_TYPE" = "AMD" ]; then
111 111
112 AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${AVAILABLE_MODES[@]}")112 AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${AVAILABLE_MODES[@]}")
113 export ARCHUP_AMD_PSTATE="$AMD_PSTATE"113 export ARCHUP_AMD_PSTATE="$AMD_PSTATE"
114- gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ P-State: $AMD_PSTATE"114+ gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] P-State: $AMD_PSTATE"
115- echo "AMD P-State: $AMD_PSTATE (kernel parameter)" | tee -a "$ARCHUP_INSTALL_LOG_FILE"115+ echo "AMD P-State: $AMD_PSTATE (kernel parameter)" >> "$ARCHUP_INSTALL_LOG_FILE"
116 116
117 # Prepare kernel parameters for AMD P-State117 # Prepare kernel parameters for AMD P-State
118 export ARCHUP_AMD_KERNEL_PARAMS="amd_pstate=$AMD_PSTATE"118 export ARCHUP_AMD_KERNEL_PARAMS="amd_pstate=$AMD_PSTATE"
@@ -121,4 +121,4 @@ else
121 export ARCHUP_AMD_KERNEL_PARAMS=""121 export ARCHUP_AMD_KERNEL_PARAMS=""
122 fi122 fi
123 123
124-gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Kernel configuration complete"124+gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Kernel configuration complete"
M install/base/pacstrap.sh +5 -5
@@ -10,24 +10,24 @@ mapfile -t packages < <(grep -v '^#' "$ARCHUP_INSTALL/presets/barebone.packages"
1010 # Add kernel (selected in kernel.sh)
1111 if [ -n "$ARCHUP_KERNEL" ]; then
1212 packages+=("$ARCHUP_KERNEL")
13- echo "Adding kernel: $ARCHUP_KERNEL" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
13+ echo "Adding kernel: $ARCHUP_KERNEL" >> "$ARCHUP_INSTALL_LOG_FILE"
1414 fi
1515
1616 # Add microcode (detected in kernel.sh)
1717 if [ -n "$ARCHUP_MICROCODE" ]; then
1818 packages+=("$ARCHUP_MICROCODE")
19- echo "Adding microcode: $ARCHUP_MICROCODE" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
19+ echo "Adding microcode: $ARCHUP_MICROCODE" >> "$ARCHUP_INSTALL_LOG_FILE"
2020 fi
2121
2222 # Add cryptsetup if encryption is enabled
2323 if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
2424 packages+=("cryptsetup")
25- echo "Adding cryptsetup for LUKS encryption" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
25+ echo "Adding cryptsetup for LUKS encryption" >> "$ARCHUP_INSTALL_LOG_FILE"
2626 fi
2727
2828 # Install base system
2929 pacstrap /mnt "${packages[@]}"
3030
31-gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Base system installed"
31+gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Base system installed"
3232
33-echo "Installed ${#packages[@]} packages" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
33+echo "Installed ${#packages[@]} packages" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -10,24 +10,24 @@ mapfile -t packages < <(grep -v '^#' "$ARCHUP_INSTALL/presets/barebone.packages"
10 # Add kernel (selected in kernel.sh)10 # Add kernel (selected in kernel.sh)
11 if [ -n "$ARCHUP_KERNEL" ]; then11 if [ -n "$ARCHUP_KERNEL" ]; then
12 packages+=("$ARCHUP_KERNEL")12 packages+=("$ARCHUP_KERNEL")
13- echo "Adding kernel: $ARCHUP_KERNEL" | tee -a "$ARCHUP_INSTALL_LOG_FILE"13+ echo "Adding kernel: $ARCHUP_KERNEL" >> "$ARCHUP_INSTALL_LOG_FILE"
14 fi14 fi
15 15
16 # Add microcode (detected in kernel.sh)16 # Add microcode (detected in kernel.sh)
17 if [ -n "$ARCHUP_MICROCODE" ]; then17 if [ -n "$ARCHUP_MICROCODE" ]; then
18 packages+=("$ARCHUP_MICROCODE")18 packages+=("$ARCHUP_MICROCODE")
19- echo "Adding microcode: $ARCHUP_MICROCODE" | tee -a "$ARCHUP_INSTALL_LOG_FILE"19+ echo "Adding microcode: $ARCHUP_MICROCODE" >> "$ARCHUP_INSTALL_LOG_FILE"
20 fi20 fi
21 21
22 # Add cryptsetup if encryption is enabled22 # Add cryptsetup if encryption is enabled
23 if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then23 if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
24 packages+=("cryptsetup")24 packages+=("cryptsetup")
25- echo "Adding cryptsetup for LUKS encryption" | tee -a "$ARCHUP_INSTALL_LOG_FILE"25+ echo "Adding cryptsetup for LUKS encryption" >> "$ARCHUP_INSTALL_LOG_FILE"
26 fi26 fi
27 27
28 # Install base system28 # Install base system
29 pacstrap /mnt "${packages[@]}"29 pacstrap /mnt "${packages[@]}"
30 30
31-gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Base system installed"31+gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Base system installed"
32 32
33-echo "Installed ${#packages[@]} packages" | tee -a "$ARCHUP_INSTALL_LOG_FILE"33+echo "Installed ${#packages[@]} packages" >> "$ARCHUP_INSTALL_LOG_FILE"
M install/boot/all.sh +1 -2
@@ -1,5 +1,4 @@
11 #!/bin/bash
2-# Bootloader phase orchestrator
3-# archup uses Limine exclusively for its superior btrfs and snapshot support
2+# Bootloader installation phase
43
54 run_logged "$ARCHUP_INSTALL/boot/limine.sh"
@@ -1,5 +1,4 @@
1 #!/bin/bash1 #!/bin/bash
2-# Bootloader phase orchestrator2+# Bootloader installation phase
3-# archup uses Limine exclusively for its superior btrfs and snapshot support
4 3
5 run_logged "$ARCHUP_INSTALL/boot/limine.sh"4 run_logged "$ARCHUP_INSTALL/boot/limine.sh"
M install/boot/limine.sh +5 -5
@@ -17,7 +17,7 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
1717 # Regenerate initramfs
1818 arch-chroot /mnt mkinitcpio -P
1919
20- echo "Updated mkinitcpio.conf with encrypt hook" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
20+ echo "Updated mkinitcpio.conf with encrypt hook"
2121
2222 # Kernel parameters for encrypted boot
2323 KERNEL_PARAMS="cryptdevice=UUID=$ROOT_UUID:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw"
@@ -30,7 +30,7 @@ fi
3030 # Add AMD-specific kernel parameters if configured
3131 if [ -n "$ARCHUP_AMD_KERNEL_PARAMS" ]; then
3232 KERNEL_PARAMS="$KERNEL_PARAMS $ARCHUP_AMD_KERNEL_PARAMS"
33- echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
33+ echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS"
3434 fi
3535
3636 # Install Limine to the disk (UEFI)
@@ -82,10 +82,10 @@ arch-chroot /mnt efibootmgr --create \
8282 --label "archup" \
8383 --loader "\\EFI\\BOOT\\BOOTX64.EFI"
8484
85-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Limine installed and configured"
85+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Limine installed and configured"
8686
8787 if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
88- echo "Installed Limine with encrypted root (UUID: $ROOT_UUID)" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
88+ echo "Installed Limine with encrypted root (UUID: $ROOT_UUID)"
8989 else
90- echo "Installed Limine with root UUID: $ROOT_UUID" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
90+ echo "Installed Limine with root UUID: $ROOT_UUID"
9191 fi
@@ -17,7 +17,7 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
17 # Regenerate initramfs17 # Regenerate initramfs
18 arch-chroot /mnt mkinitcpio -P18 arch-chroot /mnt mkinitcpio -P
19 19
20- echo "Updated mkinitcpio.conf with encrypt hook" | tee -a "$ARCHUP_INSTALL_LOG_FILE"20+ echo "Updated mkinitcpio.conf with encrypt hook"
21 21
22 # Kernel parameters for encrypted boot22 # Kernel parameters for encrypted boot
23 KERNEL_PARAMS="cryptdevice=UUID=$ROOT_UUID:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw"23 KERNEL_PARAMS="cryptdevice=UUID=$ROOT_UUID:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw"
@@ -30,7 +30,7 @@ fi
30 # Add AMD-specific kernel parameters if configured30 # Add AMD-specific kernel parameters if configured
31 if [ -n "$ARCHUP_AMD_KERNEL_PARAMS" ]; then31 if [ -n "$ARCHUP_AMD_KERNEL_PARAMS" ]; then
32 KERNEL_PARAMS="$KERNEL_PARAMS $ARCHUP_AMD_KERNEL_PARAMS"32 KERNEL_PARAMS="$KERNEL_PARAMS $ARCHUP_AMD_KERNEL_PARAMS"
33- echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" | tee -a "$ARCHUP_INSTALL_LOG_FILE"33+ echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS"
34 fi34 fi
35 35
36 # Install Limine to the disk (UEFI)36 # Install Limine to the disk (UEFI)
@@ -82,10 +82,10 @@ arch-chroot /mnt efibootmgr --create \
82 --label "archup" \82 --label "archup" \
83 --loader "\\EFI\\BOOT\\BOOTX64.EFI"83 --loader "\\EFI\\BOOT\\BOOTX64.EFI"
84 84
85-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Limine installed and configured"85+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Limine installed and configured"
86 86
87 if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then87 if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
88- echo "Installed Limine with encrypted root (UUID: $ROOT_UUID)" | tee -a "$ARCHUP_INSTALL_LOG_FILE"88+ echo "Installed Limine with encrypted root (UUID: $ROOT_UUID)"
89 else89 else
90- echo "Installed Limine with root UUID: $ROOT_UUID" | tee -a "$ARCHUP_INSTALL_LOG_FILE"90+ echo "Installed Limine with root UUID: $ROOT_UUID"
91 fi91 fi
M install/bootstrap.sh +9 -3
@@ -5,6 +5,12 @@
55
66 set -e
77
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+
814 echo "=== ArchUp Bootstrap ==="
915 echo "Installing essential dependencies..."
1016
@@ -22,13 +28,13 @@ pacman -Sy --noconfirm
2228 if ! command -v gum &>/dev/null; then
2329 echo "Installing gum for interactive TUI..."
2430 pacman -S --needed --noconfirm gum
25- echo "✓ gum installed"
31+ echo "[OK] gum installed"
2632 else
27- echo "✓ gum already available"
33+ echo "[OK] gum already available"
2834 fi
2935
3036 # Any other critical dependencies that preflight needs can go here
3137 # Example: pacman -S --needed --noconfirm other-tool
3238
33-echo "✓ Bootstrap complete!"
39+echo "[OK] Bootstrap complete!"
3440 echo
@@ -5,6 +5,12 @@
5 5
6 set -e6 set -e
7 7
8+# Clean up old log file to ensure fresh logs for this attempt
9+if [ -f "$ARCHUP_INSTALL_LOG_FILE" ]; then
10+ rm -f "$ARCHUP_INSTALL_LOG_FILE"
11+ echo "Cleared previous installation log"
12+fi
13+
8 echo "=== ArchUp Bootstrap ==="14 echo "=== ArchUp Bootstrap ==="
9 echo "Installing essential dependencies..."15 echo "Installing essential dependencies..."
10 16
@@ -22,13 +28,13 @@ pacman -Sy --noconfirm
22 if ! command -v gum &>/dev/null; then28 if ! command -v gum &>/dev/null; then
23 echo "Installing gum for interactive TUI..."29 echo "Installing gum for interactive TUI..."
24 pacman -S --needed --noconfirm gum30 pacman -S --needed --noconfirm gum
25- echo "✓ gum installed"31+ echo "[OK] gum installed"
26 else32 else
27- echo "✓ gum already available"33+ echo "[OK] gum already available"
28 fi34 fi
29 35
30 # Any other critical dependencies that preflight needs can go here36 # Any other critical dependencies that preflight needs can go here
31 # Example: pacman -S --needed --noconfirm other-tool37 # Example: pacman -S --needed --noconfirm other-tool
32 38
33-echo "✓ Bootstrap complete!"39+echo "[OK] Bootstrap complete!"
34 echo40 echo
M install/config/all.sh +4 -4
@@ -1,6 +1,6 @@
11 #!/bin/bash
2-# Configuration phase orchestrator
2+# Configuration phase
33
4-run_logged "$ARCHUP_INSTALL/config/system.sh"
5-run_logged "$ARCHUP_INSTALL/config/user.sh"
6-run_logged "$ARCHUP_INSTALL/config/network.sh"
4+source "$ARCHUP_INSTALL/config/system.sh" # Interactive (gum input)
5+source "$ARCHUP_INSTALL/config/user.sh" # Interactive (gum input)
6+run_logged "$ARCHUP_INSTALL/config/network.sh" # Non-interactive
@@ -1,6 +1,6 @@
1 #!/bin/bash1 #!/bin/bash
2-# Configuration phase orchestrator2+# Configuration phase
3 3
4-run_logged "$ARCHUP_INSTALL/config/system.sh"4+source "$ARCHUP_INSTALL/config/system.sh" # Interactive (gum input)
5-run_logged "$ARCHUP_INSTALL/config/user.sh"5+source "$ARCHUP_INSTALL/config/user.sh" # Interactive (gum input)
6-run_logged "$ARCHUP_INSTALL/config/network.sh"6+run_logged "$ARCHUP_INSTALL/config/network.sh" # Non-interactive
M install/config/network.sh +4 -4
@@ -45,10 +45,10 @@ PreSharedKey=$ARCHUP_WIFI_PASSPHRASE
4545 AutoConnect=true
4646 EOF
4747
48- gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ WiFi credentials migrated: $ARCHUP_WIFI_SSID"
49- echo "WiFi credentials migrated: $ARCHUP_WIFI_SSID (auto-connect enabled)" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
48+ gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] WiFi credentials migrated: $ARCHUP_WIFI_SSID"
49+ echo "WiFi credentials migrated: $ARCHUP_WIFI_SSID (auto-connect enabled)" >> "$ARCHUP_INSTALL_LOG_FILE"
5050 fi
5151
52-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Network configured (DHCP)"
52+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Network configured (DHCP)"
5353
54-echo "Enabled systemd-networkd and iwd" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
54+echo "Enabled systemd-networkd and iwd" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -45,10 +45,10 @@ PreSharedKey=$ARCHUP_WIFI_PASSPHRASE
45 AutoConnect=true45 AutoConnect=true
46 EOF46 EOF
47 47
48- gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ WiFi credentials migrated: $ARCHUP_WIFI_SSID"48+ gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] WiFi credentials migrated: $ARCHUP_WIFI_SSID"
49- echo "WiFi credentials migrated: $ARCHUP_WIFI_SSID (auto-connect enabled)" | tee -a "$ARCHUP_INSTALL_LOG_FILE"49+ echo "WiFi credentials migrated: $ARCHUP_WIFI_SSID (auto-connect enabled)" >> "$ARCHUP_INSTALL_LOG_FILE"
50 fi50 fi
51 51
52-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Network configured (DHCP)"52+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Network configured (DHCP)"
53 53
54-echo "Enabled systemd-networkd and iwd" | tee -a "$ARCHUP_INSTALL_LOG_FILE"54+echo "Enabled systemd-networkd and iwd" >> "$ARCHUP_INSTALL_LOG_FILE"
M install/config/system.sh +8 -8
@@ -17,20 +17,20 @@ fi
1717 arch-chroot /mnt ln -sf "/usr/share/zoneinfo/$ARCHUP_TIMEZONE" /etc/localtime
1818 arch-chroot /mnt hwclock --systohc
1919
20-gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Timezone set to: $ARCHUP_TIMEZONE"
20+gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Timezone set to: $ARCHUP_TIMEZONE"
2121
2222 # Set locale to en_US.UTF-8
2323 echo "en_US.UTF-8 UTF-8" > /mnt/etc/locale.gen
2424 arch-chroot /mnt locale-gen
2525 echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf
2626
27-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Locale set to: en_US.UTF-8"
27+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Locale set to: en_US.UTF-8"
2828
2929 # Set console keyboard layout (detected from ISO)
3030 if [ -n "$ARCHUP_KEYMAP" ]; then
3131 echo "KEYMAP=$ARCHUP_KEYMAP" > /mnt/etc/vconsole.conf
32- gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Console keymap set to: $ARCHUP_KEYMAP"
33- echo "Console keymap: $ARCHUP_KEYMAP" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
32+ gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Console keymap set to: $ARCHUP_KEYMAP"
33+ echo "Console keymap: $ARCHUP_KEYMAP" >> "$ARCHUP_INSTALL_LOG_FILE"
3434 fi
3535
3636 # Ask for hostname
@@ -52,8 +52,8 @@ cat > /mnt/etc/hosts <<EOF
5252 127.0.1.1 $ARCHUP_HOSTNAME.localdomain $ARCHUP_HOSTNAME
5353 EOF
5454
55-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Hostname set to: $ARCHUP_HOSTNAME"
55+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Hostname set to: $ARCHUP_HOSTNAME"
5656
57-echo "Timezone: $ARCHUP_TIMEZONE" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
58-echo "Locale: en_US.UTF-8" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
59-echo "Hostname: $ARCHUP_HOSTNAME" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
57+echo "Timezone: $ARCHUP_TIMEZONE" >> "$ARCHUP_INSTALL_LOG_FILE"
58+echo "Locale: en_US.UTF-8" >> "$ARCHUP_INSTALL_LOG_FILE"
59+echo "Hostname: $ARCHUP_HOSTNAME" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -17,20 +17,20 @@ fi
17 arch-chroot /mnt ln -sf "/usr/share/zoneinfo/$ARCHUP_TIMEZONE" /etc/localtime17 arch-chroot /mnt ln -sf "/usr/share/zoneinfo/$ARCHUP_TIMEZONE" /etc/localtime
18 arch-chroot /mnt hwclock --systohc18 arch-chroot /mnt hwclock --systohc
19 19
20-gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Timezone set to: $ARCHUP_TIMEZONE"20+gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Timezone set to: $ARCHUP_TIMEZONE"
21 21
22 # Set locale to en_US.UTF-822 # Set locale to en_US.UTF-8
23 echo "en_US.UTF-8 UTF-8" > /mnt/etc/locale.gen23 echo "en_US.UTF-8 UTF-8" > /mnt/etc/locale.gen
24 arch-chroot /mnt locale-gen24 arch-chroot /mnt locale-gen
25 echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf25 echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf
26 26
27-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Locale set to: en_US.UTF-8"27+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Locale set to: en_US.UTF-8"
28 28
29 # Set console keyboard layout (detected from ISO)29 # Set console keyboard layout (detected from ISO)
30 if [ -n "$ARCHUP_KEYMAP" ]; then30 if [ -n "$ARCHUP_KEYMAP" ]; then
31 echo "KEYMAP=$ARCHUP_KEYMAP" > /mnt/etc/vconsole.conf31 echo "KEYMAP=$ARCHUP_KEYMAP" > /mnt/etc/vconsole.conf
32- gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Console keymap set to: $ARCHUP_KEYMAP"32+ gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Console keymap set to: $ARCHUP_KEYMAP"
33- echo "Console keymap: $ARCHUP_KEYMAP" | tee -a "$ARCHUP_INSTALL_LOG_FILE"33+ echo "Console keymap: $ARCHUP_KEYMAP" >> "$ARCHUP_INSTALL_LOG_FILE"
34 fi34 fi
35 35
36 # Ask for hostname36 # Ask for hostname
@@ -52,8 +52,8 @@ cat > /mnt/etc/hosts <<EOF
52 127.0.1.1 $ARCHUP_HOSTNAME.localdomain $ARCHUP_HOSTNAME52 127.0.1.1 $ARCHUP_HOSTNAME.localdomain $ARCHUP_HOSTNAME
53 EOF53 EOF
54 54
55-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Hostname set to: $ARCHUP_HOSTNAME"55+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Hostname set to: $ARCHUP_HOSTNAME"
56 56
57-echo "Timezone: $ARCHUP_TIMEZONE" | tee -a "$ARCHUP_INSTALL_LOG_FILE"57+echo "Timezone: $ARCHUP_TIMEZONE" >> "$ARCHUP_INSTALL_LOG_FILE"
58-echo "Locale: en_US.UTF-8" | tee -a "$ARCHUP_INSTALL_LOG_FILE"58+echo "Locale: en_US.UTF-8" >> "$ARCHUP_INSTALL_LOG_FILE"
59-echo "Hostname: $ARCHUP_HOSTNAME" | tee -a "$ARCHUP_INSTALL_LOG_FILE"59+echo "Hostname: $ARCHUP_HOSTNAME" >> "$ARCHUP_INSTALL_LOG_FILE"
M install/config/user.sh +4 -4
@@ -43,8 +43,8 @@ echo "$ARCHUP_USERNAME:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd
4343 echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/etc/sudoers.d/wheel
4444 chmod 440 /mnt/etc/sudoers.d/wheel
4545
46-gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ User created: $ARCHUP_USERNAME"
47-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Sudo enabled for wheel group"
46+gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] User created: $ARCHUP_USERNAME"
47+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Sudo enabled for wheel group"
4848
49-echo "Created user: $ARCHUP_USERNAME" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
50-echo "Enabled sudo for wheel group" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
49+echo "Created user: $ARCHUP_USERNAME"
50+echo "Enabled sudo for wheel group"
@@ -43,8 +43,8 @@ echo "$ARCHUP_USERNAME:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd
43 echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/etc/sudoers.d/wheel43 echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/etc/sudoers.d/wheel
44 chmod 440 /mnt/etc/sudoers.d/wheel44 chmod 440 /mnt/etc/sudoers.d/wheel
45 45
46-gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ User created: $ARCHUP_USERNAME"46+gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] User created: $ARCHUP_USERNAME"
47-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Sudo enabled for wheel group"47+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Sudo enabled for wheel group"
48 48
49-echo "Created user: $ARCHUP_USERNAME" | tee -a "$ARCHUP_INSTALL_LOG_FILE"49+echo "Created user: $ARCHUP_USERNAME"
50-echo "Enabled sudo for wheel group" | tee -a "$ARCHUP_INSTALL_LOG_FILE"50+echo "Enabled sudo for wheel group"
M install/helpers/errors.sh +54 -38
@@ -1,8 +1,7 @@
11 #!/bin/bash
2-# Error handling utilities for archup installer
3-# Adapted from Omarchy errors.sh
2+# Error handling for archup installer - improved with logging and interactivity
43
5-# GitHub issue tracker for bug reports
4+# QR code for GitHub issues
65 QR_CODE='
76 █▀▀▀▀▀█ ▀▄██▀▄▀ █▀▀▀▀▀█
87 █ ███ █ ▄▀ ▀▄▄▄ █ ███ █
@@ -16,21 +15,30 @@ QR_CODE='
1615 █ ▀▀▀ █ ▄▀▄▄ █▄▄▀▄▀█ ▀█
1716 ▀▀▀▀▀▀▀ ▀▀▀▀▀ ▀▀▀ ▀▀▀'
1817
19-# Track if we're already handling an error to prevent double-trapping
18+# Track error handling state
2019 ERROR_HANDLING=false
2120
22-# Cursor is usually hidden while we install
21+# Show cursor
2322 show_cursor() {
2423 printf "\033[?25h"
2524 }
2625
27-# Display truncated log lines from the install log
26+# Hide cursor
27+hide_cursor() {
28+ printf "\033[?25l"
29+}
30+
31+# Display truncated log lines
2832 show_log_tail() {
2933 if [[ -f $ARCHUP_INSTALL_LOG_FILE ]]; then
30- local log_lines=$(($TERM_HEIGHT - $LOGO_HEIGHT - 35))
34+ local log_lines=$((TERM_HEIGHT - LOGO_HEIGHT - 35))
3135 local max_line_width=$((LOGO_WIDTH - 4))
3236
33- tail -n $log_lines "$ARCHUP_INSTALL_LOG_FILE" | while IFS= read -r line; do
37+ echo
38+ gum style --foreground 3 "Recent log entries:"
39+ echo
40+
41+ tail -n $log_lines "$ARCHUP_INSTALL_LOG_FILE" 2>/dev/null | while IFS= read -r line; do
3442 if ((${#line} > max_line_width)); then
3543 local truncated_line="${line:0:$max_line_width}..."
3644 else
@@ -44,12 +52,11 @@ show_log_tail() {
4452 fi
4553 }
4654
47-# Display the failed command or script name
55+# Display failed script or command
4856 show_failed_script_or_command() {
4957 if [[ -n ${CURRENT_SCRIPT:-} ]]; then
5058 gum style "Failed script: $CURRENT_SCRIPT"
5159 else
52- # Truncate long command lines to fit the display
5360 local cmd="$BASH_COMMAND"
5461 local max_cmd_width=$((LOGO_WIDTH - 4))
5562
@@ -57,24 +64,23 @@ show_failed_script_or_command() {
5764 cmd="${cmd:0:$max_cmd_width}..."
5865 fi
5966
60- gum style "$cmd"
67+ gum style "Command: $cmd"
6168 fi
6269 }
6370
64-# Save original stdout and stderr for trap to use
71+# Save original file descriptors
6572 save_original_outputs() {
6673 exec 3>&1 4>&2
6774 }
6875
69-# Restore stdout and stderr to original (saved in FD 3 and 4)
70-# This ensures output goes to screen, not log file
76+# Restore original file descriptors
7177 restore_outputs() {
7278 if [ -e /proc/self/fd/3 ] && [ -e /proc/self/fd/4 ]; then
7379 exec 1>&3 2>&4
7480 fi
7581 }
7682
77-# Error handler
83+# Main error handler
7884 catch_errors() {
7985 # Prevent recursive error handling
8086 if [[ $ERROR_HANDLING == true ]]; then
@@ -83,52 +89,62 @@ catch_errors() {
8389 ERROR_HANDLING=true
8490 fi
8591
86- # Store exit code immediately before it gets overwritten
92+ # Store exit code immediately (BEFORE any other commands!)
8793 local exit_code=$?
94+ local failed_command="${BASH_COMMAND}"
95+ local failed_script="${CURRENT_SCRIPT:-}"
96+
97+ # Log error to file IMMEDIATELY with direct file write
98+ # This must happen before any stdout/stderr restoration
99+ {
100+ echo ""
101+ echo "=== INSTALLATION ERROR ==="
102+ echo "Timestamp: $(date '+%Y-%m-%d %H:%M:%S')"
103+ echo "Exit Code: $exit_code"
104+ if [[ -n "$failed_script" ]]; then
105+ echo "Failed Script: $failed_script"
106+ fi
107+ echo "Failed Command: $failed_command"
108+ echo "=== END ERROR ==="
109+ echo ""
110+ } >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
88111
112+ # Stop background log monitor
89113 stop_log_output
90114 restore_outputs
91115
116+ # Clear and show error screen
92117 clear_logo
93118 show_cursor
94119
95120 gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "archup installation stopped!"
96121 show_log_tail
97122
123+ echo
98124 gum style "This command halted with exit code $exit_code:"
99125 show_failed_script_or_command
126+ echo
100127
101128 gum style "$QR_CODE"
102129 echo
103- gum style "Report issues at ${ARCHUP_REPO_URL:-https://github.com/bnema/archup}/issues"
130+ gum style "Check logs: $ARCHUP_INSTALL_LOG_FILE"
131+ gum style "Report issues: ${ARCHUP_REPO_URL:-https://github.com/bnema/archup}/issues"
132+ echo
104133
105- # Offer options menu
134+ # Interactive menu
106135 while true; do
107- options=()
108-
109- # Add upload option if internet is available
110- if ping -c 1 -W 1 1.1.1.1 >/dev/null 2>&1; then
111- options+=("Upload log for support")
112- fi
113-
114- # Add remaining options
115- options+=("View full log")
116- options+=("Exit")
136+ options=("View full log" "Exit")
117137
118- choice=$(gum choose "${options[@]}" --header "What would you like to do?" --height 6 --padding "1 $PADDING_LEFT")
138+ choice=$(gum choose "${options[@]}" --header "What would you like to do?" --height 4 --padding "0 0 0 $PADDING_LEFT")
119139
120140 case "$choice" in
121141 "View full log")
122142 if command -v less &>/dev/null; then
123143 less "$ARCHUP_INSTALL_LOG_FILE"
124144 else
125- tail "$ARCHUP_INSTALL_LOG_FILE"
145+ cat "$ARCHUP_INSTALL_LOG_FILE" | tail -n 100
126146 fi
127- ;;
128- "Upload log for support")
129- # Future: implement log upload (curl to pastebin service)
130- gum style --foreground 3 "Log upload not yet implemented"
131- gum style "Please manually upload: $ARCHUP_INSTALL_LOG_FILE"
147+ clear_logo
132148 ;;
133149 "Exit" | "")
134150 exit 1
@@ -137,11 +153,11 @@ catch_errors() {
137153 done
138154 }
139155
140-# Exit handler - ensures cleanup happens on any exit
156+# Exit handler
141157 exit_handler() {
142158 local exit_code=$?
143159
144- # Only run if we're exiting with an error and haven't already handled it
160+ # Only run if exiting with error and not already handled
145161 if [[ $exit_code -ne 0 && $ERROR_HANDLING != true ]]; then
146162 catch_errors
147163 else
@@ -154,5 +170,5 @@ exit_handler() {
154170 trap catch_errors ERR INT TERM
155171 trap exit_handler EXIT
156172
157-# Save original outputs in case we trap
173+# Save original outputs for restoration
158174 save_original_outputs
@@ -1,8 +1,7 @@
1 #!/bin/bash1 #!/bin/bash
2-# Error handling utilities for archup installer2+# Error handling for archup installer - improved with logging and interactivity
3-# Adapted from Omarchy errors.sh
4 3
5-# GitHub issue tracker for bug reports4+# QR code for GitHub issues
6 QR_CODE='5 QR_CODE='
7 █▀▀▀▀▀█ ▀▄██▀▄▀ █▀▀▀▀▀█6 █▀▀▀▀▀█ ▀▄██▀▄▀ █▀▀▀▀▀█
8 █ ███ █ ▄▀ ▀▄▄▄ █ ███ █7 █ ███ █ ▄▀ ▀▄▄▄ █ ███ █
@@ -16,21 +15,30 @@ QR_CODE='
16 █ ▀▀▀ █ ▄▀▄▄ █▄▄▀▄▀█ ▀█15 █ ▀▀▀ █ ▄▀▄▄ █▄▄▀▄▀█ ▀█
17 ▀▀▀▀▀▀▀ ▀▀▀▀▀ ▀▀▀ ▀▀▀'16 ▀▀▀▀▀▀▀ ▀▀▀▀▀ ▀▀▀ ▀▀▀'
18 17
19-# Track if we're already handling an error to prevent double-trapping18+# Track error handling state
20 ERROR_HANDLING=false19 ERROR_HANDLING=false
21 20
22-# Cursor is usually hidden while we install21+# Show cursor
23 show_cursor() {22 show_cursor() {
24 printf "\033[?25h"23 printf "\033[?25h"
25 }24 }
26 25
27-# Display truncated log lines from the install log26+# Hide cursor
27+hide_cursor() {
28+ printf "\033[?25l"
29+}
30+
31+# Display truncated log lines
28 show_log_tail() {32 show_log_tail() {
29 if [[ -f $ARCHUP_INSTALL_LOG_FILE ]]; then33 if [[ -f $ARCHUP_INSTALL_LOG_FILE ]]; then
30- local log_lines=$(($TERM_HEIGHT - $LOGO_HEIGHT - 35))34+ local log_lines=$((TERM_HEIGHT - LOGO_HEIGHT - 35))
31 local max_line_width=$((LOGO_WIDTH - 4))35 local max_line_width=$((LOGO_WIDTH - 4))
32 36
33- tail -n $log_lines "$ARCHUP_INSTALL_LOG_FILE" | while IFS= read -r line; do37+ echo
38+ gum style --foreground 3 "Recent log entries:"
39+ echo
40+
41+ tail -n $log_lines "$ARCHUP_INSTALL_LOG_FILE" 2>/dev/null | while IFS= read -r line; do
34 if ((${#line} > max_line_width)); then42 if ((${#line} > max_line_width)); then
35 local truncated_line="${line:0:$max_line_width}..."43 local truncated_line="${line:0:$max_line_width}..."
36 else44 else
@@ -44,12 +52,11 @@ show_log_tail() {
44 fi52 fi
45 }53 }
46 54
47-# Display the failed command or script name55+# Display failed script or command
48 show_failed_script_or_command() {56 show_failed_script_or_command() {
49 if [[ -n ${CURRENT_SCRIPT:-} ]]; then57 if [[ -n ${CURRENT_SCRIPT:-} ]]; then
50 gum style "Failed script: $CURRENT_SCRIPT"58 gum style "Failed script: $CURRENT_SCRIPT"
51 else59 else
52- # Truncate long command lines to fit the display
53 local cmd="$BASH_COMMAND"60 local cmd="$BASH_COMMAND"
54 local max_cmd_width=$((LOGO_WIDTH - 4))61 local max_cmd_width=$((LOGO_WIDTH - 4))
55 62
@@ -57,24 +64,23 @@ show_failed_script_or_command() {
57 cmd="${cmd:0:$max_cmd_width}..."64 cmd="${cmd:0:$max_cmd_width}..."
58 fi65 fi
59 66
60- gum style "$cmd"67+ gum style "Command: $cmd"
61 fi68 fi
62 }69 }
63 70
64-# Save original stdout and stderr for trap to use71+# Save original file descriptors
65 save_original_outputs() {72 save_original_outputs() {
66 exec 3>&1 4>&273 exec 3>&1 4>&2
67 }74 }
68 75
69-# Restore stdout and stderr to original (saved in FD 3 and 4)76+# Restore original file descriptors
70-# This ensures output goes to screen, not log file
71 restore_outputs() {77 restore_outputs() {
72 if [ -e /proc/self/fd/3 ] && [ -e /proc/self/fd/4 ]; then78 if [ -e /proc/self/fd/3 ] && [ -e /proc/self/fd/4 ]; then
73 exec 1>&3 2>&479 exec 1>&3 2>&4
74 fi80 fi
75 }81 }
76 82
77-# Error handler83+# Main error handler
78 catch_errors() {84 catch_errors() {
79 # Prevent recursive error handling85 # Prevent recursive error handling
80 if [[ $ERROR_HANDLING == true ]]; then86 if [[ $ERROR_HANDLING == true ]]; then
@@ -83,52 +89,62 @@ catch_errors() {
83 ERROR_HANDLING=true89 ERROR_HANDLING=true
84 fi90 fi
85 91
86- # Store exit code immediately before it gets overwritten92+ # Store exit code immediately (BEFORE any other commands!)
87 local exit_code=$?93 local exit_code=$?
94+ local failed_command="${BASH_COMMAND}"
95+ local failed_script="${CURRENT_SCRIPT:-}"
96+
97+ # Log error to file IMMEDIATELY with direct file write
98+ # This must happen before any stdout/stderr restoration
99+ {
100+ echo ""
101+ echo "=== INSTALLATION ERROR ==="
102+ echo "Timestamp: $(date '+%Y-%m-%d %H:%M:%S')"
103+ echo "Exit Code: $exit_code"
104+ if [[ -n "$failed_script" ]]; then
105+ echo "Failed Script: $failed_script"
106+ fi
107+ echo "Failed Command: $failed_command"
108+ echo "=== END ERROR ==="
109+ echo ""
110+ } >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
88 111
112+ # Stop background log monitor
89 stop_log_output113 stop_log_output
90 restore_outputs114 restore_outputs
91 115
116+ # Clear and show error screen
92 clear_logo117 clear_logo
93 show_cursor118 show_cursor
94 119
95 gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "archup installation stopped!"120 gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "archup installation stopped!"
96 show_log_tail121 show_log_tail
97 122
123+ echo
98 gum style "This command halted with exit code $exit_code:"124 gum style "This command halted with exit code $exit_code:"
99 show_failed_script_or_command125 show_failed_script_or_command
126+ echo
100 127
101 gum style "$QR_CODE"128 gum style "$QR_CODE"
102 echo129 echo
103- gum style "Report issues at ${ARCHUP_REPO_URL:-https://github.com/bnema/archup}/issues"130+ gum style "Check logs: $ARCHUP_INSTALL_LOG_FILE"
131+ gum style "Report issues: ${ARCHUP_REPO_URL:-https://github.com/bnema/archup}/issues"
132+ echo
104 133
105- # Offer options menu134+ # Interactive menu
106 while true; do135 while true; do
107- options=()136+ options=("View full log" "Exit")
108-
109- # Add upload option if internet is available
110- if ping -c 1 -W 1 1.1.1.1 >/dev/null 2>&1; then
111- options+=("Upload log for support")
112- fi
113-
114- # Add remaining options
115- options+=("View full log")
116- options+=("Exit")
117 137
118- choice=$(gum choose "${options[@]}" --header "What would you like to do?" --height 6 --padding "1 $PADDING_LEFT")138+ choice=$(gum choose "${options[@]}" --header "What would you like to do?" --height 4 --padding "0 0 0 $PADDING_LEFT")
119 139
120 case "$choice" in140 case "$choice" in
121 "View full log")141 "View full log")
122 if command -v less &>/dev/null; then142 if command -v less &>/dev/null; then
123 less "$ARCHUP_INSTALL_LOG_FILE"143 less "$ARCHUP_INSTALL_LOG_FILE"
124 else144 else
125- tail "$ARCHUP_INSTALL_LOG_FILE"145+ cat "$ARCHUP_INSTALL_LOG_FILE" | tail -n 100
126 fi146 fi
127- ;;147+ clear_logo
128- "Upload log for support")
129- # Future: implement log upload (curl to pastebin service)
130- gum style --foreground 3 "Log upload not yet implemented"
131- gum style "Please manually upload: $ARCHUP_INSTALL_LOG_FILE"
132 ;;148 ;;
133 "Exit" | "")149 "Exit" | "")
134 exit 1150 exit 1
@@ -137,11 +153,11 @@ catch_errors() {
137 done153 done
138 }154 }
139 155
140-# Exit handler - ensures cleanup happens on any exit156+# Exit handler
141 exit_handler() {157 exit_handler() {
142 local exit_code=$?158 local exit_code=$?
143 159
144- # Only run if we're exiting with an error and haven't already handled it160+ # Only run if exiting with error and not already handled
145 if [[ $exit_code -ne 0 && $ERROR_HANDLING != true ]]; then161 if [[ $exit_code -ne 0 && $ERROR_HANDLING != true ]]; then
146 catch_errors162 catch_errors
147 else163 else
@@ -154,5 +170,5 @@ exit_handler() {
154 trap catch_errors ERR INT TERM170 trap catch_errors ERR INT TERM
155 trap exit_handler EXIT171 trap exit_handler EXIT
156 172
157-# Save original outputs in case we trap173+# Save original outputs for restoration
158 save_original_outputs174 save_original_outputs
M install/helpers/logging.sh +19 -15
@@ -1,7 +1,11 @@
11 #!/bin/bash
2-# Logging utilities for archup installer
3-# Adapted from Omarchy logging.sh
2+# Logging system for archup installer - fixes variable export issues
3+# Uses background process for log display instead of exec redirection
44
5+# Global variable for monitor background process
6+monitor_pid=""
7+
8+# Background process to monitor and display log in real-time
59 start_log_output() {
610 local ANSI_SAVE_CURSOR="\033[s"
711 local ANSI_RESTORE_CURSOR="\033[u"
@@ -14,6 +18,7 @@ start_log_output() {
1418 printf $ANSI_SAVE_CURSOR
1519 printf $ANSI_HIDE_CURSOR
1620
21+ # Start background monitor process
1722 (
1823 local log_lines=20
1924 local max_line_width=$((LOGO_WIDTH - 4))
@@ -32,7 +37,7 @@ start_log_output() {
3237 line="${line:0:$max_line_width}..."
3338 fi
3439
35- # Add clear line escape and formatted output for each line
40+ # Add formatted output for each line
3641 if [ -n "$line" ]; then
3742 output+="${ANSI_CLEAR_LINE}${ANSI_GRAY}${PADDING_LEFT_SPACES} → ${line}${ANSI_RESET}\n"
3843 else
@@ -41,7 +46,6 @@ start_log_output() {
4146 done
4247
4348 printf "${ANSI_RESTORE_CURSOR}%b" "$output"
44-
4549 sleep 0.1
4650 done
4751 ) &
@@ -61,8 +65,9 @@ start_install_log() {
6165 chmod 666 "$ARCHUP_INSTALL_LOG_FILE"
6266
6367 export ARCHUP_START_TIME=$(date '+%Y-%m-%d %H:%M:%S')
68+ echo "=== archup Installation Started: $ARCHUP_START_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE"
6469
65- echo "=== archup Installation Started: $ARCHUP_START_TIME ===" >>"$ARCHUP_INSTALL_LOG_FILE"
70+ # Start background log display (NO exec redirection!)
6671 start_log_output
6772 }
6873
@@ -72,9 +77,8 @@ stop_install_log() {
7277
7378 if [[ -n ${ARCHUP_INSTALL_LOG_FILE:-} ]]; then
7479 ARCHUP_END_TIME=$(date '+%Y-%m-%d %H:%M:%S')
75- echo "=== archup Installation Completed: $ARCHUP_END_TIME ===" >>"$ARCHUP_INSTALL_LOG_FILE"
76- echo "" >>"$ARCHUP_INSTALL_LOG_FILE"
77- echo "=== Installation Time Summary ===" >>"$ARCHUP_INSTALL_LOG_FILE"
80+ echo "" >> "$ARCHUP_INSTALL_LOG_FILE"
81+ echo "=== archup Installation Completed: $ARCHUP_END_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE"
7882
7983 if [ -n "$ARCHUP_START_TIME" ]; then
8084 ARCHUP_START_EPOCH=$(date -d "$ARCHUP_START_TIME" +%s)
@@ -84,9 +88,9 @@ stop_install_log() {
8488 ARCHUP_MINS=$((ARCHUP_DURATION / 60))
8589 ARCHUP_SECS=$((ARCHUP_DURATION % 60))
8690
87- echo "archup: ${ARCHUP_MINS}m ${ARCHUP_SECS}s" >>"$ARCHUP_INSTALL_LOG_FILE"
91+ echo "Duration: ${ARCHUP_MINS}m ${ARCHUP_SECS}s" >> "$ARCHUP_INSTALL_LOG_FILE"
8892 fi
89- echo "=================================" >>"$ARCHUP_INSTALL_LOG_FILE"
93+ echo "=================================" >> "$ARCHUP_INSTALL_LOG_FILE"
9094 fi
9195 }
9296
@@ -95,18 +99,18 @@ run_logged() {
9599
96100 export CURRENT_SCRIPT="$script"
97101
98- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >>"$ARCHUP_INSTALL_LOG_FILE"
102+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >> "$ARCHUP_INSTALL_LOG_FILE"
99103
100- # Use bash -c to create a clean subshell
101- bash -c "source '$script'" </dev/null >>"$ARCHUP_INSTALL_LOG_FILE" 2>&1
104+ # Use bash -c to create a clean subshell and redirect output to log
105+ bash -c "source '$script'" </dev/null >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
102106
103107 local exit_code=$?
104108
105109 if [ $exit_code -eq 0 ]; then
106- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Completed: $script" >>"$ARCHUP_INSTALL_LOG_FILE"
110+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] Completed: $script" >> "$ARCHUP_INSTALL_LOG_FILE"
107111 unset CURRENT_SCRIPT
108112 else
109- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Failed: $script (exit code: $exit_code)" >>"$ARCHUP_INSTALL_LOG_FILE"
113+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] Failed: $script (exit code: $exit_code)" >> "$ARCHUP_INSTALL_LOG_FILE"
110114 fi
111115
112116 return $exit_code
@@ -1,7 +1,11 @@
1 #!/bin/bash1 #!/bin/bash
2-# Logging utilities for archup installer2+# Logging system for archup installer - fixes variable export issues
3-# Adapted from Omarchy logging.sh3+# Uses background process for log display instead of exec redirection
4 4
5+# Global variable for monitor background process
6+monitor_pid=""
7+
8+# Background process to monitor and display log in real-time
5 start_log_output() {9 start_log_output() {
6 local ANSI_SAVE_CURSOR="\033[s"10 local ANSI_SAVE_CURSOR="\033[s"
7 local ANSI_RESTORE_CURSOR="\033[u"11 local ANSI_RESTORE_CURSOR="\033[u"
@@ -14,6 +18,7 @@ start_log_output() {
14 printf $ANSI_SAVE_CURSOR18 printf $ANSI_SAVE_CURSOR
15 printf $ANSI_HIDE_CURSOR19 printf $ANSI_HIDE_CURSOR
16 20
21+ # Start background monitor process
17 (22 (
18 local log_lines=2023 local log_lines=20
19 local max_line_width=$((LOGO_WIDTH - 4))24 local max_line_width=$((LOGO_WIDTH - 4))
@@ -32,7 +37,7 @@ start_log_output() {
32 line="${line:0:$max_line_width}..."37 line="${line:0:$max_line_width}..."
33 fi38 fi
34 39
35- # Add clear line escape and formatted output for each line40+ # Add formatted output for each line
36 if [ -n "$line" ]; then41 if [ -n "$line" ]; then
37 output+="${ANSI_CLEAR_LINE}${ANSI_GRAY}${PADDING_LEFT_SPACES} → ${line}${ANSI_RESET}\n"42 output+="${ANSI_CLEAR_LINE}${ANSI_GRAY}${PADDING_LEFT_SPACES} → ${line}${ANSI_RESET}\n"
38 else43 else
@@ -41,7 +46,6 @@ start_log_output() {
41 done46 done
42 47
43 printf "${ANSI_RESTORE_CURSOR}%b" "$output"48 printf "${ANSI_RESTORE_CURSOR}%b" "$output"
44-
45 sleep 0.149 sleep 0.1
46 done50 done
47 ) &51 ) &
@@ -61,8 +65,9 @@ start_install_log() {
61 chmod 666 "$ARCHUP_INSTALL_LOG_FILE"65 chmod 666 "$ARCHUP_INSTALL_LOG_FILE"
62 66
63 export ARCHUP_START_TIME=$(date '+%Y-%m-%d %H:%M:%S')67 export ARCHUP_START_TIME=$(date '+%Y-%m-%d %H:%M:%S')
68+ echo "=== archup Installation Started: $ARCHUP_START_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE"
64 69
65- echo "=== archup Installation Started: $ARCHUP_START_TIME ===" >>"$ARCHUP_INSTALL_LOG_FILE"70+ # Start background log display (NO exec redirection!)
66 start_log_output71 start_log_output
67 }72 }
68 73
@@ -72,9 +77,8 @@ stop_install_log() {
72 77
73 if [[ -n ${ARCHUP_INSTALL_LOG_FILE:-} ]]; then78 if [[ -n ${ARCHUP_INSTALL_LOG_FILE:-} ]]; then
74 ARCHUP_END_TIME=$(date '+%Y-%m-%d %H:%M:%S')79 ARCHUP_END_TIME=$(date '+%Y-%m-%d %H:%M:%S')
75- echo "=== archup Installation Completed: $ARCHUP_END_TIME ===" >>"$ARCHUP_INSTALL_LOG_FILE"80+ echo "" >> "$ARCHUP_INSTALL_LOG_FILE"
76- echo "" >>"$ARCHUP_INSTALL_LOG_FILE"81+ echo "=== archup Installation Completed: $ARCHUP_END_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE"
77- echo "=== Installation Time Summary ===" >>"$ARCHUP_INSTALL_LOG_FILE"
78 82
79 if [ -n "$ARCHUP_START_TIME" ]; then83 if [ -n "$ARCHUP_START_TIME" ]; then
80 ARCHUP_START_EPOCH=$(date -d "$ARCHUP_START_TIME" +%s)84 ARCHUP_START_EPOCH=$(date -d "$ARCHUP_START_TIME" +%s)
@@ -84,9 +88,9 @@ stop_install_log() {
84 ARCHUP_MINS=$((ARCHUP_DURATION / 60))88 ARCHUP_MINS=$((ARCHUP_DURATION / 60))
85 ARCHUP_SECS=$((ARCHUP_DURATION % 60))89 ARCHUP_SECS=$((ARCHUP_DURATION % 60))
86 90
87- echo "archup: ${ARCHUP_MINS}m ${ARCHUP_SECS}s" >>"$ARCHUP_INSTALL_LOG_FILE"91+ echo "Duration: ${ARCHUP_MINS}m ${ARCHUP_SECS}s" >> "$ARCHUP_INSTALL_LOG_FILE"
88 fi92 fi
89- echo "=================================" >>"$ARCHUP_INSTALL_LOG_FILE"93+ echo "=================================" >> "$ARCHUP_INSTALL_LOG_FILE"
90 fi94 fi
91 }95 }
92 96
@@ -95,18 +99,18 @@ run_logged() {
95 99
96 export CURRENT_SCRIPT="$script"100 export CURRENT_SCRIPT="$script"
97 101
98- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >>"$ARCHUP_INSTALL_LOG_FILE"102+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >> "$ARCHUP_INSTALL_LOG_FILE"
99 103
100- # Use bash -c to create a clean subshell104+ # Use bash -c to create a clean subshell and redirect output to log
101- bash -c "source '$script'" </dev/null >>"$ARCHUP_INSTALL_LOG_FILE" 2>&1105+ bash -c "source '$script'" </dev/null >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
102 106
103 local exit_code=$?107 local exit_code=$?
104 108
105 if [ $exit_code -eq 0 ]; then109 if [ $exit_code -eq 0 ]; then
106- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Completed: $script" >>"$ARCHUP_INSTALL_LOG_FILE"110+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] Completed: $script" >> "$ARCHUP_INSTALL_LOG_FILE"
107 unset CURRENT_SCRIPT111 unset CURRENT_SCRIPT
108 else112 else
109- echo "[$(date '+%Y-%m-%d %H:%M:%S')] Failed: $script (exit code: $exit_code)" >>"$ARCHUP_INSTALL_LOG_FILE"113+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] Failed: $script (exit code: $exit_code)" >> "$ARCHUP_INSTALL_LOG_FILE"
110 fi114 fi
111 115
112 return $exit_code116 return $exit_code
M install/helpers/presentation.sh +10 -0
@@ -46,3 +46,13 @@ clear_logo() {
4646 printf "\033[H\033[2J" # Clear screen and move cursor to top-left
4747 gum style --foreground 4 --padding "1 0 0 $PADDING_LEFT" "$(<"$LOGO_PATH")"
4848 }
49+
50+# Show cursor (used in cleanup)
51+show_cursor() {
52+ printf "\033[?25h"
53+}
54+
55+# Hide cursor (used during installation)
56+hide_cursor() {
57+ printf "\033[?25l"
58+}
@@ -46,3 +46,13 @@ clear_logo() {
46 printf "\033[H\033[2J" # Clear screen and move cursor to top-left46 printf "\033[H\033[2J" # Clear screen and move cursor to top-left
47 gum style --foreground 4 --padding "1 0 0 $PADDING_LEFT" "$(<"$LOGO_PATH")"47 gum style --foreground 4 --padding "1 0 0 $PADDING_LEFT" "$(<"$LOGO_PATH")"
48 }48 }
49+
50+# Show cursor (used in cleanup)
51+show_cursor() {
52+ printf "\033[?25h"
53+}
54+
55+# Hide cursor (used during installation)
56+hide_cursor() {
57+ printf "\033[?25l"
58+}
M install/partitioning/all.sh +5 -5
@@ -1,7 +1,7 @@
11 #!/bin/bash
2-# Partitioning phase orchestrator
2+# Partitioning phase
33
4-run_logged "$ARCHUP_INSTALL/partitioning/detect-disk.sh"
5-run_logged "$ARCHUP_INSTALL/partitioning/partition.sh"
6-run_logged "$ARCHUP_INSTALL/partitioning/format.sh"
7-run_logged "$ARCHUP_INSTALL/partitioning/mount.sh"
4+source "$ARCHUP_INSTALL/partitioning/detect-disk.sh" # Interactive (gum confirm)
5+run_logged "$ARCHUP_INSTALL/partitioning/partition.sh" # Non-interactive
6+run_logged "$ARCHUP_INSTALL/partitioning/format.sh" # Non-interactive
7+run_logged "$ARCHUP_INSTALL/partitioning/mount.sh" # Non-interactive
@@ -1,7 +1,7 @@
1 #!/bin/bash1 #!/bin/bash
2-# Partitioning phase orchestrator2+# Partitioning phase
3 3
4-run_logged "$ARCHUP_INSTALL/partitioning/detect-disk.sh"4+source "$ARCHUP_INSTALL/partitioning/detect-disk.sh" # Interactive (gum confirm)
5-run_logged "$ARCHUP_INSTALL/partitioning/partition.sh"5+run_logged "$ARCHUP_INSTALL/partitioning/partition.sh" # Non-interactive
6-run_logged "$ARCHUP_INSTALL/partitioning/format.sh"6+run_logged "$ARCHUP_INSTALL/partitioning/format.sh" # Non-interactive
7-run_logged "$ARCHUP_INSTALL/partitioning/mount.sh"7+run_logged "$ARCHUP_INSTALL/partitioning/mount.sh" # Non-interactive
M install/partitioning/detect-disk.sh +3 -1
@@ -9,6 +9,7 @@ mapfile -t disks < <(lsblk -dno NAME,SIZE,TYPE | grep disk | awk '{print "/dev/"
99
1010 if [ ${#disks[@]} -eq 0 ]; then
1111 gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "No disks found!"
12+ echo "ERROR: No disks found" >> "$ARCHUP_INSTALL_LOG_FILE"
1213 exit 1
1314 fi
1415
@@ -30,7 +31,8 @@ echo
3031 # Final confirmation
3132 if ! gum confirm "WARNING: All data on $ARCHUP_DISK will be permanently erased. Continue?" --padding "0 0 1 $PADDING_LEFT"; then
3233 gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user"
34+ echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE"
3335 exit 0
3436 fi
3537
36-echo "Disk selected: $ARCHUP_DISK" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
38+echo "Disk selected: $ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -9,6 +9,7 @@ mapfile -t disks < <(lsblk -dno NAME,SIZE,TYPE | grep disk | awk '{print "/dev/"
9 9
10 if [ ${#disks[@]} -eq 0 ]; then10 if [ ${#disks[@]} -eq 0 ]; then
11 gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "No disks found!"11 gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "No disks found!"
12+ echo "ERROR: No disks found" >> "$ARCHUP_INSTALL_LOG_FILE"
12 exit 113 exit 1
13 fi14 fi
14 15
@@ -30,7 +31,8 @@ echo
30 # Final confirmation31 # Final confirmation
31 if ! gum confirm "WARNING: All data on $ARCHUP_DISK will be permanently erased. Continue?" --padding "0 0 1 $PADDING_LEFT"; then32 if ! gum confirm "WARNING: All data on $ARCHUP_DISK will be permanently erased. Continue?" --padding "0 0 1 $PADDING_LEFT"; then
32 gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user"33 gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user"
34+ echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE"
33 exit 035 exit 0
34 fi36 fi
35 37
36-echo "Disk selected: $ARCHUP_DISK" | tee -a "$ARCHUP_INSTALL_LOG_FILE"38+echo "Disk selected: $ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE"
M install/partitioning/format.sh +9 -8
@@ -4,8 +4,8 @@
44 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Formatting partitions..."
55
66 # Format EFI partition as FAT32
7-mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART"
8-echo "Formatted $ARCHUP_EFI_PART as FAT32" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
7+mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART" 2>&1
8+echo "Formatted $ARCHUP_EFI_PART as FAT32" >> "$ARCHUP_INSTALL_LOG_FILE"
99
1010 # Handle root partition - with or without encryption
1111 if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
@@ -40,8 +40,8 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
4040 # Format the encrypted container with btrfs
4141 mkfs.btrfs -f -L ROOT "$ARCHUP_CRYPT_ROOT"
4242
43- echo "Created LUKS container on $ARCHUP_ROOT_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
44- echo "Formatted $ARCHUP_CRYPT_ROOT as btrfs" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
43+ echo "Created LUKS container on $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE"
44+ echo "Formatted $ARCHUP_CRYPT_ROOT as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE"
4545
4646 # Mount temporarily to create subvolumes
4747 mount "$ARCHUP_CRYPT_ROOT" /mnt
@@ -49,7 +49,7 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
4949 else
5050 # No encryption - format directly with btrfs
5151 mkfs.btrfs -f -L ROOT "$ARCHUP_ROOT_PART"
52- echo "Formatted $ARCHUP_ROOT_PART as btrfs" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
52+ echo "Formatted $ARCHUP_ROOT_PART as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE"
5353
5454 # Mount temporarily to create subvolumes
5555 mount "$ARCHUP_ROOT_PART" /mnt
@@ -61,10 +61,11 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating btrfs subvolu
6161 btrfs subvolume create /mnt/@
6262 btrfs subvolume create /mnt/@home
6363
64-echo "Created btrfs subvolume: @" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
65-echo "Created btrfs subvolume: @home" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
64+echo "Created btrfs subvolume: @" >> "$ARCHUP_INSTALL_LOG_FILE"
65+echo "Created btrfs subvolume: @home" >> "$ARCHUP_INSTALL_LOG_FILE"
6666
6767 # Unmount temporary mount
6868 umount /mnt
6969
70-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Partitions formatted and subvolumes created"
70+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Partitions formatted and subvolumes created"
71+echo "Partitions formatted and subvolumes created successfully" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -4,8 +4,8 @@
4 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Formatting partitions..."4 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Formatting partitions..."
5 5
6 # Format EFI partition as FAT326 # Format EFI partition as FAT32
7-mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART"7+mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART" 2>&1
8-echo "Formatted $ARCHUP_EFI_PART as FAT32" | tee -a "$ARCHUP_INSTALL_LOG_FILE"8+echo "Formatted $ARCHUP_EFI_PART as FAT32" >> "$ARCHUP_INSTALL_LOG_FILE"
9 9
10 # Handle root partition - with or without encryption10 # Handle root partition - with or without encryption
11 if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then11 if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
@@ -40,8 +40,8 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
40 # Format the encrypted container with btrfs40 # Format the encrypted container with btrfs
41 mkfs.btrfs -f -L ROOT "$ARCHUP_CRYPT_ROOT"41 mkfs.btrfs -f -L ROOT "$ARCHUP_CRYPT_ROOT"
42 42
43- echo "Created LUKS container on $ARCHUP_ROOT_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE"43+ echo "Created LUKS container on $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE"
44- echo "Formatted $ARCHUP_CRYPT_ROOT as btrfs" | tee -a "$ARCHUP_INSTALL_LOG_FILE"44+ echo "Formatted $ARCHUP_CRYPT_ROOT as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE"
45 45
46 # Mount temporarily to create subvolumes46 # Mount temporarily to create subvolumes
47 mount "$ARCHUP_CRYPT_ROOT" /mnt47 mount "$ARCHUP_CRYPT_ROOT" /mnt
@@ -49,7 +49,7 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
49 else49 else
50 # No encryption - format directly with btrfs50 # No encryption - format directly with btrfs
51 mkfs.btrfs -f -L ROOT "$ARCHUP_ROOT_PART"51 mkfs.btrfs -f -L ROOT "$ARCHUP_ROOT_PART"
52- echo "Formatted $ARCHUP_ROOT_PART as btrfs" | tee -a "$ARCHUP_INSTALL_LOG_FILE"52+ echo "Formatted $ARCHUP_ROOT_PART as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE"
53 53
54 # Mount temporarily to create subvolumes54 # Mount temporarily to create subvolumes
55 mount "$ARCHUP_ROOT_PART" /mnt55 mount "$ARCHUP_ROOT_PART" /mnt
@@ -61,10 +61,11 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating btrfs subvolu
61 btrfs subvolume create /mnt/@61 btrfs subvolume create /mnt/@
62 btrfs subvolume create /mnt/@home62 btrfs subvolume create /mnt/@home
63 63
64-echo "Created btrfs subvolume: @" | tee -a "$ARCHUP_INSTALL_LOG_FILE"64+echo "Created btrfs subvolume: @" >> "$ARCHUP_INSTALL_LOG_FILE"
65-echo "Created btrfs subvolume: @home" | tee -a "$ARCHUP_INSTALL_LOG_FILE"65+echo "Created btrfs subvolume: @home" >> "$ARCHUP_INSTALL_LOG_FILE"
66 66
67 # Unmount temporary mount67 # Unmount temporary mount
68 umount /mnt68 umount /mnt
69 69
70-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Partitions formatted and subvolumes created"70+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Partitions formatted and subvolumes created"
71+echo "Partitions formatted and subvolumes created successfully" >> "$ARCHUP_INSTALL_LOG_FILE"
M install/partitioning/mount.sh +5 -4
@@ -13,7 +13,7 @@ fi
1313 # Mount @ subvolume as root with optimal btrfs options
1414 mount -o noatime,compress=zstd,subvol=@ "$MOUNT_DEVICE" /mnt
1515
16-echo "Mounted @ subvolume to /mnt" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
16+echo "Mounted @ subvolume to /mnt" >> "$ARCHUP_INSTALL_LOG_FILE"
1717
1818 # Create home directory
1919 mkdir -p /mnt/home
@@ -21,12 +21,13 @@ mkdir -p /mnt/home
2121 # Mount @home subvolume
2222 mount -o noatime,compress=zstd,subvol=@home "$MOUNT_DEVICE" /mnt/home
2323
24-echo "Mounted @home subvolume to /mnt/home" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
24+echo "Mounted @home subvolume to /mnt/home" >> "$ARCHUP_INSTALL_LOG_FILE"
2525
2626 # Create and mount EFI directory
2727 mkdir -p /mnt/boot
2828 mount "$ARCHUP_EFI_PART" /mnt/boot
2929
30-echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
30+echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" >> "$ARCHUP_INSTALL_LOG_FILE"
3131
32-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Partitions mounted"
32+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Partitions mounted"
33+echo "Partitions mounted successfully" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -13,7 +13,7 @@ fi
13 # Mount @ subvolume as root with optimal btrfs options13 # Mount @ subvolume as root with optimal btrfs options
14 mount -o noatime,compress=zstd,subvol=@ "$MOUNT_DEVICE" /mnt14 mount -o noatime,compress=zstd,subvol=@ "$MOUNT_DEVICE" /mnt
15 15
16-echo "Mounted @ subvolume to /mnt" | tee -a "$ARCHUP_INSTALL_LOG_FILE"16+echo "Mounted @ subvolume to /mnt" >> "$ARCHUP_INSTALL_LOG_FILE"
17 17
18 # Create home directory18 # Create home directory
19 mkdir -p /mnt/home19 mkdir -p /mnt/home
@@ -21,12 +21,13 @@ mkdir -p /mnt/home
21 # Mount @home subvolume21 # Mount @home subvolume
22 mount -o noatime,compress=zstd,subvol=@home "$MOUNT_DEVICE" /mnt/home22 mount -o noatime,compress=zstd,subvol=@home "$MOUNT_DEVICE" /mnt/home
23 23
24-echo "Mounted @home subvolume to /mnt/home" | tee -a "$ARCHUP_INSTALL_LOG_FILE"24+echo "Mounted @home subvolume to /mnt/home" >> "$ARCHUP_INSTALL_LOG_FILE"
25 25
26 # Create and mount EFI directory26 # Create and mount EFI directory
27 mkdir -p /mnt/boot27 mkdir -p /mnt/boot
28 mount "$ARCHUP_EFI_PART" /mnt/boot28 mount "$ARCHUP_EFI_PART" /mnt/boot
29 29
30-echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" | tee -a "$ARCHUP_INSTALL_LOG_FILE"30+echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" >> "$ARCHUP_INSTALL_LOG_FILE"
31 31
32-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Partitions mounted"32+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Partitions mounted"
33+echo "Partitions mounted successfully" >> "$ARCHUP_INSTALL_LOG_FILE"
M install/partitioning/partition.sh +3 -3
@@ -28,9 +28,9 @@ else
2828 export ARCHUP_ROOT_PART="${ARCHUP_DISK}2"
2929 fi
3030
31-gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Partitions created"
31+gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Partitions created"
3232 gum style --padding "0 0 0 $PADDING_LEFT" " EFI: $ARCHUP_EFI_PART (512MB)"
3333 gum style --padding "0 0 1 $PADDING_LEFT" " Root: $ARCHUP_ROOT_PART"
3434
35-echo "EFI partition: $ARCHUP_EFI_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
36-echo "Root partition: $ARCHUP_ROOT_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
35+echo "EFI partition: $ARCHUP_EFI_PART" >> "$ARCHUP_INSTALL_LOG_FILE"
36+echo "Root partition: $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -28,9 +28,9 @@ else
28 export ARCHUP_ROOT_PART="${ARCHUP_DISK}2"28 export ARCHUP_ROOT_PART="${ARCHUP_DISK}2"
29 fi29 fi
30 30
31-gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Partitions created"31+gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Partitions created"
32 gum style --padding "0 0 0 $PADDING_LEFT" " EFI: $ARCHUP_EFI_PART (512MB)"32 gum style --padding "0 0 0 $PADDING_LEFT" " EFI: $ARCHUP_EFI_PART (512MB)"
33 gum style --padding "0 0 1 $PADDING_LEFT" " Root: $ARCHUP_ROOT_PART"33 gum style --padding "0 0 1 $PADDING_LEFT" " Root: $ARCHUP_ROOT_PART"
34 34
35-echo "EFI partition: $ARCHUP_EFI_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE"35+echo "EFI partition: $ARCHUP_EFI_PART" >> "$ARCHUP_INSTALL_LOG_FILE"
36-echo "Root partition: $ARCHUP_ROOT_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE"36+echo "Root partition: $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE"
M install/preflight/all.sh +4 -10
@@ -1,12 +1,6 @@
11 #!/bin/bash
2-# Preflight phase orchestrator
3-# Sources all preflight scripts in order
2+# Preflight phase
43
5-# Run guards (system validation)
6-source "$ARCHUP_INSTALL/preflight/guards.sh"
7-
8-# Detect environment (keyboard layout, WiFi)
9-run_logged "$ARCHUP_INSTALL/preflight/detect-environment.sh"
10-
11-# Run begin (welcome and initial config)
12-run_logged "$ARCHUP_INSTALL/preflight/begin.sh"
4+source "$ARCHUP_INSTALL/preflight/guards.sh" # Interactive (gum confirm)
5+run_logged "$ARCHUP_INSTALL/preflight/detect-environment.sh" # Non-interactive
6+source "$ARCHUP_INSTALL/preflight/begin.sh" # Interactive (gum confirm)
@@ -1,12 +1,6 @@
1 #!/bin/bash1 #!/bin/bash
2-# Preflight phase orchestrator2+# Preflight phase
3-# Sources all preflight scripts in order
4 3
5-# Run guards (system validation)4+source "$ARCHUP_INSTALL/preflight/guards.sh" # Interactive (gum confirm)
6-source "$ARCHUP_INSTALL/preflight/guards.sh"5+run_logged "$ARCHUP_INSTALL/preflight/detect-environment.sh" # Non-interactive
7-6+source "$ARCHUP_INSTALL/preflight/begin.sh" # Interactive (gum confirm)
8-# Detect environment (keyboard layout, WiFi)
9-run_logged "$ARCHUP_INSTALL/preflight/detect-environment.sh"
10-
11-# Run begin (welcome and initial config)
12-run_logged "$ARCHUP_INSTALL/preflight/begin.sh"
M install/preflight/begin.sh +6 -4
@@ -10,6 +10,7 @@ echo
1010 # Confirm installation start
1111 if ! gum confirm "Ready to begin installation?" --padding "0 0 1 $PADDING_LEFT"; then
1212 gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user"
13+ echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE"
1314 exit 0
1415 fi
1516
@@ -18,7 +19,7 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Bootloader: Limine"
1819 gum style --padding "0 0 1 $PADDING_LEFT" "archup uses Limine for superior btrfs and snapshot support"
1920
2021 export ARCHUP_BOOTLOADER="limine"
21-echo "Bootloader: limine" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
22+echo "Bootloader: limine" >> "$ARCHUP_INSTALL_LOG_FILE"
2223
2324 # Ask for encryption preference (Phase 2)
2425 echo
@@ -28,10 +29,11 @@ echo
2829
2930 if gum confirm "Enable full-disk encryption?" --padding "0 0 1 $PADDING_LEFT"; then
3031 export ARCHUP_ENCRYPTION="enabled"
31- echo "Encryption: enabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
32+ echo "Encryption: enabled" >> "$ARCHUP_INSTALL_LOG_FILE"
3233 else
3334 export ARCHUP_ENCRYPTION="disabled"
34- echo "Encryption: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
35+ echo "Encryption: disabled" >> "$ARCHUP_INSTALL_LOG_FILE"
3536 fi
3637
37-gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Configuration saved"
38+gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Configuration saved"
39+echo "Configuration saved" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -10,6 +10,7 @@ echo
10 # Confirm installation start10 # Confirm installation start
11 if ! gum confirm "Ready to begin installation?" --padding "0 0 1 $PADDING_LEFT"; then11 if ! gum confirm "Ready to begin installation?" --padding "0 0 1 $PADDING_LEFT"; then
12 gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user"12 gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user"
13+ echo "Installation cancelled by user" >> "$ARCHUP_INSTALL_LOG_FILE"
13 exit 014 exit 0
14 fi15 fi
15 16
@@ -18,7 +19,7 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Bootloader: Limine"
18 gum style --padding "0 0 1 $PADDING_LEFT" "archup uses Limine for superior btrfs and snapshot support"19 gum style --padding "0 0 1 $PADDING_LEFT" "archup uses Limine for superior btrfs and snapshot support"
19 20
20 export ARCHUP_BOOTLOADER="limine"21 export ARCHUP_BOOTLOADER="limine"
21-echo "Bootloader: limine" | tee -a "$ARCHUP_INSTALL_LOG_FILE"22+echo "Bootloader: limine" >> "$ARCHUP_INSTALL_LOG_FILE"
22 23
23 # Ask for encryption preference (Phase 2)24 # Ask for encryption preference (Phase 2)
24 echo25 echo
@@ -28,10 +29,11 @@ echo
28 29
29 if gum confirm "Enable full-disk encryption?" --padding "0 0 1 $PADDING_LEFT"; then30 if gum confirm "Enable full-disk encryption?" --padding "0 0 1 $PADDING_LEFT"; then
30 export ARCHUP_ENCRYPTION="enabled"31 export ARCHUP_ENCRYPTION="enabled"
31- echo "Encryption: enabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE"32+ echo "Encryption: enabled" >> "$ARCHUP_INSTALL_LOG_FILE"
32 else33 else
33 export ARCHUP_ENCRYPTION="disabled"34 export ARCHUP_ENCRYPTION="disabled"
34- echo "Encryption: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE"35+ echo "Encryption: disabled" >> "$ARCHUP_INSTALL_LOG_FILE"
35 fi36 fi
36 37
37-gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Configuration saved"38+gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Configuration saved"
39+echo "Configuration saved" >> "$ARCHUP_INSTALL_LOG_FILE"
M install/preflight/detect-environment.sh +24 -16
@@ -22,21 +22,29 @@ if [ -z "$DETECTED_KEYMAP" ]; then
2222 fi
2323
2424 export ARCHUP_KEYMAP="$DETECTED_KEYMAP"
25-gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Keyboard layout: $ARCHUP_KEYMAP"
26-echo "Keyboard layout detected: $ARCHUP_KEYMAP" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
25+gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Keyboard layout: $ARCHUP_KEYMAP"
26+echo "Keyboard layout detected: $ARCHUP_KEYMAP"
2727
28-# Detect WiFi connection from iwd
29-# Check if iwd is running and if we're connected to a network
28+# Check for network connectivity
29+# First check if we have an active ethernet connection
30+HAS_ETHERNET=false
31+if ip link show | grep -E "^[0-9]+: (eth|enp|eno)" | grep -q "state UP"; then
32+ HAS_ETHERNET=true
33+ gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Ethernet connection detected"
34+ echo "Network: Ethernet connected"
35+fi
36+
37+# Only check for WiFi if no ethernet connection is available
3038 WIFI_SSID=""
3139 WIFI_PASSPHRASE=""
3240
33-if command -v iwctl >/dev/null 2>&1; then
41+if [ "$HAS_ETHERNET" = false ] && command -v iwctl >/dev/null 2>&1; then
3442 # Get the first wireless device
35- WIFI_DEVICE=$(iwctl device list | grep -oP 'wlan\d+' | head -1)
43+ WIFI_DEVICE=$(iwctl device list | grep -oP 'wlan\d+' | head -1) || true
3644
3745 if [ -n "$WIFI_DEVICE" ]; then
3846 # Check if connected to a network
39- WIFI_SSID=$(iwctl station "$WIFI_DEVICE" show | grep "Connected network" | awk '{print $3}')
47+ WIFI_SSID=$(iwctl station "$WIFI_DEVICE" show | grep "Connected network" | awk '{print $3}') || true
4048
4149 if [ -n "$WIFI_SSID" ]; then
4250 # iwd stores credentials in /var/lib/iwd/
@@ -52,19 +60,19 @@ if command -v iwctl >/dev/null 2>&1; then
5260 export ARCHUP_WIFI_DEVICE="$WIFI_DEVICE"
5361 export ARCHUP_WIFI_PASSPHRASE="$WIFI_PASSPHRASE"
5462
55- gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ WiFi network: $WIFI_SSID (device: $WIFI_DEVICE)"
56- echo "WiFi detected: SSID=$WIFI_SSID, device=$WIFI_DEVICE" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
63+ gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] WiFi network: $WIFI_SSID (device: $WIFI_DEVICE)"
64+ echo "WiFi detected: SSID=$WIFI_SSID, device=$WIFI_DEVICE"
5765 else
58- gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⊘ No active WiFi connection detected"
59- echo "WiFi: not connected" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
66+ gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No active WiFi connection detected"
67+ echo "WiFi: not connected"
6068 fi
6169 else
62- gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⊘ No WiFi device found"
63- echo "WiFi: no device" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
70+ gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No WiFi device found"
71+ echo "WiFi: no device"
6472 fi
65-else
66- gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⊘ iwd not available"
67- echo "WiFi: iwd not available" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
73+elif [ "$HAS_ETHERNET" = false ]; then
74+ gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] iwd not available"
75+ echo "WiFi: iwd not available"
6876 fi
6977
7078 echo
@@ -22,21 +22,29 @@ if [ -z "$DETECTED_KEYMAP" ]; then
22 fi22 fi
23 23
24 export ARCHUP_KEYMAP="$DETECTED_KEYMAP"24 export ARCHUP_KEYMAP="$DETECTED_KEYMAP"
25-gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Keyboard layout: $ARCHUP_KEYMAP"25+gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Keyboard layout: $ARCHUP_KEYMAP"
26-echo "Keyboard layout detected: $ARCHUP_KEYMAP" | tee -a "$ARCHUP_INSTALL_LOG_FILE"26+echo "Keyboard layout detected: $ARCHUP_KEYMAP"
27 27
28-# Detect WiFi connection from iwd28+# Check for network connectivity
29-# Check if iwd is running and if we're connected to a network29+# First check if we have an active ethernet connection
30+HAS_ETHERNET=false
31+if ip link show | grep -E "^[0-9]+: (eth|enp|eno)" | grep -q "state UP"; then
32+ HAS_ETHERNET=true
33+ gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Ethernet connection detected"
34+ echo "Network: Ethernet connected"
35+fi
36+
37+# Only check for WiFi if no ethernet connection is available
30 WIFI_SSID=""38 WIFI_SSID=""
31 WIFI_PASSPHRASE=""39 WIFI_PASSPHRASE=""
32 40
33-if command -v iwctl >/dev/null 2>&1; then41+if [ "$HAS_ETHERNET" = false ] && command -v iwctl >/dev/null 2>&1; then
34 # Get the first wireless device42 # Get the first wireless device
35- WIFI_DEVICE=$(iwctl device list | grep -oP 'wlan\d+' | head -1)43+ WIFI_DEVICE=$(iwctl device list | grep -oP 'wlan\d+' | head -1) || true
36 44
37 if [ -n "$WIFI_DEVICE" ]; then45 if [ -n "$WIFI_DEVICE" ]; then
38 # Check if connected to a network46 # Check if connected to a network
39- WIFI_SSID=$(iwctl station "$WIFI_DEVICE" show | grep "Connected network" | awk '{print $3}')47+ WIFI_SSID=$(iwctl station "$WIFI_DEVICE" show | grep "Connected network" | awk '{print $3}') || true
40 48
41 if [ -n "$WIFI_SSID" ]; then49 if [ -n "$WIFI_SSID" ]; then
42 # iwd stores credentials in /var/lib/iwd/50 # iwd stores credentials in /var/lib/iwd/
@@ -52,19 +60,19 @@ if command -v iwctl >/dev/null 2>&1; then
52 export ARCHUP_WIFI_DEVICE="$WIFI_DEVICE"60 export ARCHUP_WIFI_DEVICE="$WIFI_DEVICE"
53 export ARCHUP_WIFI_PASSPHRASE="$WIFI_PASSPHRASE"61 export ARCHUP_WIFI_PASSPHRASE="$WIFI_PASSPHRASE"
54 62
55- gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ WiFi network: $WIFI_SSID (device: $WIFI_DEVICE)"63+ gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] WiFi network: $WIFI_SSID (device: $WIFI_DEVICE)"
56- echo "WiFi detected: SSID=$WIFI_SSID, device=$WIFI_DEVICE" | tee -a "$ARCHUP_INSTALL_LOG_FILE"64+ echo "WiFi detected: SSID=$WIFI_SSID, device=$WIFI_DEVICE"
57 else65 else
58- gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⊘ No active WiFi connection detected"66+ gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No active WiFi connection detected"
59- echo "WiFi: not connected" | tee -a "$ARCHUP_INSTALL_LOG_FILE"67+ echo "WiFi: not connected"
60 fi68 fi
61 else69 else
62- gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⊘ No WiFi device found"70+ gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No WiFi device found"
63- echo "WiFi: no device" | tee -a "$ARCHUP_INSTALL_LOG_FILE"71+ echo "WiFi: no device"
64 fi72 fi
65-else73+elif [ "$HAS_ETHERNET" = false ]; then
66- gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "⊘ iwd not available"74+ gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] iwd not available"
67- echo "WiFi: iwd not available" | tee -a "$ARCHUP_INSTALL_LOG_FILE"75+ echo "WiFi: iwd not available"
68 fi76 fi
69 77
70 echo78 echo
M install/preflight/guards.sh +3 -2
@@ -3,8 +3,9 @@
33 # Validates system requirements before installation
44
55 abort() {
6- gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "❌ archup install requires: $1"
6+ gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "archup install requires: $1"
77 echo
8+ echo "Preflight check failed: $1"
89 gum confirm "Proceed anyway on your own accord and without assistance?" --padding "0 0 0 $PADDING_LEFT" || exit 1
910 }
1011
@@ -38,4 +39,4 @@ if bootctl status 2>/dev/null | grep -q 'Secure Boot: enabled'; then
3839 fi
3940
4041 # Cleared all guards
41-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ All preflight checks passed"
42+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "All preflight checks passed"
@@ -3,8 +3,9 @@
3 # Validates system requirements before installation3 # Validates system requirements before installation
4 4
5 abort() {5 abort() {
6- gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "❌ archup install requires: $1"6+ gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "archup install requires: $1"
7 echo7 echo
8+ echo "Preflight check failed: $1"
8 gum confirm "Proceed anyway on your own accord and without assistance?" --padding "0 0 0 $PADDING_LEFT" || exit 19 gum confirm "Proceed anyway on your own accord and without assistance?" --padding "0 0 0 $PADDING_LEFT" || exit 1
9 }10 }
10 11
@@ -38,4 +39,4 @@ if bootctl status 2>/dev/null | grep -q 'Secure Boot: enabled'; then
38 fi39 fi
39 40
40 # Cleared all guards41 # Cleared all guards
41-gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ All preflight checks passed"42+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "All preflight checks passed"
M install/repos/all.sh +3 -3
@@ -1,5 +1,5 @@
11 #!/bin/bash
2-# Repository setup phase orchestrator
2+# Repository setup phase
33
4-run_logged "$ARCHUP_INSTALL/repos/yay.sh"
5-run_logged "$ARCHUP_INSTALL/repos/chaotic.sh"
4+source "$ARCHUP_INSTALL/repos/yay.sh" # Interactive (gum confirm)
5+source "$ARCHUP_INSTALL/repos/chaotic.sh" # Interactive (gum confirm)
@@ -1,5 +1,5 @@
1 #!/bin/bash1 #!/bin/bash
2-# Repository setup phase orchestrator2+# Repository setup phase
3 3
4-run_logged "$ARCHUP_INSTALL/repos/yay.sh"4+source "$ARCHUP_INSTALL/repos/yay.sh" # Interactive (gum confirm)
5-run_logged "$ARCHUP_INSTALL/repos/chaotic.sh"5+source "$ARCHUP_INSTALL/repos/chaotic.sh" # Interactive (gum confirm)
M install/repos/chaotic.sh +7 -7
@@ -6,8 +6,8 @@ echo
66
77 # Ask if user wants Chaotic-AUR
88 if ! gum confirm "Enable Chaotic-AUR repository?" --padding "0 0 1 $PADDING_LEFT"; then
9- gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⊘ Skipping Chaotic-AUR"
10- echo "Chaotic-AUR: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
9+ gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping Chaotic-AUR"
10+ echo "Chaotic-AUR: disabled"
1111 export ARCHUP_CHAOTIC="disabled"
1212 return 0
1313 fi
@@ -35,7 +35,7 @@ if ! grep -q "\[chaotic-aur\]" /mnt/etc/pacman.conf; then
3535 Include = /etc/pacman.d/chaotic-mirrorlist
3636 EOF
3737
38- gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Added Chaotic-AUR to pacman.conf"
38+ gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Added Chaotic-AUR to pacman.conf"
3939 fi
4040
4141 # Update package databases
@@ -43,11 +43,11 @@ arch-chroot /mnt pacman -Sy
4343
4444 # Verify Chaotic-AUR is working
4545 if arch-chroot /mnt pacman -Sl chaotic-aur >/dev/null 2>&1; then
46- gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Chaotic-AUR enabled successfully"
47- echo "Chaotic-AUR: enabled (repo added to pacman.conf)" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
46+ gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Chaotic-AUR enabled successfully"
47+ echo "Chaotic-AUR: enabled (repo added to pacman.conf)"
4848 else
49- gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ Chaotic-AUR verification failed"
50- echo "WARNING: Chaotic-AUR verification failed" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
49+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Chaotic-AUR verification failed"
50+ echo "WARNING: Chaotic-AUR verification failed"
5151 export ARCHUP_CHAOTIC="failed"
5252 return 1
5353 fi
@@ -6,8 +6,8 @@ echo
6 6
7 # Ask if user wants Chaotic-AUR7 # Ask if user wants Chaotic-AUR
8 if ! gum confirm "Enable Chaotic-AUR repository?" --padding "0 0 1 $PADDING_LEFT"; then8 if ! gum confirm "Enable Chaotic-AUR repository?" --padding "0 0 1 $PADDING_LEFT"; then
9- gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⊘ Skipping Chaotic-AUR"9+ gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping Chaotic-AUR"
10- echo "Chaotic-AUR: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE"10+ echo "Chaotic-AUR: disabled"
11 export ARCHUP_CHAOTIC="disabled"11 export ARCHUP_CHAOTIC="disabled"
12 return 012 return 0
13 fi13 fi
@@ -35,7 +35,7 @@ if ! grep -q "\[chaotic-aur\]" /mnt/etc/pacman.conf; then
35 Include = /etc/pacman.d/chaotic-mirrorlist35 Include = /etc/pacman.d/chaotic-mirrorlist
36 EOF36 EOF
37 37
38- gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Added Chaotic-AUR to pacman.conf"38+ gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Added Chaotic-AUR to pacman.conf"
39 fi39 fi
40 40
41 # Update package databases41 # Update package databases
@@ -43,11 +43,11 @@ arch-chroot /mnt pacman -Sy
43 43
44 # Verify Chaotic-AUR is working44 # Verify Chaotic-AUR is working
45 if arch-chroot /mnt pacman -Sl chaotic-aur >/dev/null 2>&1; then45 if arch-chroot /mnt pacman -Sl chaotic-aur >/dev/null 2>&1; then
46- gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Chaotic-AUR enabled successfully"46+ gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Chaotic-AUR enabled successfully"
47- echo "Chaotic-AUR: enabled (repo added to pacman.conf)" | tee -a "$ARCHUP_INSTALL_LOG_FILE"47+ echo "Chaotic-AUR: enabled (repo added to pacman.conf)"
48 else48 else
49- gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ Chaotic-AUR verification failed"49+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Chaotic-AUR verification failed"
50- echo "WARNING: Chaotic-AUR verification failed" | tee -a "$ARCHUP_INSTALL_LOG_FILE"50+ echo "WARNING: Chaotic-AUR verification failed"
51 export ARCHUP_CHAOTIC="failed"51 export ARCHUP_CHAOTIC="failed"
52 return 152 return 1
53 fi53 fi
M install/repos/yay.sh +8 -8
@@ -6,8 +6,8 @@ echo
66
77 # Ask if user wants AUR support
88 if ! gum confirm "Enable AUR support (install yay)?" --padding "0 0 1 $PADDING_LEFT"; then
9- gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⊘ Skipping AUR support"
10- echo "AUR: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
9+ gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping AUR support"
10+ echo "AUR: disabled"
1111 export ARCHUP_AUR="disabled"
1212 return 0
1313 fi
@@ -24,8 +24,8 @@ arch-chroot /mnt pacman -S --noconfirm --needed base-devel git
2424 USERNAME=$(arch-chroot /mnt ls /home | head -1)
2525
2626 if [ -z "$USERNAME" ]; then
27- gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ Error: Could not find user for yay installation"
28- echo "ERROR: No user found for yay installation" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
27+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Error: Could not find user for yay installation"
28+ echo "ERROR: No user found for yay installation"
2929 export ARCHUP_AUR="failed"
3030 return 1
3131 fi
@@ -41,11 +41,11 @@ arch-chroot /mnt rm -rf /tmp/yay-bin
4141
4242 # Verify installation
4343 if arch-chroot /mnt su - "$USERNAME" -c "yay --version" >/dev/null 2>&1; then
44- gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ yay installed successfully"
45- echo "AUR: enabled (yay installed for user: $USERNAME)" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
44+ gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] yay installed successfully"
45+ echo "AUR: enabled (yay installed for user: $USERNAME)"
4646 else
47- gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ yay installation failed"
48- echo "ERROR: yay installation failed" | tee -a "$ARCHUP_INSTALL_LOG_FILE"
47+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay installation failed"
48+ echo "ERROR: yay installation failed"
4949 export ARCHUP_AUR="failed"
5050 return 1
5151 fi
@@ -6,8 +6,8 @@ echo
6 6
7 # Ask if user wants AUR support7 # Ask if user wants AUR support
8 if ! gum confirm "Enable AUR support (install yay)?" --padding "0 0 1 $PADDING_LEFT"; then8 if ! gum confirm "Enable AUR support (install yay)?" --padding "0 0 1 $PADDING_LEFT"; then
9- gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⊘ Skipping AUR support"9+ gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping AUR support"
10- echo "AUR: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE"10+ echo "AUR: disabled"
11 export ARCHUP_AUR="disabled"11 export ARCHUP_AUR="disabled"
12 return 012 return 0
13 fi13 fi
@@ -24,8 +24,8 @@ arch-chroot /mnt pacman -S --noconfirm --needed base-devel git
24 USERNAME=$(arch-chroot /mnt ls /home | head -1)24 USERNAME=$(arch-chroot /mnt ls /home | head -1)
25 25
26 if [ -z "$USERNAME" ]; then26 if [ -z "$USERNAME" ]; then
27- gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ Error: Could not find user for yay installation"27+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Error: Could not find user for yay installation"
28- echo "ERROR: No user found for yay installation" | tee -a "$ARCHUP_INSTALL_LOG_FILE"28+ echo "ERROR: No user found for yay installation"
29 export ARCHUP_AUR="failed"29 export ARCHUP_AUR="failed"
30 return 130 return 1
31 fi31 fi
@@ -41,11 +41,11 @@ arch-chroot /mnt rm -rf /tmp/yay-bin
41 41
42 # Verify installation42 # Verify installation
43 if arch-chroot /mnt su - "$USERNAME" -c "yay --version" >/dev/null 2>&1; then43 if arch-chroot /mnt su - "$USERNAME" -c "yay --version" >/dev/null 2>&1; then
44- gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ yay installed successfully"44+ gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] yay installed successfully"
45- echo "AUR: enabled (yay installed for user: $USERNAME)" | tee -a "$ARCHUP_INSTALL_LOG_FILE"45+ echo "AUR: enabled (yay installed for user: $USERNAME)"
46 else46 else
47- gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ yay installation failed"47+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay installation failed"
48- echo "ERROR: yay installation failed" | tee -a "$ARCHUP_INSTALL_LOG_FILE"48+ echo "ERROR: yay installation failed"
49 export ARCHUP_AUR="failed"49 export ARCHUP_AUR="failed"
50 return 150 return 1
51 fi51 fi

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close