detached 820b598

fix(installer): comprehensive error handling, UX improvements, and branding update

commit
820b59828f553951921cf257b6b2e5f2b34c488c
author
bnema · · 2025-10-20 03:36 UTC
parent
4fd0033
signature
unsigned
24 files · +213 -137
M install.sh +8 -5
@@ -1,5 +1,5 @@
11 #!/bin/bash
2-# archup - Fast, minimal Arch Linux auto-installer
2+# ArchUp - Fast, minimal Arch Linux auto-installer
33 # Main installation orchestrator
44
55 set -eo pipefail
@@ -13,7 +13,7 @@ export ARCHUP_RAW_URL="${ARCHUP_RAW_URL:-https://raw.githubusercontent.com/bnema
1313
1414 # Download installer files if not present (for curl-based installation)
1515 if [ ! -d "$ARCHUP_INSTALL" ]; then
16- echo "=== Downloading archup installer files ==="
16+ echo "=== Downloading ArchUp installer files ==="
1717 mkdir -p "$ARCHUP_INSTALL"
1818
1919 # Download all required files using curl
@@ -81,13 +81,16 @@ clear_logo
8181 # PHASE 1: BAREBONE INSTALLER - BASIC
8282 # ============================================================
8383
84-# Preflight validation (interactive prompts BEFORE logging starts)
84+# Initialize log file
85+start_install_log
86+
87+# Preflight validation (interactive prompts, no log monitor running)
8588 source "$ARCHUP_INSTALL/preflight/all.sh"
8689
87-# Start log monitor AFTER all interactive prompts
90+# Start log monitor ONCE - it will run continuously during all work phases
8891 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing..."
8992 echo
90-start_install_log
93+start_log_output
9194
9295 # Partitioning (auto GPT, ext4, no encryption)
9396 source "$ARCHUP_INSTALL/partitioning/all.sh"
@@ -1,5 +1,5 @@
1 #!/bin/bash1 #!/bin/bash
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 -eo pipefail5 set -eo pipefail
@@ -13,7 +13,7 @@ export ARCHUP_RAW_URL="${ARCHUP_RAW_URL:-https://raw.githubusercontent.com/bnema
13 13
14 # Download installer files if not present (for curl-based installation)14 # Download installer files if not present (for curl-based installation)
15 if [ ! -d "$ARCHUP_INSTALL" ]; then15 if [ ! -d "$ARCHUP_INSTALL" ]; then
16- echo "=== Downloading archup installer files ==="16+ echo "=== Downloading ArchUp installer files ==="
17 mkdir -p "$ARCHUP_INSTALL"17 mkdir -p "$ARCHUP_INSTALL"
18 18
19 # Download all required files using curl19 # Download all required files using curl
@@ -81,13 +81,16 @@ clear_logo
81 # PHASE 1: BAREBONE INSTALLER - BASIC81 # PHASE 1: BAREBONE INSTALLER - BASIC
82 # ============================================================82 # ============================================================
83 83
84-# Preflight validation (interactive prompts BEFORE logging starts)84+# Initialize log file
85+start_install_log
86+
87+# Preflight validation (interactive prompts, no log monitor running)
85 source "$ARCHUP_INSTALL/preflight/all.sh"88 source "$ARCHUP_INSTALL/preflight/all.sh"
86 89
87-# Start log monitor AFTER all interactive prompts90+# Start log monitor ONCE - it will run continuously during all work phases
88 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing..."91 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing..."
89 echo92 echo
90-start_install_log93+start_log_output
91 94
92 # Partitioning (auto GPT, ext4, no encryption)95 # Partitioning (auto GPT, ext4, no encryption)
93 source "$ARCHUP_INSTALL/partitioning/all.sh"96 source "$ARCHUP_INSTALL/partitioning/all.sh"
M install/base/all.sh +3 -0
@@ -1,6 +1,9 @@
11 #!/bin/bash
22 # Base installation phase
33
4+stop_log_output # Stop for interactive prompt
45 source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose)
6+start_log_output # Resume after prompt
7+
58 run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive
69 run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive
@@ -1,6 +1,9 @@
1 #!/bin/bash1 #!/bin/bash
2 # Base installation phase2 # Base installation phase
3 3
4+stop_log_output # Stop for interactive prompt
4 source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose)5 source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose)
6+start_log_output # Resume after prompt
7+
5 run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive8 run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive
6 run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive9 run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive
M install/base/fstab.sh +1 -1
@@ -8,4 +8,4 @@ genfstab -U /mnt >> /mnt/etc/fstab
88
99 gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] fstab generated"
1010
11-echo "Generated /etc/fstab"
11+echo "Generated /etc/fstab" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -8,4 +8,4 @@ genfstab -U /mnt >> /mnt/etc/fstab
8 8
9 gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] fstab generated"9 gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] fstab generated"
10 10
11-echo "Generated /etc/fstab"11+echo "Generated /etc/fstab" >> "$ARCHUP_INSTALL_LOG_FILE"
M install/boot/limine.sh +11 -11
@@ -15,9 +15,9 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
1515 sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block encrypt filesystems fsck)/' /mnt/etc/mkinitcpio.conf
1616
1717 # Regenerate initramfs
18- arch-chroot /mnt mkinitcpio -P
18+ arch-chroot /mnt mkinitcpio -P >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
1919
20- echo "Updated mkinitcpio.conf with encrypt hook"
20+ echo "Updated mkinitcpio.conf with encrypt hook" >> "$ARCHUP_INSTALL_LOG_FILE"
2121
2222 # Kernel parameters for encrypted boot
2323 KERNEL_PARAMS="cryptdevice=UUID=$ROOT_UUID:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw"
@@ -30,23 +30,23 @@ 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"
33+ echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" >> "$ARCHUP_INSTALL_LOG_FILE"
3434 fi
3535
36-# Install Limine to the disk (UEFI)
37-arch-chroot /mnt limine bios-install "$ARCHUP_DISK"
36+# Install Limine to the disk (BIOS - optional, will fail on UEFI-only systems)
37+arch-chroot /mnt limine bios-install "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true
3838
3939 # Create Limine configuration directory
4040 mkdir -p /mnt/boot/EFI/BOOT
4141
4242 # Create Limine configuration with proper syntax
4343 cat > /mnt/boot/EFI/BOOT/limine.conf <<EOF
44-# archup - Limine bootloader configuration
44+# ArchUp - Limine bootloader configuration
4545 # Docs: https://github.com/limine-bootloader/limine/blob/trunk/CONFIG.md
4646
4747 timeout: 5
4848 default_entry: 0
49-interface_branding: archup
49+interface_branding: ArchUp
5050 interface_branding_colour: 6
5151 graphics: yes
5252 quiet: yes
@@ -79,13 +79,13 @@ EFI_PART_NUM=$(echo "$ARCHUP_EFI_PART" | grep -o '[0-9]*$' | sed 's/^p//')
7979 arch-chroot /mnt efibootmgr --create \
8080 --disk "$ARCHUP_DISK" \
8181 --part "$EFI_PART_NUM" \
82- --label "archup" \
83- --loader "\\EFI\\BOOT\\BOOTX64.EFI"
82+ --label "ArchUp" \
83+ --loader "\\EFI\\BOOT\\BOOTX64.EFI" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
8484
8585 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)"
88+ echo "Installed Limine with encrypted root (UUID: $ROOT_UUID)" >> "$ARCHUP_INSTALL_LOG_FILE"
8989 else
90- echo "Installed Limine with root UUID: $ROOT_UUID"
90+ echo "Installed Limine with root UUID: $ROOT_UUID" >> "$ARCHUP_INSTALL_LOG_FILE"
9191 fi
@@ -15,9 +15,9 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
15 sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block encrypt filesystems fsck)/' /mnt/etc/mkinitcpio.conf15 sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block encrypt filesystems fsck)/' /mnt/etc/mkinitcpio.conf
16 16
17 # Regenerate initramfs17 # Regenerate initramfs
18- arch-chroot /mnt mkinitcpio -P18+ arch-chroot /mnt mkinitcpio -P >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
19 19
20- echo "Updated mkinitcpio.conf with encrypt hook"20+ echo "Updated mkinitcpio.conf with encrypt hook" >> "$ARCHUP_INSTALL_LOG_FILE"
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,23 +30,23 @@ 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"33+ echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" >> "$ARCHUP_INSTALL_LOG_FILE"
34 fi34 fi
35 35
36-# Install Limine to the disk (UEFI)36+# Install Limine to the disk (BIOS - optional, will fail on UEFI-only systems)
37-arch-chroot /mnt limine bios-install "$ARCHUP_DISK"37+arch-chroot /mnt limine bios-install "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true
38 38
39 # Create Limine configuration directory39 # Create Limine configuration directory
40 mkdir -p /mnt/boot/EFI/BOOT40 mkdir -p /mnt/boot/EFI/BOOT
41 41
42 # Create Limine configuration with proper syntax42 # Create Limine configuration with proper syntax
43 cat > /mnt/boot/EFI/BOOT/limine.conf <<EOF43 cat > /mnt/boot/EFI/BOOT/limine.conf <<EOF
44-# archup - Limine bootloader configuration44+# ArchUp - Limine bootloader configuration
45 # Docs: https://github.com/limine-bootloader/limine/blob/trunk/CONFIG.md45 # Docs: https://github.com/limine-bootloader/limine/blob/trunk/CONFIG.md
46 46
47 timeout: 547 timeout: 5
48 default_entry: 048 default_entry: 0
49-interface_branding: archup49+interface_branding: ArchUp
50 interface_branding_colour: 650 interface_branding_colour: 6
51 graphics: yes51 graphics: yes
52 quiet: yes52 quiet: yes
@@ -79,13 +79,13 @@ EFI_PART_NUM=$(echo "$ARCHUP_EFI_PART" | grep -o '[0-9]*$' | sed 's/^p//')
79 arch-chroot /mnt efibootmgr --create \79 arch-chroot /mnt efibootmgr --create \
80 --disk "$ARCHUP_DISK" \80 --disk "$ARCHUP_DISK" \
81 --part "$EFI_PART_NUM" \81 --part "$EFI_PART_NUM" \
82- --label "archup" \82+ --label "ArchUp" \
83- --loader "\\EFI\\BOOT\\BOOTX64.EFI"83+ --loader "\\EFI\\BOOT\\BOOTX64.EFI" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
84 84
85 gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] 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)"88+ echo "Installed Limine with encrypted root (UUID: $ROOT_UUID)" >> "$ARCHUP_INSTALL_LOG_FILE"
89 else89 else
90- echo "Installed Limine with root UUID: $ROOT_UUID"90+ echo "Installed Limine with root UUID: $ROOT_UUID" >> "$ARCHUP_INSTALL_LOG_FILE"
91 fi91 fi
M install/bootstrap.sh +21 -0
@@ -5,6 +5,27 @@
55
66 set -e
77
8+# Clean up from previous installation attempts
9+echo "Cleaning up previous installation attempts..."
10+
11+# Unmount all /mnt mountpoints (recursive)
12+if mountpoint -q /mnt 2>/dev/null; then
13+ echo "Unmounting /mnt..."
14+ umount -R /mnt 2>/dev/null || true
15+fi
16+
17+# Close any open LUKS containers
18+if [ -e /dev/mapper/cryptroot ]; then
19+ echo "Closing LUKS container..."
20+ cryptsetup close cryptroot 2>/dev/null || true
21+fi
22+
23+# Deactivate swap
24+swapoff -a 2>/dev/null || true
25+
26+echo "[OK] Cleanup complete"
27+echo
28+
829 # Clean up old log file to ensure fresh logs for this attempt
930 if [ -f "$ARCHUP_INSTALL_LOG_FILE" ]; then
1031 rm -f "$ARCHUP_INSTALL_LOG_FILE"
@@ -5,6 +5,27 @@
5 5
6 set -e6 set -e
7 7
8+# Clean up from previous installation attempts
9+echo "Cleaning up previous installation attempts..."
10+
11+# Unmount all /mnt mountpoints (recursive)
12+if mountpoint -q /mnt 2>/dev/null; then
13+ echo "Unmounting /mnt..."
14+ umount -R /mnt 2>/dev/null || true
15+fi
16+
17+# Close any open LUKS containers
18+if [ -e /dev/mapper/cryptroot ]; then
19+ echo "Closing LUKS container..."
20+ cryptsetup close cryptroot 2>/dev/null || true
21+fi
22+
23+# Deactivate swap
24+swapoff -a 2>/dev/null || true
25+
26+echo "[OK] Cleanup complete"
27+echo
28+
8 # Clean up old log file to ensure fresh logs for this attempt29 # Clean up old log file to ensure fresh logs for this attempt
9 if [ -f "$ARCHUP_INSTALL_LOG_FILE" ]; then30 if [ -f "$ARCHUP_INSTALL_LOG_FILE" ]; then
10 rm -f "$ARCHUP_INSTALL_LOG_FILE"31 rm -f "$ARCHUP_INSTALL_LOG_FILE"
M install/config/all.sh +3 -0
@@ -1,6 +1,9 @@
11 #!/bin/bash
22 # Configuration phase
33
4+stop_log_output # Stop for interactive prompts
45 source "$ARCHUP_INSTALL/config/system.sh" # Interactive (gum input)
56 source "$ARCHUP_INSTALL/config/user.sh" # Interactive (gum input)
7+start_log_output # Resume after prompts
8+
69 run_logged "$ARCHUP_INSTALL/config/network.sh" # Non-interactive
@@ -1,6 +1,9 @@
1 #!/bin/bash1 #!/bin/bash
2 # Configuration phase2 # Configuration phase
3 3
4+stop_log_output # Stop for interactive prompts
4 source "$ARCHUP_INSTALL/config/system.sh" # Interactive (gum input)5 source "$ARCHUP_INSTALL/config/system.sh" # Interactive (gum input)
5 source "$ARCHUP_INSTALL/config/user.sh" # Interactive (gum input)6 source "$ARCHUP_INSTALL/config/user.sh" # Interactive (gum input)
7+start_log_output # Resume after prompts
8+
6 run_logged "$ARCHUP_INSTALL/config/network.sh" # Non-interactive9 run_logged "$ARCHUP_INSTALL/config/network.sh" # Non-interactive
M install/config/network.sh +3 -3
@@ -23,11 +23,11 @@ DHCP=yes
2323 EOF
2424
2525 # Enable services
26-arch-chroot /mnt systemctl enable systemd-networkd
27-arch-chroot /mnt systemctl enable systemd-resolved
26+arch-chroot /mnt systemctl enable systemd-networkd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
27+arch-chroot /mnt systemctl enable systemd-resolved >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
2828
2929 # Enable iwd for WiFi
30-arch-chroot /mnt systemctl enable iwd
30+arch-chroot /mnt systemctl enable iwd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
3131
3232 # Migrate WiFi credentials from ISO if detected
3333 if [ -n "$ARCHUP_WIFI_SSID" ] && [ -n "$ARCHUP_WIFI_PASSPHRASE" ]; then
@@ -23,11 +23,11 @@ DHCP=yes
23 EOF23 EOF
24 24
25 # Enable services25 # Enable services
26-arch-chroot /mnt systemctl enable systemd-networkd26+arch-chroot /mnt systemctl enable systemd-networkd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
27-arch-chroot /mnt systemctl enable systemd-resolved27+arch-chroot /mnt systemctl enable systemd-resolved >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
28 28
29 # Enable iwd for WiFi29 # Enable iwd for WiFi
30-arch-chroot /mnt systemctl enable iwd30+arch-chroot /mnt systemctl enable iwd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
31 31
32 # Migrate WiFi credentials from ISO if detected32 # Migrate WiFi credentials from ISO if detected
33 if [ -n "$ARCHUP_WIFI_SSID" ] && [ -n "$ARCHUP_WIFI_PASSPHRASE" ]; then33 if [ -n "$ARCHUP_WIFI_SSID" ] && [ -n "$ARCHUP_WIFI_PASSPHRASE" ]; then
M install/config/system.sh +3 -3
@@ -14,14 +14,14 @@ if [ -z "$ARCHUP_TIMEZONE" ]; then
1414 fi
1515
1616 # Set timezone
17-arch-chroot /mnt ln -sf "/usr/share/zoneinfo/$ARCHUP_TIMEZONE" /etc/localtime
18-arch-chroot /mnt hwclock --systohc
17+arch-chroot /mnt ln -sf "/usr/share/zoneinfo/$ARCHUP_TIMEZONE" /etc/localtime >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
18+arch-chroot /mnt hwclock --systohc >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
1919
2020 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
24-arch-chroot /mnt locale-gen
24+arch-chroot /mnt locale-gen >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
2525 echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf
2626
2727 gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Locale set to: en_US.UTF-8"
@@ -14,14 +14,14 @@ if [ -z "$ARCHUP_TIMEZONE" ]; then
14 fi14 fi
15 15
16 # Set timezone16 # Set timezone
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 >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
18-arch-chroot /mnt hwclock --systohc18+arch-chroot /mnt hwclock --systohc >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
19 19
20 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] 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 >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
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" "[OK] 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"
M install/config/user.sh +9 -36
@@ -1,50 +1,23 @@
11 #!/bin/bash
2-# User creation and configuration
2+# User creation and configuration (uses credentials from preflight)
33
4-gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "User Account Setup"
5-echo
4+gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating user account..."
65
7-# Ask for username
8-ARCHUP_USERNAME=$(gum input --placeholder "Enter username" \
9- --prompt "Username: " \
10- --padding "0 0 0 $PADDING_LEFT")
11-
12-if [ -z "$ARCHUP_USERNAME" ]; then
13- gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "Username cannot be empty!"
14- exit 1
15-fi
16-
17-# Ask for password
18-ARCHUP_PASSWORD=$(gum input --password --placeholder "Enter password" \
19- --prompt "Password: " \
20- --padding "0 0 0 $PADDING_LEFT")
21-
22-ARCHUP_PASSWORD_CONFIRM=$(gum input --password --placeholder "Confirm password" \
23- --prompt "Confirm: " \
24- --padding "0 0 0 $PADDING_LEFT")
25-
26-if [ "$ARCHUP_PASSWORD" != "$ARCHUP_PASSWORD_CONFIRM" ]; then
27- gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "Passwords do not match!"
28- exit 1
29-fi
30-
31-echo
32-
33-# Set root password (same as user password for simplicity in Phase 1)
34-echo "root:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd
6+# Set root password (same as user password)
7+echo "root:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
358
369 # Create user with home directory
37-arch-chroot /mnt useradd -m -G wheel -s /bin/bash "$ARCHUP_USERNAME"
10+arch-chroot /mnt useradd -m -G wheel -s /bin/bash "$ARCHUP_USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
3811
3912 # Set user password
40-echo "$ARCHUP_USERNAME:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd
13+echo "$ARCHUP_USERNAME:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
4114
4215 # Enable sudo for wheel group
4316 echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/etc/sudoers.d/wheel
44-chmod 440 /mnt/etc/sudoers.d/wheel
17+chmod 440 /mnt/etc/sudoers.d/wheel >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
4518
4619 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] User created: $ARCHUP_USERNAME"
4720 gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Sudo enabled for wheel group"
4821
49-echo "Created user: $ARCHUP_USERNAME"
50-echo "Enabled sudo for wheel group"
22+echo "Created user: $ARCHUP_USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE"
23+echo "Enabled sudo for wheel group" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -1,50 +1,23 @@
1 #!/bin/bash1 #!/bin/bash
2-# User creation and configuration2+# User creation and configuration (uses credentials from preflight)
3 3
4-gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "User Account Setup"4+gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating user account..."
5-echo
6 5
7-# Ask for username6+# Set root password (same as user password)
8-ARCHUP_USERNAME=$(gum input --placeholder "Enter username" \7+echo "root:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
9- --prompt "Username: " \
10- --padding "0 0 0 $PADDING_LEFT")
11-
12-if [ -z "$ARCHUP_USERNAME" ]; then
13- gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "Username cannot be empty!"
14- exit 1
15-fi
16-
17-# Ask for password
18-ARCHUP_PASSWORD=$(gum input --password --placeholder "Enter password" \
19- --prompt "Password: " \
20- --padding "0 0 0 $PADDING_LEFT")
21-
22-ARCHUP_PASSWORD_CONFIRM=$(gum input --password --placeholder "Confirm password" \
23- --prompt "Confirm: " \
24- --padding "0 0 0 $PADDING_LEFT")
25-
26-if [ "$ARCHUP_PASSWORD" != "$ARCHUP_PASSWORD_CONFIRM" ]; then
27- gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "Passwords do not match!"
28- exit 1
29-fi
30-
31-echo
32-
33-# Set root password (same as user password for simplicity in Phase 1)
34-echo "root:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd
35 8
36 # Create user with home directory9 # Create user with home directory
37-arch-chroot /mnt useradd -m -G wheel -s /bin/bash "$ARCHUP_USERNAME"10+arch-chroot /mnt useradd -m -G wheel -s /bin/bash "$ARCHUP_USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
38 11
39 # Set user password12 # Set user password
40-echo "$ARCHUP_USERNAME:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd13+echo "$ARCHUP_USERNAME:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
41 14
42 # Enable sudo for wheel group15 # Enable sudo for wheel group
43 echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/etc/sudoers.d/wheel16 echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/etc/sudoers.d/wheel
44-chmod 440 /mnt/etc/sudoers.d/wheel17+chmod 440 /mnt/etc/sudoers.d/wheel >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
45 18
46 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] User created: $ARCHUP_USERNAME"19 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"20 gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Sudo enabled for wheel group"
48 21
49-echo "Created user: $ARCHUP_USERNAME"22+echo "Created user: $ARCHUP_USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE"
50-echo "Enabled sudo for wheel group"23+echo "Enabled sudo for wheel group" >> "$ARCHUP_INSTALL_LOG_FILE"
M install/helpers/chroot.sh +1 -1
@@ -1,5 +1,5 @@
11 #!/bin/bash
2-# Chroot utilities for archup installer
2+# Chroot utilities for ArchUp installer
33 # Adapted from Omarchy chroot.sh
44
55 # Starting the installer with ARCHUP_CHROOT_INSTALL=1 will put it into chroot mode
@@ -1,5 +1,5 @@
1 #!/bin/bash1 #!/bin/bash
2-# Chroot utilities for archup installer2+# Chroot utilities for ArchUp installer
3 # Adapted from Omarchy chroot.sh3 # Adapted from Omarchy chroot.sh
4 4
5 # Starting the installer with ARCHUP_CHROOT_INSTALL=1 will put it into chroot mode5 # Starting the installer with ARCHUP_CHROOT_INSTALL=1 will put it into chroot mode
M install/helpers/errors.sh +25 -4
@@ -1,5 +1,5 @@
11 #!/bin/bash
2-# Error handling for archup installer - improved with logging and interactivity
2+# Error handling for ArchUp installer - improved with logging and interactivity
33
44 # QR code for GitHub issues
55 QR_CODE='
@@ -117,7 +117,7 @@ catch_errors() {
117117 clear_logo
118118 show_cursor
119119
120- 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!"
121121 show_log_tail
122122
123123 echo
@@ -128,7 +128,7 @@ catch_errors() {
128128 gum style "$QR_CODE"
129129 echo
130130 gum style "Check logs: $ARCHUP_INSTALL_LOG_FILE"
131- gum style "Report issues: ${ARCHUP_REPO_URL:-https://github.com/bnema/archup}/issues"
131+ gum style "Report issues: ${ARCHUP_REPO_URL:-https://github.com/bnema/ArchUp}/issues"
132132 echo
133133
134134 # Interactive menu
@@ -153,6 +153,26 @@ catch_errors() {
153153 done
154154 }
155155
156+# Interrupt handler (Ctrl+C)
157+interrupt_handler() {
158+ if [[ $ERROR_HANDLING == true ]]; then
159+ return
160+ fi
161+
162+ ERROR_HANDLING=true
163+
164+ stop_log_output
165+ restore_outputs
166+ show_cursor
167+
168+ echo
169+ gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation interrupted by user"
170+ echo "Installation cancelled at: $(date '+%Y-%m-%d %H:%M:%S')" >> "$ARCHUP_INSTALL_LOG_FILE"
171+ echo
172+
173+ exit 130
174+}
175+
156176 # Exit handler
157177 exit_handler() {
158178 local exit_code=$?
@@ -167,7 +187,8 @@ exit_handler() {
167187 }
168188
169189 # Set up traps
170-trap catch_errors ERR INT TERM
190+trap catch_errors ERR TERM
191+trap interrupt_handler INT
171192 trap exit_handler EXIT
172193
173194 # Save original outputs for restoration
@@ -1,5 +1,5 @@
1 #!/bin/bash1 #!/bin/bash
2-# Error handling for archup installer - improved with logging and interactivity2+# Error handling for ArchUp installer - improved with logging and interactivity
3 3
4 # QR code for GitHub issues4 # QR code for GitHub issues
5 QR_CODE='5 QR_CODE='
@@ -117,7 +117,7 @@ catch_errors() {
117 clear_logo117 clear_logo
118 show_cursor118 show_cursor
119 119
120- 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!"
121 show_log_tail121 show_log_tail
122 122
123 echo123 echo
@@ -128,7 +128,7 @@ catch_errors() {
128 gum style "$QR_CODE"128 gum style "$QR_CODE"
129 echo129 echo
130 gum style "Check logs: $ARCHUP_INSTALL_LOG_FILE"130 gum style "Check logs: $ARCHUP_INSTALL_LOG_FILE"
131- gum style "Report issues: ${ARCHUP_REPO_URL:-https://github.com/bnema/archup}/issues"131+ gum style "Report issues: ${ARCHUP_REPO_URL:-https://github.com/bnema/ArchUp}/issues"
132 echo132 echo
133 133
134 # Interactive menu134 # Interactive menu
@@ -153,6 +153,26 @@ catch_errors() {
153 done153 done
154 }154 }
155 155
156+# Interrupt handler (Ctrl+C)
157+interrupt_handler() {
158+ if [[ $ERROR_HANDLING == true ]]; then
159+ return
160+ fi
161+
162+ ERROR_HANDLING=true
163+
164+ stop_log_output
165+ restore_outputs
166+ show_cursor
167+
168+ echo
169+ gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation interrupted by user"
170+ echo "Installation cancelled at: $(date '+%Y-%m-%d %H:%M:%S')" >> "$ARCHUP_INSTALL_LOG_FILE"
171+ echo
172+
173+ exit 130
174+}
175+
156 # Exit handler176 # Exit handler
157 exit_handler() {177 exit_handler() {
158 local exit_code=$?178 local exit_code=$?
@@ -167,7 +187,8 @@ exit_handler() {
167 }187 }
168 188
169 # Set up traps189 # Set up traps
170-trap catch_errors ERR INT TERM190+trap catch_errors ERR TERM
191+trap interrupt_handler INT
171 trap exit_handler EXIT192 trap exit_handler EXIT
172 193
173 # Save original outputs for restoration194 # Save original outputs for restoration
M install/helpers/logging.sh +8 -5
@@ -1,5 +1,5 @@
11 #!/bin/bash
2-# Logging system for archup installer - fixes variable export issues
2+# Logging system for ArchUp installer - fixes variable export issues
33 # Uses background process for log display instead of exec redirection
44
55 # Global variable for monitor background process
@@ -57,6 +57,9 @@ stop_log_output() {
5757 kill $monitor_pid 2>/dev/null || true
5858 wait $monitor_pid 2>/dev/null || true
5959 unset monitor_pid
60+
61+ # Clean up terminal state
62+ printf "\033[?25h" # Show cursor
6063 fi
6164 }
6265
@@ -65,10 +68,9 @@ start_install_log() {
6568 chmod 666 "$ARCHUP_INSTALL_LOG_FILE"
6669
6770 export ARCHUP_START_TIME=$(date '+%Y-%m-%d %H:%M:%S')
68- echo "=== archup Installation Started: $ARCHUP_START_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE"
71+ echo "=== ArchUp Installation Started: $ARCHUP_START_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE"
6972
70- # Start background log display (NO exec redirection!)
71- start_log_output
73+ # Don't start log monitor here - run_logged will handle it dynamically
7274 }
7375
7476 stop_install_log() {
@@ -78,7 +80,7 @@ stop_install_log() {
7880 if [[ -n ${ARCHUP_INSTALL_LOG_FILE:-} ]]; then
7981 ARCHUP_END_TIME=$(date '+%Y-%m-%d %H:%M:%S')
8082 echo "" >> "$ARCHUP_INSTALL_LOG_FILE"
81- echo "=== archup Installation Completed: $ARCHUP_END_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE"
83+ echo "=== ArchUp Installation Completed: $ARCHUP_END_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE"
8284
8385 if [ -n "$ARCHUP_START_TIME" ]; then
8486 ARCHUP_START_EPOCH=$(date -d "$ARCHUP_START_TIME" +%s)
@@ -101,6 +103,7 @@ run_logged() {
101103
102104 echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >> "$ARCHUP_INSTALL_LOG_FILE"
103105
106+ # Don't start/stop log monitor here - it runs continuously once started
104107 # Use bash -c to create a clean subshell and redirect output to log
105108 bash -c "source '$script'" </dev/null >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
106109
@@ -1,5 +1,5 @@
1 #!/bin/bash1 #!/bin/bash
2-# Logging system for archup installer - fixes variable export issues2+# Logging system for ArchUp installer - fixes variable export issues
3 # Uses background process for log display instead of exec redirection3 # Uses background process for log display instead of exec redirection
4 4
5 # Global variable for monitor background process5 # Global variable for monitor background process
@@ -57,6 +57,9 @@ stop_log_output() {
57 kill $monitor_pid 2>/dev/null || true57 kill $monitor_pid 2>/dev/null || true
58 wait $monitor_pid 2>/dev/null || true58 wait $monitor_pid 2>/dev/null || true
59 unset monitor_pid59 unset monitor_pid
60+
61+ # Clean up terminal state
62+ printf "\033[?25h" # Show cursor
60 fi63 fi
61 }64 }
62 65
@@ -65,10 +68,9 @@ start_install_log() {
65 chmod 666 "$ARCHUP_INSTALL_LOG_FILE"68 chmod 666 "$ARCHUP_INSTALL_LOG_FILE"
66 69
67 export ARCHUP_START_TIME=$(date '+%Y-%m-%d %H:%M:%S')70 export ARCHUP_START_TIME=$(date '+%Y-%m-%d %H:%M:%S')
68- echo "=== archup Installation Started: $ARCHUP_START_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE"71+ echo "=== ArchUp Installation Started: $ARCHUP_START_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE"
69 72
70- # Start background log display (NO exec redirection!)73+ # Don't start log monitor here - run_logged will handle it dynamically
71- start_log_output
72 }74 }
73 75
74 stop_install_log() {76 stop_install_log() {
@@ -78,7 +80,7 @@ stop_install_log() {
78 if [[ -n ${ARCHUP_INSTALL_LOG_FILE:-} ]]; then80 if [[ -n ${ARCHUP_INSTALL_LOG_FILE:-} ]]; then
79 ARCHUP_END_TIME=$(date '+%Y-%m-%d %H:%M:%S')81 ARCHUP_END_TIME=$(date '+%Y-%m-%d %H:%M:%S')
80 echo "" >> "$ARCHUP_INSTALL_LOG_FILE"82 echo "" >> "$ARCHUP_INSTALL_LOG_FILE"
81- echo "=== archup Installation Completed: $ARCHUP_END_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE"83+ echo "=== ArchUp Installation Completed: $ARCHUP_END_TIME ===" >> "$ARCHUP_INSTALL_LOG_FILE"
82 84
83 if [ -n "$ARCHUP_START_TIME" ]; then85 if [ -n "$ARCHUP_START_TIME" ]; then
84 ARCHUP_START_EPOCH=$(date -d "$ARCHUP_START_TIME" +%s)86 ARCHUP_START_EPOCH=$(date -d "$ARCHUP_START_TIME" +%s)
@@ -101,6 +103,7 @@ run_logged() {
101 103
102 echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >> "$ARCHUP_INSTALL_LOG_FILE"104 echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >> "$ARCHUP_INSTALL_LOG_FILE"
103 105
106+ # Don't start/stop log monitor here - it runs continuously once started
104 # Use bash -c to create a clean subshell and redirect output to log107 # 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>&1108 bash -c "source '$script'" </dev/null >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
106 109
M install/helpers/presentation.sh +1 -1
@@ -1,5 +1,5 @@
11 #!/bin/bash
2-# Presentation utilities for archup installer
2+# Presentation utilities for ArchUp installer
33 # Adapted from Omarchy presentation.sh
44 # NOTE: Requires gum to be installed via bootstrap.sh first!
55
@@ -1,5 +1,5 @@
1 #!/bin/bash1 #!/bin/bash
2-# Presentation utilities for archup installer2+# Presentation utilities for ArchUp installer
3 # Adapted from Omarchy presentation.sh3 # Adapted from Omarchy presentation.sh
4 # NOTE: Requires gum to be installed via bootstrap.sh first!4 # NOTE: Requires gum to be installed via bootstrap.sh first!
5 5
M install/partitioning/all.sh +5 -3
@@ -1,7 +1,9 @@
11 #!/bin/bash
22 # Partitioning phase
33
4+stop_log_output # Stop for interactive prompts and partition display
45 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
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 if encryption enabled + 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,7 +1,9 @@
1 #!/bin/bash1 #!/bin/bash
2 # Partitioning phase2 # Partitioning phase
3 3
4+stop_log_output # Stop for interactive prompts and partition display
4 source "$ARCHUP_INSTALL/partitioning/detect-disk.sh" # Interactive (gum confirm)5 source "$ARCHUP_INSTALL/partitioning/detect-disk.sh" # Interactive (gum confirm)
5-run_logged "$ARCHUP_INSTALL/partitioning/partition.sh" # Non-interactive6+source "$ARCHUP_INSTALL/partitioning/partition.sh" # Exports ARCHUP_EFI_PART, ARCHUP_ROOT_PART (has gum output)
6-run_logged "$ARCHUP_INSTALL/partitioning/format.sh" # Non-interactive7+source "$ARCHUP_INSTALL/partitioning/format.sh" # Interactive if encryption enabled + exports ARCHUP_CRYPT_ROOT
7-run_logged "$ARCHUP_INSTALL/partitioning/mount.sh" # Non-interactive8+source "$ARCHUP_INSTALL/partitioning/mount.sh" # Uses exported partition variables (has gum output)
9+start_log_output # Resume after all partitioning is done
M install/partitioning/format.sh +26 -23
@@ -3,69 +3,72 @@
33
44 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Formatting partitions..."
55
6+# Ensure nothing is mounted (cleanup from previous installation attempts)
7+umount -R /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true
8+swapoff -a >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true
9+
10+# Wipe any existing signatures on EFI partition
11+wipefs -af "$ARCHUP_EFI_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
12+
613 # Format EFI partition as FAT32
7-mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART" 2>&1
14+mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
815 echo "Formatted $ARCHUP_EFI_PART as FAT32" >> "$ARCHUP_INSTALL_LOG_FILE"
916
1017 # Handle root partition - with or without encryption
1118 if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
1219 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Setting up LUKS encryption..."
1320
14- # Prompt for encryption password
15- while true; do
16- LUKS_PASSWORD=$(gum input --password --placeholder "Enter encryption password" --padding "0 0 0 $PADDING_LEFT")
17- LUKS_PASSWORD_CONFIRM=$(gum input --password --placeholder "Confirm encryption password" --padding "0 0 0 $PADDING_LEFT")
18-
19- if [ "$LUKS_PASSWORD" = "$LUKS_PASSWORD_CONFIRM" ]; then
20- break
21- else
22- gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "Passwords do not match. Try again."
23- fi
24- done
21+ # Wipe any existing signatures on root partition to avoid conflicts
22+ wipefs -af "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
2523
26- # Setup LUKS with Argon2id and 2000ms iteration time
27- echo "$LUKS_PASSWORD" | cryptsetup luksFormat \
24+ # Setup LUKS with Argon2id and 2000ms iteration time (using user password)
25+ echo "$ARCHUP_PASSWORD" | cryptsetup luksFormat \
2826 --type luks2 \
27+ --batch-mode \
2928 --pbkdf argon2id \
3029 --iter-time 2000 \
3130 --label ARCHUP_LUKS \
32- "$ARCHUP_ROOT_PART"
31+ "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
32+
33+ echo "LUKS container created" >> "$ARCHUP_INSTALL_LOG_FILE"
3334
3435 # Open the encrypted container
35- echo "$LUKS_PASSWORD" | cryptsetup open "$ARCHUP_ROOT_PART" cryptroot
36+ echo "$ARCHUP_PASSWORD" | cryptsetup open "$ARCHUP_ROOT_PART" cryptroot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
37+
38+ echo "LUKS container opened" >> "$ARCHUP_INSTALL_LOG_FILE"
3639
3740 # Export the mapped device path
3841 export ARCHUP_CRYPT_ROOT="/dev/mapper/cryptroot"
3942
4043 # Format the encrypted container with btrfs
41- mkfs.btrfs -f -L ROOT "$ARCHUP_CRYPT_ROOT"
44+ mkfs.btrfs -f -L ROOT "$ARCHUP_CRYPT_ROOT" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
4245
4346 echo "Created LUKS container on $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE"
4447 echo "Formatted $ARCHUP_CRYPT_ROOT as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE"
4548
4649 # Mount temporarily to create subvolumes
47- mount "$ARCHUP_CRYPT_ROOT" /mnt
50+ mount "$ARCHUP_CRYPT_ROOT" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
4851
4952 else
5053 # No encryption - format directly with btrfs
51- mkfs.btrfs -f -L ROOT "$ARCHUP_ROOT_PART"
54+ mkfs.btrfs -f -L ROOT "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
5255 echo "Formatted $ARCHUP_ROOT_PART as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE"
5356
5457 # Mount temporarily to create subvolumes
55- mount "$ARCHUP_ROOT_PART" /mnt
58+ mount "$ARCHUP_ROOT_PART" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
5659 fi
5760
5861 # Create btrfs subvolumes
5962 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating btrfs subvolumes..."
6063
61-btrfs subvolume create /mnt/@
62-btrfs subvolume create /mnt/@home
64+btrfs subvolume create /mnt/@ >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
65+btrfs subvolume create /mnt/@home >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
6366
6467 echo "Created btrfs subvolume: @" >> "$ARCHUP_INSTALL_LOG_FILE"
6568 echo "Created btrfs subvolume: @home" >> "$ARCHUP_INSTALL_LOG_FILE"
6669
6770 # Unmount temporary mount
68-umount /mnt
71+umount /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
6972
7073 gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Partitions formatted and subvolumes created"
7174 echo "Partitions formatted and subvolumes created successfully" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -3,69 +3,72 @@
3 3
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+# Ensure nothing is mounted (cleanup from previous installation attempts)
7+umount -R /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true
8+swapoff -a >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true
9+
10+# Wipe any existing signatures on EFI partition
11+wipefs -af "$ARCHUP_EFI_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
12+
6 # Format EFI partition as FAT3213 # Format EFI partition as FAT32
7-mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART" 2>&114+mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
8 echo "Formatted $ARCHUP_EFI_PART as FAT32" >> "$ARCHUP_INSTALL_LOG_FILE"15 echo "Formatted $ARCHUP_EFI_PART as FAT32" >> "$ARCHUP_INSTALL_LOG_FILE"
9 16
10 # Handle root partition - with or without encryption17 # Handle root partition - with or without encryption
11 if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then18 if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
12 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Setting up LUKS encryption..."19 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Setting up LUKS encryption..."
13 20
14- # Prompt for encryption password21+ # Wipe any existing signatures on root partition to avoid conflicts
15- while true; do22+ wipefs -af "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
16- LUKS_PASSWORD=$(gum input --password --placeholder "Enter encryption password" --padding "0 0 0 $PADDING_LEFT")
17- LUKS_PASSWORD_CONFIRM=$(gum input --password --placeholder "Confirm encryption password" --padding "0 0 0 $PADDING_LEFT")
18-
19- if [ "$LUKS_PASSWORD" = "$LUKS_PASSWORD_CONFIRM" ]; then
20- break
21- else
22- gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "Passwords do not match. Try again."
23- fi
24- done
25 23
26- # Setup LUKS with Argon2id and 2000ms iteration time24+ # Setup LUKS with Argon2id and 2000ms iteration time (using user password)
27- echo "$LUKS_PASSWORD" | cryptsetup luksFormat \25+ echo "$ARCHUP_PASSWORD" | cryptsetup luksFormat \
28 --type luks2 \26 --type luks2 \
27+ --batch-mode \
29 --pbkdf argon2id \28 --pbkdf argon2id \
30 --iter-time 2000 \29 --iter-time 2000 \
31 --label ARCHUP_LUKS \30 --label ARCHUP_LUKS \
32- "$ARCHUP_ROOT_PART"31+ "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
32+
33+ echo "LUKS container created" >> "$ARCHUP_INSTALL_LOG_FILE"
33 34
34 # Open the encrypted container35 # Open the encrypted container
35- echo "$LUKS_PASSWORD" | cryptsetup open "$ARCHUP_ROOT_PART" cryptroot36+ echo "$ARCHUP_PASSWORD" | cryptsetup open "$ARCHUP_ROOT_PART" cryptroot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
37+
38+ echo "LUKS container opened" >> "$ARCHUP_INSTALL_LOG_FILE"
36 39
37 # Export the mapped device path40 # Export the mapped device path
38 export ARCHUP_CRYPT_ROOT="/dev/mapper/cryptroot"41 export ARCHUP_CRYPT_ROOT="/dev/mapper/cryptroot"
39 42
40 # Format the encrypted container with btrfs43 # Format the encrypted container with btrfs
41- mkfs.btrfs -f -L ROOT "$ARCHUP_CRYPT_ROOT"44+ mkfs.btrfs -f -L ROOT "$ARCHUP_CRYPT_ROOT" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
42 45
43 echo "Created LUKS container on $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE"46 echo "Created LUKS container on $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE"
44 echo "Formatted $ARCHUP_CRYPT_ROOT as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE"47 echo "Formatted $ARCHUP_CRYPT_ROOT as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE"
45 48
46 # Mount temporarily to create subvolumes49 # Mount temporarily to create subvolumes
47- mount "$ARCHUP_CRYPT_ROOT" /mnt50+ mount "$ARCHUP_CRYPT_ROOT" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
48 51
49 else52 else
50 # No encryption - format directly with btrfs53 # No encryption - format directly with btrfs
51- mkfs.btrfs -f -L ROOT "$ARCHUP_ROOT_PART"54+ mkfs.btrfs -f -L ROOT "$ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
52 echo "Formatted $ARCHUP_ROOT_PART as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE"55 echo "Formatted $ARCHUP_ROOT_PART as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE"
53 56
54 # Mount temporarily to create subvolumes57 # Mount temporarily to create subvolumes
55- mount "$ARCHUP_ROOT_PART" /mnt58+ mount "$ARCHUP_ROOT_PART" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
56 fi59 fi
57 60
58 # Create btrfs subvolumes61 # Create btrfs subvolumes
59 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating btrfs subvolumes..."62 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating btrfs subvolumes..."
60 63
61-btrfs subvolume create /mnt/@64+btrfs subvolume create /mnt/@ >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
62-btrfs subvolume create /mnt/@home65+btrfs subvolume create /mnt/@home >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
63 66
64 echo "Created btrfs subvolume: @" >> "$ARCHUP_INSTALL_LOG_FILE"67 echo "Created btrfs subvolume: @" >> "$ARCHUP_INSTALL_LOG_FILE"
65 echo "Created btrfs subvolume: @home" >> "$ARCHUP_INSTALL_LOG_FILE"68 echo "Created btrfs subvolume: @home" >> "$ARCHUP_INSTALL_LOG_FILE"
66 69
67 # Unmount temporary mount70 # Unmount temporary mount
68-umount /mnt71+umount /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
69 72
70 gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Partitions formatted and subvolumes created"73 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"74 echo "Partitions formatted and subvolumes created successfully" >> "$ARCHUP_INSTALL_LOG_FILE"
M install/partitioning/mount.sh +5 -5
@@ -11,21 +11,21 @@ else
1111 fi
1212
1313 # Mount @ subvolume as root with optimal btrfs options
14-mount -o noatime,compress=zstd,subvol=@ "$MOUNT_DEVICE" /mnt
14+mount -o noatime,compress=zstd,subvol=@ "$MOUNT_DEVICE" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
1515
1616 echo "Mounted @ subvolume to /mnt" >> "$ARCHUP_INSTALL_LOG_FILE"
1717
1818 # Create home directory
19-mkdir -p /mnt/home
19+mkdir -p /mnt/home >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
2020
2121 # Mount @home subvolume
22-mount -o noatime,compress=zstd,subvol=@home "$MOUNT_DEVICE" /mnt/home
22+mount -o noatime,compress=zstd,subvol=@home "$MOUNT_DEVICE" /mnt/home >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
2323
2424 echo "Mounted @home subvolume to /mnt/home" >> "$ARCHUP_INSTALL_LOG_FILE"
2525
2626 # Create and mount EFI directory
27-mkdir -p /mnt/boot
28-mount "$ARCHUP_EFI_PART" /mnt/boot
27+mkdir -p /mnt/boot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
28+mount "$ARCHUP_EFI_PART" /mnt/boot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
2929
3030 echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" >> "$ARCHUP_INSTALL_LOG_FILE"
3131
@@ -11,21 +11,21 @@ else
11 fi11 fi
12 12
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 >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
15 15
16 echo "Mounted @ subvolume to /mnt" >> "$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 >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
20 20
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 >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
23 23
24 echo "Mounted @home subvolume to /mnt/home" >> "$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 >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
28-mount "$ARCHUP_EFI_PART" /mnt/boot28+mount "$ARCHUP_EFI_PART" /mnt/boot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
29 29
30 echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" >> "$ARCHUP_INSTALL_LOG_FILE"30 echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" >> "$ARCHUP_INSTALL_LOG_FILE"
31 31
M install/partitioning/partition.sh +4 -4
@@ -4,8 +4,8 @@
44 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating partitions..."
55
66 # Wipe disk and create GPT partition table
7-wipefs -af "$ARCHUP_DISK"
8-sgdisk --zap-all "$ARCHUP_DISK"
7+wipefs -af "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
8+sgdisk --zap-all "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
99
1010 # Create partitions
1111 # 1. EFI partition (512MB)
@@ -13,10 +13,10 @@ sgdisk --zap-all "$ARCHUP_DISK"
1313 sgdisk --clear \
1414 --new=1:0:+512M --typecode=1:ef00 --change-name=1:"EFI" \
1515 --new=2:0:0 --typecode=2:8300 --change-name=2:"ROOT" \
16- "$ARCHUP_DISK"
16+ "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
1717
1818 # Inform kernel of partition changes
19-partprobe "$ARCHUP_DISK"
19+partprobe "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
2020 sleep 1
2121
2222 # Set partition variables
@@ -4,8 +4,8 @@
4 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating partitions..."4 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating partitions..."
5 5
6 # Wipe disk and create GPT partition table6 # Wipe disk and create GPT partition table
7-wipefs -af "$ARCHUP_DISK"7+wipefs -af "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
8-sgdisk --zap-all "$ARCHUP_DISK"8+sgdisk --zap-all "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
9 9
10 # Create partitions10 # Create partitions
11 # 1. EFI partition (512MB)11 # 1. EFI partition (512MB)
@@ -13,10 +13,10 @@ sgdisk --zap-all "$ARCHUP_DISK"
13 sgdisk --clear \13 sgdisk --clear \
14 --new=1:0:+512M --typecode=1:ef00 --change-name=1:"EFI" \14 --new=1:0:+512M --typecode=1:ef00 --change-name=1:"EFI" \
15 --new=2:0:0 --typecode=2:8300 --change-name=2:"ROOT" \15 --new=2:0:0 --typecode=2:8300 --change-name=2:"ROOT" \
16- "$ARCHUP_DISK"16+ "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
17 17
18 # Inform kernel of partition changes18 # Inform kernel of partition changes
19-partprobe "$ARCHUP_DISK"19+partprobe "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
20 sleep 120 sleep 1
21 21
22 # Set partition variables22 # Set partition variables
M install/preflight/all.sh +2 -2
@@ -2,5 +2,5 @@
22 # Preflight phase
33
44 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)
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
@@ -2,5 +2,5 @@
2 # Preflight phase2 # Preflight phase
3 3
4 source "$ARCHUP_INSTALL/preflight/guards.sh" # Interactive (gum confirm)4 source "$ARCHUP_INSTALL/preflight/guards.sh" # Interactive (gum confirm)
5-run_logged "$ARCHUP_INSTALL/preflight/detect-environment.sh" # Non-interactive5+source "$ARCHUP_INSTALL/preflight/detect-environment.sh" # Exports ARCHUP_KEYMAP
6-source "$ARCHUP_INSTALL/preflight/begin.sh" # Interactive (gum confirm)6+source "$ARCHUP_INSTALL/preflight/begin.sh" # Interactive (gum confirm) + exports ARCHUP_BOOTLOADER, ARCHUP_ENCRYPTION
M install/preflight/begin.sh +46 -4
@@ -1,9 +1,9 @@
11 #!/bin/bash
2-# Begin archup installation
2+# Begin ArchUp installation
33 # Display welcome message and gather initial configuration choices
44
55 # Display welcome message
6-gum style --foreground 4 --padding "1 0 1 $PADDING_LEFT" "Welcome to archup!"
6+gum style --foreground 4 --padding "1 0 1 $PADDING_LEFT" "Welcome to ArchUp!"
77 gum style --padding "0 0 0 $PADDING_LEFT" "A fast, minimal Arch Linux auto-installer"
88 echo
99
@@ -14,9 +14,9 @@ if ! gum confirm "Ready to begin installation?" --padding "0 0 1 $PADDING_LEFT";
1414 exit 0
1515 fi
1616
17-# archup uses Limine bootloader exclusively
17+# ArchUp uses Limine bootloader exclusively
1818 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Bootloader: Limine"
19-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"
2020
2121 export ARCHUP_BOOTLOADER="limine"
2222 echo "Bootloader: limine" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -35,5 +35,47 @@ else
3535 echo "Encryption: disabled" >> "$ARCHUP_INSTALL_LOG_FILE"
3636 fi
3737
38+# Ask for user credentials (will be used for user account, root, and encryption)
39+echo
40+gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "User Account"
41+echo
42+
43+# Ask for username
44+ARCHUP_USERNAME=$(gum input --placeholder "Enter username" \
45+ --prompt "Username: " \
46+ --padding "0 0 0 $PADDING_LEFT")
47+
48+if [ -z "$ARCHUP_USERNAME" ]; then
49+ gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "Username cannot be empty!"
50+ exit 1
51+fi
52+
53+# Ask for password (will be used for user, root, and LUKS encryption)
54+while true; do
55+ ARCHUP_PASSWORD=$(gum input --password --placeholder "Enter password" \
56+ --prompt "Password: " \
57+ --padding "0 0 0 $PADDING_LEFT")
58+
59+ ARCHUP_PASSWORD_CONFIRM=$(gum input --password --placeholder "Confirm password" \
60+ --prompt "Confirm: " \
61+ --padding "0 0 0 $PADDING_LEFT")
62+
63+ if [ "$ARCHUP_PASSWORD" = "$ARCHUP_PASSWORD_CONFIRM" ]; then
64+ break
65+ else
66+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "Passwords do not match. Try again."
67+ fi
68+done
69+
70+export ARCHUP_USERNAME
71+export ARCHUP_PASSWORD
72+
73+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] User: $ARCHUP_USERNAME"
74+echo "User: $ARCHUP_USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE"
75+
76+if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
77+ gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "Note: This password will also be used for disk encryption"
78+fi
79+
3880 gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Configuration saved"
3981 echo "Configuration saved" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -1,9 +1,9 @@
1 #!/bin/bash1 #!/bin/bash
2-# Begin archup installation2+# Begin ArchUp installation
3 # Display welcome message and gather initial configuration choices3 # Display welcome message and gather initial configuration choices
4 4
5 # Display welcome message5 # Display welcome message
6-gum style --foreground 4 --padding "1 0 1 $PADDING_LEFT" "Welcome to archup!"6+gum style --foreground 4 --padding "1 0 1 $PADDING_LEFT" "Welcome to ArchUp!"
7 gum style --padding "0 0 0 $PADDING_LEFT" "A fast, minimal Arch Linux auto-installer"7 gum style --padding "0 0 0 $PADDING_LEFT" "A fast, minimal Arch Linux auto-installer"
8 echo8 echo
9 9
@@ -14,9 +14,9 @@ if ! gum confirm "Ready to begin installation?" --padding "0 0 1 $PADDING_LEFT";
14 exit 014 exit 0
15 fi15 fi
16 16
17-# archup uses Limine bootloader exclusively17+# ArchUp uses Limine bootloader exclusively
18 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Bootloader: Limine"18 gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Bootloader: Limine"
19-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"
20 20
21 export ARCHUP_BOOTLOADER="limine"21 export ARCHUP_BOOTLOADER="limine"
22 echo "Bootloader: limine" >> "$ARCHUP_INSTALL_LOG_FILE"22 echo "Bootloader: limine" >> "$ARCHUP_INSTALL_LOG_FILE"
@@ -35,5 +35,47 @@ else
35 echo "Encryption: disabled" >> "$ARCHUP_INSTALL_LOG_FILE"35 echo "Encryption: disabled" >> "$ARCHUP_INSTALL_LOG_FILE"
36 fi36 fi
37 37
38+# Ask for user credentials (will be used for user account, root, and encryption)
39+echo
40+gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "User Account"
41+echo
42+
43+# Ask for username
44+ARCHUP_USERNAME=$(gum input --placeholder "Enter username" \
45+ --prompt "Username: " \
46+ --padding "0 0 0 $PADDING_LEFT")
47+
48+if [ -z "$ARCHUP_USERNAME" ]; then
49+ gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "Username cannot be empty!"
50+ exit 1
51+fi
52+
53+# Ask for password (will be used for user, root, and LUKS encryption)
54+while true; do
55+ ARCHUP_PASSWORD=$(gum input --password --placeholder "Enter password" \
56+ --prompt "Password: " \
57+ --padding "0 0 0 $PADDING_LEFT")
58+
59+ ARCHUP_PASSWORD_CONFIRM=$(gum input --password --placeholder "Confirm password" \
60+ --prompt "Confirm: " \
61+ --padding "0 0 0 $PADDING_LEFT")
62+
63+ if [ "$ARCHUP_PASSWORD" = "$ARCHUP_PASSWORD_CONFIRM" ]; then
64+ break
65+ else
66+ gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "Passwords do not match. Try again."
67+ fi
68+done
69+
70+export ARCHUP_USERNAME
71+export ARCHUP_PASSWORD
72+
73+gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] User: $ARCHUP_USERNAME"
74+echo "User: $ARCHUP_USERNAME" >> "$ARCHUP_INSTALL_LOG_FILE"
75+
76+if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then
77+ gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "Note: This password will also be used for disk encryption"
78+fi
79+
38 gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Configuration saved"80 gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Configuration saved"
39 echo "Configuration saved" >> "$ARCHUP_INSTALL_LOG_FILE"81 echo "Configuration saved" >> "$ARCHUP_INSTALL_LOG_FILE"
M install/preflight/detect-environment.sh +9 -9
@@ -16,14 +16,14 @@ if [ -z "$DETECTED_KEYMAP" ] && [ -f /etc/vconsole.conf ]; then
1616 DETECTED_KEYMAP=$(grep "^KEYMAP=" /etc/vconsole.conf | cut -d'=' -f2)
1717 fi
1818
19-# Default to us if nothing detected
20-if [ -z "$DETECTED_KEYMAP" ]; then
19+# Default to us if nothing detected or if set to "(unset)"
20+if [ -z "$DETECTED_KEYMAP" ] || [ "$DETECTED_KEYMAP" = "(unset)" ]; then
2121 DETECTED_KEYMAP="us"
2222 fi
2323
2424 export ARCHUP_KEYMAP="$DETECTED_KEYMAP"
2525 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Keyboard layout: $ARCHUP_KEYMAP"
26-echo "Keyboard layout detected: $ARCHUP_KEYMAP"
26+echo "Keyboard layout detected: $ARCHUP_KEYMAP" >> "$ARCHUP_INSTALL_LOG_FILE"
2727
2828 # Check for network connectivity
2929 # First check if we have an active ethernet connection
@@ -31,7 +31,7 @@ HAS_ETHERNET=false
3131 if ip link show | grep -E "^[0-9]+: (eth|enp|eno)" | grep -q "state UP"; then
3232 HAS_ETHERNET=true
3333 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Ethernet connection detected"
34- echo "Network: Ethernet connected"
34+ echo "Network: Ethernet connected" >> "$ARCHUP_INSTALL_LOG_FILE"
3535 fi
3636
3737 # Only check for WiFi if no ethernet connection is available
@@ -53,7 +53,7 @@ if [ "$HAS_ETHERNET" = false ] && command -v iwctl >/dev/null 2>&1; then
5353
5454 if [ -f "$IWD_CONFIG" ]; then
5555 # Extract passphrase from iwd config (stored in [Security] section as PreSharedKey)
56- WIFI_PASSPHRASE=$(grep "^PreSharedKey=" "$IWD_CONFIG" | cut -d'=' -f2)
56+ WIFI_PASSPHRASE=$(grep "^PreSharedKey=" "$IWD_CONFIG" | cut -d'=' -f2 || true)
5757 fi
5858
5959 export ARCHUP_WIFI_SSID="$WIFI_SSID"
@@ -61,18 +61,18 @@ if [ "$HAS_ETHERNET" = false ] && command -v iwctl >/dev/null 2>&1; then
6161 export ARCHUP_WIFI_PASSPHRASE="$WIFI_PASSPHRASE"
6262
6363 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"
64+ echo "WiFi detected: SSID=$WIFI_SSID, device=$WIFI_DEVICE" >> "$ARCHUP_INSTALL_LOG_FILE"
6565 else
6666 gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No active WiFi connection detected"
67- echo "WiFi: not connected"
67+ echo "WiFi: not connected" >> "$ARCHUP_INSTALL_LOG_FILE"
6868 fi
6969 else
7070 gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No WiFi device found"
71- echo "WiFi: no device"
71+ echo "WiFi: no device" >> "$ARCHUP_INSTALL_LOG_FILE"
7272 fi
7373 elif [ "$HAS_ETHERNET" = false ]; then
7474 gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] iwd not available"
75- echo "WiFi: iwd not available"
75+ echo "WiFi: iwd not available" >> "$ARCHUP_INSTALL_LOG_FILE"
7676 fi
7777
7878 echo
@@ -16,14 +16,14 @@ if [ -z "$DETECTED_KEYMAP" ] && [ -f /etc/vconsole.conf ]; then
16 DETECTED_KEYMAP=$(grep "^KEYMAP=" /etc/vconsole.conf | cut -d'=' -f2)16 DETECTED_KEYMAP=$(grep "^KEYMAP=" /etc/vconsole.conf | cut -d'=' -f2)
17 fi17 fi
18 18
19-# Default to us if nothing detected19+# Default to us if nothing detected or if set to "(unset)"
20-if [ -z "$DETECTED_KEYMAP" ]; then20+if [ -z "$DETECTED_KEYMAP" ] || [ "$DETECTED_KEYMAP" = "(unset)" ]; then
21 DETECTED_KEYMAP="us"21 DETECTED_KEYMAP="us"
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" "[OK] 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"26+echo "Keyboard layout detected: $ARCHUP_KEYMAP" >> "$ARCHUP_INSTALL_LOG_FILE"
27 27
28 # Check for network connectivity28 # Check for network connectivity
29 # First check if we have an active ethernet connection29 # First check if we have an active ethernet connection
@@ -31,7 +31,7 @@ HAS_ETHERNET=false
31 if ip link show | grep -E "^[0-9]+: (eth|enp|eno)" | grep -q "state UP"; then31 if ip link show | grep -E "^[0-9]+: (eth|enp|eno)" | grep -q "state UP"; then
32 HAS_ETHERNET=true32 HAS_ETHERNET=true
33 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Ethernet connection detected"33 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Ethernet connection detected"
34- echo "Network: Ethernet connected"34+ echo "Network: Ethernet connected" >> "$ARCHUP_INSTALL_LOG_FILE"
35 fi35 fi
36 36
37 # Only check for WiFi if no ethernet connection is available37 # Only check for WiFi if no ethernet connection is available
@@ -53,7 +53,7 @@ if [ "$HAS_ETHERNET" = false ] && command -v iwctl >/dev/null 2>&1; then
53 53
54 if [ -f "$IWD_CONFIG" ]; then54 if [ -f "$IWD_CONFIG" ]; then
55 # Extract passphrase from iwd config (stored in [Security] section as PreSharedKey)55 # Extract passphrase from iwd config (stored in [Security] section as PreSharedKey)
56- WIFI_PASSPHRASE=$(grep "^PreSharedKey=" "$IWD_CONFIG" | cut -d'=' -f2)56+ WIFI_PASSPHRASE=$(grep "^PreSharedKey=" "$IWD_CONFIG" | cut -d'=' -f2 || true)
57 fi57 fi
58 58
59 export ARCHUP_WIFI_SSID="$WIFI_SSID"59 export ARCHUP_WIFI_SSID="$WIFI_SSID"
@@ -61,18 +61,18 @@ if [ "$HAS_ETHERNET" = false ] && command -v iwctl >/dev/null 2>&1; then
61 export ARCHUP_WIFI_PASSPHRASE="$WIFI_PASSPHRASE"61 export ARCHUP_WIFI_PASSPHRASE="$WIFI_PASSPHRASE"
62 62
63 gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] 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)"
64- echo "WiFi detected: SSID=$WIFI_SSID, device=$WIFI_DEVICE"64+ echo "WiFi detected: SSID=$WIFI_SSID, device=$WIFI_DEVICE" >> "$ARCHUP_INSTALL_LOG_FILE"
65 else65 else
66 gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No active WiFi connection detected"66 gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No active WiFi connection detected"
67- echo "WiFi: not connected"67+ echo "WiFi: not connected" >> "$ARCHUP_INSTALL_LOG_FILE"
68 fi68 fi
69 else69 else
70 gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No WiFi device found"70 gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] No WiFi device found"
71- echo "WiFi: no device"71+ echo "WiFi: no device" >> "$ARCHUP_INSTALL_LOG_FILE"
72 fi72 fi
73 elif [ "$HAS_ETHERNET" = false ]; then73 elif [ "$HAS_ETHERNET" = false ]; then
74 gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] iwd not available"74 gum style --foreground 3 --padding "0 0 0 $PADDING_LEFT" "[SKIP] iwd not available"
75- echo "WiFi: iwd not available"75+ echo "WiFi: iwd not available" >> "$ARCHUP_INSTALL_LOG_FILE"
76 fi76 fi
77 77
78 echo78 echo
M install/preflight/guards.sh +3 -3
@@ -1,11 +1,11 @@
11 #!/bin/bash
2-# Preflight guards for archup installer
2+# Preflight guards for ArchUp installer
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"
8+ echo "Preflight check failed: $1" >> "$ARCHUP_INSTALL_LOG_FILE"
99 gum confirm "Proceed anyway on your own accord and without assistance?" --padding "0 0 0 $PADDING_LEFT" || exit 1
1010 }
1111
@@ -1,11 +1,11 @@
1 #!/bin/bash1 #!/bin/bash
2-# Preflight guards for archup installer2+# Preflight guards for ArchUp installer
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+ 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 19 gum confirm "Proceed anyway on your own accord and without assistance?" --padding "0 0 0 $PADDING_LEFT" || exit 1
10 }10 }
11 11
M install/repos/all.sh +2 -0
@@ -1,5 +1,7 @@
11 #!/bin/bash
22 # Repository setup phase
33
4+stop_log_output # Stop for interactive prompts
45 source "$ARCHUP_INSTALL/repos/yay.sh" # Interactive (gum confirm)
56 source "$ARCHUP_INSTALL/repos/chaotic.sh" # Interactive (gum confirm)
7+start_log_output # Resume (will be stopped by stop_install_log)
@@ -1,5 +1,7 @@
1 #!/bin/bash1 #!/bin/bash
2 # Repository setup phase2 # Repository setup phase
3 3
4+stop_log_output # Stop for interactive prompts
4 source "$ARCHUP_INSTALL/repos/yay.sh" # Interactive (gum confirm)5 source "$ARCHUP_INSTALL/repos/yay.sh" # Interactive (gum confirm)
5 source "$ARCHUP_INSTALL/repos/chaotic.sh" # Interactive (gum confirm)6 source "$ARCHUP_INSTALL/repos/chaotic.sh" # Interactive (gum confirm)
7+start_log_output # Resume (will be stopped by stop_install_log)
M install/repos/chaotic.sh +6 -6
@@ -18,13 +18,13 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Adding Chaotic-AUR rep
1818 gum style --padding "0 0 1 $PADDING_LEFT" "Installing keyring and mirrorlist..."
1919
2020 # Install Chaotic-AUR keyring and mirrorlist
21-arch-chroot /mnt pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
22-arch-chroot /mnt pacman-key --lsign-key 3056513887B78AEB
21+arch-chroot /mnt pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
22+arch-chroot /mnt pacman-key --lsign-key 3056513887B78AEB >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
2323
2424 # Install chaotic-keyring and chaotic-mirrorlist
2525 arch-chroot /mnt pacman -U --noconfirm \
2626 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' \
27- 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
27+ 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
2828
2929 # Add Chaotic-AUR to pacman.conf
3030 if ! grep -q "\[chaotic-aur\]" /mnt/etc/pacman.conf; then
@@ -39,15 +39,15 @@ EOF
3939 fi
4040
4141 # Update package databases
42-arch-chroot /mnt pacman -Sy
42+arch-chroot /mnt pacman -Sy >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
4343
4444 # Verify Chaotic-AUR is working
4545 if arch-chroot /mnt pacman -Sl chaotic-aur >/dev/null 2>&1; then
4646 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)"
47+ echo "Chaotic-AUR: enabled (repo added to pacman.conf)" >> "$ARCHUP_INSTALL_LOG_FILE"
4848 else
4949 gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Chaotic-AUR verification failed"
50- echo "WARNING: Chaotic-AUR verification failed"
50+ echo "WARNING: Chaotic-AUR verification failed" >> "$ARCHUP_INSTALL_LOG_FILE"
5151 export ARCHUP_CHAOTIC="failed"
5252 return 1
5353 fi
@@ -18,13 +18,13 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Adding Chaotic-AUR rep
18 gum style --padding "0 0 1 $PADDING_LEFT" "Installing keyring and mirrorlist..."18 gum style --padding "0 0 1 $PADDING_LEFT" "Installing keyring and mirrorlist..."
19 19
20 # Install Chaotic-AUR keyring and mirrorlist20 # Install Chaotic-AUR keyring and mirrorlist
21-arch-chroot /mnt pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com21+arch-chroot /mnt pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
22-arch-chroot /mnt pacman-key --lsign-key 3056513887B78AEB22+arch-chroot /mnt pacman-key --lsign-key 3056513887B78AEB >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
23 23
24 # Install chaotic-keyring and chaotic-mirrorlist24 # Install chaotic-keyring and chaotic-mirrorlist
25 arch-chroot /mnt pacman -U --noconfirm \25 arch-chroot /mnt pacman -U --noconfirm \
26 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' \26 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' \
27- 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'27+ 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
28 28
29 # Add Chaotic-AUR to pacman.conf29 # Add Chaotic-AUR to pacman.conf
30 if ! grep -q "\[chaotic-aur\]" /mnt/etc/pacman.conf; then30 if ! grep -q "\[chaotic-aur\]" /mnt/etc/pacman.conf; then
@@ -39,15 +39,15 @@ EOF
39 fi39 fi
40 40
41 # Update package databases41 # Update package databases
42-arch-chroot /mnt pacman -Sy42+arch-chroot /mnt pacman -Sy >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
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" "[OK] 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)"47+ echo "Chaotic-AUR: enabled (repo added to pacman.conf)" >> "$ARCHUP_INSTALL_LOG_FILE"
48 else48 else
49 gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] 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"50+ echo "WARNING: Chaotic-AUR verification failed" >> "$ARCHUP_INSTALL_LOG_FILE"
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
@@ -7,7 +7,7 @@ echo
77 # Ask if user wants AUR support
88 if ! gum confirm "Enable AUR support (install yay)?" --padding "0 0 1 $PADDING_LEFT"; then
99 gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping AUR support"
10- echo "AUR: disabled"
10+ echo "AUR: disabled" >> "$ARCHUP_INSTALL_LOG_FILE"
1111 export ARCHUP_AUR="disabled"
1212 return 0
1313 fi
@@ -18,34 +18,34 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing yay AUR hel
1818 gum style --padding "0 0 1 $PADDING_LEFT" "This may take a few minutes..."
1919
2020 # Install base-devel if not already installed (required for building AUR packages)
21-arch-chroot /mnt pacman -S --noconfirm --needed base-devel git
21+arch-chroot /mnt pacman -S --noconfirm --needed base-devel git >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
2222
2323 # Get the username created during installation
2424 USERNAME=$(arch-chroot /mnt ls /home | head -1)
2525
2626 if [ -z "$USERNAME" ]; then
2727 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"
28+ echo "ERROR: No user found for yay installation" >> "$ARCHUP_INSTALL_LOG_FILE"
2929 export ARCHUP_AUR="failed"
3030 return 1
3131 fi
3232
3333 # Clone yay-bin from AUR as the user (not root)
34-arch-chroot /mnt su - "$USERNAME" -c "cd /tmp && git clone https://aur.archlinux.org/yay-bin.git"
34+arch-chroot /mnt su - "$USERNAME" -c "cd /tmp && git clone https://aur.archlinux.org/yay-bin.git" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true
3535
3636 # Build and install yay as the user
37-arch-chroot /mnt su - "$USERNAME" -c "cd /tmp/yay-bin && makepkg -si --noconfirm"
37+arch-chroot /mnt su - "$USERNAME" -c "cd /tmp/yay-bin && makepkg -si --noconfirm" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true
3838
3939 # Clean up
40-arch-chroot /mnt rm -rf /tmp/yay-bin
40+arch-chroot /mnt rm -rf /tmp/yay-bin >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
4141
4242 # Verify installation
4343 if arch-chroot /mnt su - "$USERNAME" -c "yay --version" >/dev/null 2>&1; then
4444 gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] yay installed successfully"
45- echo "AUR: enabled (yay installed for user: $USERNAME)"
45+ echo "AUR: enabled (yay installed for user: $USERNAME)" >> "$ARCHUP_INSTALL_LOG_FILE"
4646 else
4747 gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay installation failed"
48- echo "ERROR: yay installation failed"
48+ echo "ERROR: yay installation failed" >> "$ARCHUP_INSTALL_LOG_FILE"
4949 export ARCHUP_AUR="failed"
5050 return 1
5151 fi
@@ -7,7 +7,7 @@ echo
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" "[SKIP] Skipping AUR support"9 gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[SKIP] Skipping AUR support"
10- echo "AUR: disabled"10+ echo "AUR: disabled" >> "$ARCHUP_INSTALL_LOG_FILE"
11 export ARCHUP_AUR="disabled"11 export ARCHUP_AUR="disabled"
12 return 012 return 0
13 fi13 fi
@@ -18,34 +18,34 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing yay AUR hel
18 gum style --padding "0 0 1 $PADDING_LEFT" "This may take a few minutes..."18 gum style --padding "0 0 1 $PADDING_LEFT" "This may take a few minutes..."
19 19
20 # Install base-devel if not already installed (required for building AUR packages)20 # Install base-devel if not already installed (required for building AUR packages)
21-arch-chroot /mnt pacman -S --noconfirm --needed base-devel git21+arch-chroot /mnt pacman -S --noconfirm --needed base-devel git >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
22 22
23 # Get the username created during installation23 # Get the username created during installation
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] 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"28+ echo "ERROR: No user found for yay installation" >> "$ARCHUP_INSTALL_LOG_FILE"
29 export ARCHUP_AUR="failed"29 export ARCHUP_AUR="failed"
30 return 130 return 1
31 fi31 fi
32 32
33 # Clone yay-bin from AUR as the user (not root)33 # Clone yay-bin from AUR as the user (not root)
34-arch-chroot /mnt su - "$USERNAME" -c "cd /tmp && git clone https://aur.archlinux.org/yay-bin.git"34+arch-chroot /mnt su - "$USERNAME" -c "cd /tmp && git clone https://aur.archlinux.org/yay-bin.git" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true
35 35
36 # Build and install yay as the user36 # Build and install yay as the user
37-arch-chroot /mnt su - "$USERNAME" -c "cd /tmp/yay-bin && makepkg -si --noconfirm"37+arch-chroot /mnt su - "$USERNAME" -c "cd /tmp/yay-bin && makepkg -si --noconfirm" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true
38 38
39 # Clean up39 # Clean up
40-arch-chroot /mnt rm -rf /tmp/yay-bin40+arch-chroot /mnt rm -rf /tmp/yay-bin >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1
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" "[OK] 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)"45+ echo "AUR: enabled (yay installed for user: $USERNAME)" >> "$ARCHUP_INSTALL_LOG_FILE"
46 else46 else
47 gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay installation failed"47 gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] yay installation failed"
48- echo "ERROR: yay installation failed"48+ echo "ERROR: yay installation failed" >> "$ARCHUP_INSTALL_LOG_FILE"
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