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 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # archup - Fast, minimal Arch Linux auto-installer | |
| 2 | + | # ArchUp - Fast, minimal Arch Linux auto-installer | |
| 3 | 3 | # Main installation orchestrator | |
| 4 | 4 | ||
| 5 | 5 | set -eo pipefail | |
| @@ -13,7 +13,7 @@ export ARCHUP_RAW_URL="${ARCHUP_RAW_URL:-https://raw.githubusercontent.com/bnema | |||
| 13 | 13 | ||
| 14 | 14 | # Download installer files if not present (for curl-based installation) | |
| 15 | 15 | if [ ! -d "$ARCHUP_INSTALL" ]; then | |
| 16 | - | echo "=== Downloading archup installer files ===" | |
| 16 | + | echo "=== Downloading ArchUp installer files ===" | |
| 17 | 17 | mkdir -p "$ARCHUP_INSTALL" | |
| 18 | 18 | ||
| 19 | 19 | # Download all required files using curl | |
| @@ -81,13 +81,16 @@ clear_logo | |||
| 81 | 81 | # 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 | 88 | source "$ARCHUP_INSTALL/preflight/all.sh" | |
| 86 | 89 | ||
| 87 | - | # Start log monitor AFTER all interactive prompts | |
| 90 | + | # Start log monitor ONCE - it will run continuously during all work phases | |
| 88 | 91 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing..." | |
| 89 | 92 | echo | |
| 90 | - | start_install_log | |
| 93 | + | start_log_output | |
| 91 | 94 | ||
| 92 | 95 | # Partitioning (auto GPT, ext4, no encryption) | |
| 93 | 96 | source "$ARCHUP_INSTALL/partitioning/all.sh" | |
| @@ -1,5 +1,5 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # archup - Fast, minimal Arch Linux auto-installer | 2 | + | # ArchUp - Fast, minimal Arch Linux auto-installer |
| 3 | # Main installation orchestrator | 3 | # Main installation orchestrator | ||
| 4 | 4 | ||||
| 5 | set -eo pipefail | 5 | 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" ]; then | 15 | 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 curl | 19 | # Download all required files using curl | ||
| @@ -81,13 +81,16 @@ clear_logo | |||||
| 81 | # PHASE 1: BAREBONE INSTALLER - BASIC | 81 | # 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 prompts | 90 | + | # 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 | echo | 92 | echo | ||
| 90 | - | start_install_log | 93 | + | 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 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | # Base installation phase | |
| 3 | 3 | ||
| 4 | + | stop_log_output # Stop for interactive prompt | |
| 4 | 5 | source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose) | |
| 6 | + | start_log_output # Resume after prompt | |
| 7 | + | ||
| 5 | 8 | run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive | |
| 6 | 9 | run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive | |
| @@ -1,6 +1,9 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | # Base installation phase | 2 | # 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-interactive | 8 | run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive | ||
| 6 | run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive | 9 | 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 | |||
| 8 | 8 | ||
| 9 | 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" | |
| @@ -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 | |||
| 15 | 15 | 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 | 17 | # Regenerate initramfs | |
| 18 | - | arch-chroot /mnt mkinitcpio -P | |
| 18 | + | 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 | 22 | # Kernel parameters for encrypted boot | |
| 23 | 23 | KERNEL_PARAMS="cryptdevice=UUID=$ROOT_UUID:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw" | |
| @@ -30,23 +30,23 @@ fi | |||
| 30 | 30 | # Add AMD-specific kernel parameters if configured | |
| 31 | 31 | if [ -n "$ARCHUP_AMD_KERNEL_PARAMS" ]; then | |
| 32 | 32 | KERNEL_PARAMS="$KERNEL_PARAMS $ARCHUP_AMD_KERNEL_PARAMS" | |
| 33 | - | echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" | |
| 33 | + | echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 34 | 34 | fi | |
| 35 | 35 | ||
| 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 | |
| 38 | 38 | ||
| 39 | 39 | # Create Limine configuration directory | |
| 40 | 40 | mkdir -p /mnt/boot/EFI/BOOT | |
| 41 | 41 | ||
| 42 | 42 | # Create Limine configuration with proper syntax | |
| 43 | 43 | cat > /mnt/boot/EFI/BOOT/limine.conf <<EOF | |
| 44 | - | # archup - Limine bootloader configuration | |
| 44 | + | # ArchUp - Limine bootloader configuration | |
| 45 | 45 | # Docs: https://github.com/limine-bootloader/limine/blob/trunk/CONFIG.md | |
| 46 | 46 | ||
| 47 | 47 | timeout: 5 | |
| 48 | 48 | default_entry: 0 | |
| 49 | - | interface_branding: archup | |
| 49 | + | interface_branding: ArchUp | |
| 50 | 50 | interface_branding_colour: 6 | |
| 51 | 51 | graphics: yes | |
| 52 | 52 | quiet: yes | |
| @@ -79,13 +79,13 @@ EFI_PART_NUM=$(echo "$ARCHUP_EFI_PART" | grep -o '[0-9]*$' | sed 's/^p//') | |||
| 79 | 79 | arch-chroot /mnt efibootmgr --create \ | |
| 80 | 80 | --disk "$ARCHUP_DISK" \ | |
| 81 | 81 | --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 | |
| 84 | 84 | ||
| 85 | 85 | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Limine installed and configured" | |
| 86 | 86 | ||
| 87 | 87 | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |
| 88 | - | echo "Installed Limine with encrypted root (UUID: $ROOT_UUID)" | |
| 88 | + | echo "Installed Limine with encrypted root (UUID: $ROOT_UUID)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 89 | 89 | else | |
| 90 | - | echo "Installed Limine with root UUID: $ROOT_UUID" | |
| 90 | + | echo "Installed Limine with root UUID: $ROOT_UUID" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 91 | 91 | 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.conf | 15 | 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 initramfs | 17 | # Regenerate initramfs | ||
| 18 | - | arch-chroot /mnt mkinitcpio -P | 18 | + | 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 boot | 22 | # Kernel parameters for encrypted boot | ||
| 23 | KERNEL_PARAMS="cryptdevice=UUID=$ROOT_UUID:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw" | 23 | KERNEL_PARAMS="cryptdevice=UUID=$ROOT_UUID:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw" | ||
| @@ -30,23 +30,23 @@ fi | |||||
| 30 | # Add AMD-specific kernel parameters if configured | 30 | # Add AMD-specific kernel parameters if configured | ||
| 31 | if [ -n "$ARCHUP_AMD_KERNEL_PARAMS" ]; then | 31 | if [ -n "$ARCHUP_AMD_KERNEL_PARAMS" ]; then | ||
| 32 | KERNEL_PARAMS="$KERNEL_PARAMS $ARCHUP_AMD_KERNEL_PARAMS" | 32 | KERNEL_PARAMS="$KERNEL_PARAMS $ARCHUP_AMD_KERNEL_PARAMS" | ||
| 33 | - | echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" | 33 | + | echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 34 | fi | 34 | 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 directory | 39 | # Create Limine configuration directory | ||
| 40 | mkdir -p /mnt/boot/EFI/BOOT | 40 | mkdir -p /mnt/boot/EFI/BOOT | ||
| 41 | 41 | ||||
| 42 | # Create Limine configuration with proper syntax | 42 | # Create Limine configuration with proper syntax | ||
| 43 | cat > /mnt/boot/EFI/BOOT/limine.conf <<EOF | 43 | cat > /mnt/boot/EFI/BOOT/limine.conf <<EOF | ||
| 44 | - | # archup - Limine bootloader configuration | 44 | + | # ArchUp - Limine bootloader configuration |
| 45 | # Docs: https://github.com/limine-bootloader/limine/blob/trunk/CONFIG.md | 45 | # Docs: https://github.com/limine-bootloader/limine/blob/trunk/CONFIG.md | ||
| 46 | 46 | ||||
| 47 | timeout: 5 | 47 | timeout: 5 | ||
| 48 | default_entry: 0 | 48 | default_entry: 0 | ||
| 49 | - | interface_branding: archup | 49 | + | interface_branding: ArchUp |
| 50 | interface_branding_colour: 6 | 50 | interface_branding_colour: 6 | ||
| 51 | graphics: yes | 51 | graphics: yes | ||
| 52 | quiet: yes | 52 | 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" ]; then | 87 | 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 | else | 89 | else | ||
| 90 | - | echo "Installed Limine with root UUID: $ROOT_UUID" | 90 | + | echo "Installed Limine with root UUID: $ROOT_UUID" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 91 | fi | 91 | fi | ||
M install/bootstrap.sh +21 -0
| @@ -5,6 +5,27 @@ | |||
| 5 | 5 | ||
| 6 | 6 | 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 | 29 | # Clean up old log file to ensure fresh logs for this attempt | |
| 9 | 30 | if [ -f "$ARCHUP_INSTALL_LOG_FILE" ]; then | |
| 10 | 31 | rm -f "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -5,6 +5,27 @@ | |||||
| 5 | 5 | ||||
| 6 | set -e | 6 | 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 attempt | 29 | # Clean up old log file to ensure fresh logs for this attempt | ||
| 9 | if [ -f "$ARCHUP_INSTALL_LOG_FILE" ]; then | 30 | 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 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | # Configuration phase | |
| 3 | 3 | ||
| 4 | + | stop_log_output # Stop for interactive prompts | |
| 4 | 5 | source "$ARCHUP_INSTALL/config/system.sh" # Interactive (gum input) | |
| 5 | 6 | source "$ARCHUP_INSTALL/config/user.sh" # Interactive (gum input) | |
| 7 | + | start_log_output # Resume after prompts | |
| 8 | + | ||
| 6 | 9 | run_logged "$ARCHUP_INSTALL/config/network.sh" # Non-interactive | |
| @@ -1,6 +1,9 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | # Configuration phase | 2 | # 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-interactive | 9 | run_logged "$ARCHUP_INSTALL/config/network.sh" # Non-interactive | ||
M install/config/network.sh +3 -3
| @@ -23,11 +23,11 @@ DHCP=yes | |||
| 23 | 23 | EOF | |
| 24 | 24 | ||
| 25 | 25 | # 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 | |
| 28 | 28 | ||
| 29 | 29 | # Enable iwd for WiFi | |
| 30 | - | arch-chroot /mnt systemctl enable iwd | |
| 30 | + | arch-chroot /mnt systemctl enable iwd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 31 | 31 | ||
| 32 | 32 | # Migrate WiFi credentials from ISO if detected | |
| 33 | 33 | if [ -n "$ARCHUP_WIFI_SSID" ] && [ -n "$ARCHUP_WIFI_PASSPHRASE" ]; then | |
| @@ -23,11 +23,11 @@ DHCP=yes | |||||
| 23 | EOF | 23 | EOF | ||
| 24 | 24 | ||||
| 25 | # Enable services | 25 | # Enable services | ||
| 26 | - | arch-chroot /mnt systemctl enable systemd-networkd | 26 | + | arch-chroot /mnt systemctl enable systemd-networkd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 |
| 27 | - | arch-chroot /mnt systemctl enable systemd-resolved | 27 | + | arch-chroot /mnt systemctl enable systemd-resolved >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 |
| 28 | 28 | ||||
| 29 | # Enable iwd for WiFi | 29 | # Enable iwd for WiFi | ||
| 30 | - | arch-chroot /mnt systemctl enable iwd | 30 | + | arch-chroot /mnt systemctl enable iwd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 |
| 31 | 31 | ||||
| 32 | # Migrate WiFi credentials from ISO if detected | 32 | # Migrate WiFi credentials from ISO if detected | ||
| 33 | if [ -n "$ARCHUP_WIFI_SSID" ] && [ -n "$ARCHUP_WIFI_PASSPHRASE" ]; then | 33 | 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 | |||
| 14 | 14 | fi | |
| 15 | 15 | ||
| 16 | 16 | # 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 | |
| 19 | 19 | ||
| 20 | 20 | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] Timezone set to: $ARCHUP_TIMEZONE" | |
| 21 | 21 | ||
| 22 | 22 | # Set locale to en_US.UTF-8 | |
| 23 | 23 | echo "en_US.UTF-8 UTF-8" > /mnt/etc/locale.gen | |
| 24 | - | arch-chroot /mnt locale-gen | |
| 24 | + | arch-chroot /mnt locale-gen >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 25 | 25 | echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf | |
| 26 | 26 | ||
| 27 | 27 | 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 | fi | 14 | fi | ||
| 15 | 15 | ||||
| 16 | # Set timezone | 16 | # Set timezone | ||
| 17 | - | arch-chroot /mnt ln -sf "/usr/share/zoneinfo/$ARCHUP_TIMEZONE" /etc/localtime | 17 | + | arch-chroot /mnt ln -sf "/usr/share/zoneinfo/$ARCHUP_TIMEZONE" /etc/localtime >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 |
| 18 | - | arch-chroot /mnt hwclock --systohc | 18 | + | 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-8 | 22 | # Set locale to en_US.UTF-8 | ||
| 23 | echo "en_US.UTF-8 UTF-8" > /mnt/etc/locale.gen | 23 | echo "en_US.UTF-8 UTF-8" > /mnt/etc/locale.gen | ||
| 24 | - | arch-chroot /mnt locale-gen | 24 | + | arch-chroot /mnt locale-gen >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 |
| 25 | echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf | 25 | echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf | ||
| 26 | 26 | ||||
| 27 | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[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 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # User creation and configuration | |
| 2 | + | # User creation and configuration (uses credentials from preflight) | |
| 3 | 3 | ||
| 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..." | |
| 6 | 5 | ||
| 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 | |
| 35 | 8 | ||
| 36 | 9 | # 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 | 12 | # 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 | |
| 41 | 14 | ||
| 42 | 15 | # Enable sudo for wheel group | |
| 43 | 16 | 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 | |
| 45 | 18 | ||
| 46 | 19 | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] User created: $ARCHUP_USERNAME" | |
| 47 | 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" | |
| 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/bash | 1 | #!/bin/bash | ||
| 2 | - | # User creation and configuration | 2 | + | # 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 username | 6 | + | # 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 directory | 9 | # 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 password | 12 | # 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 |
| 41 | 14 | ||||
| 42 | # Enable sudo for wheel group | 15 | # Enable sudo for wheel group | ||
| 43 | echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/etc/sudoers.d/wheel | 16 | 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 |
| 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 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # Chroot utilities for archup installer | |
| 2 | + | # Chroot utilities for ArchUp installer | |
| 3 | 3 | # Adapted from Omarchy chroot.sh | |
| 4 | 4 | ||
| 5 | 5 | # Starting the installer with ARCHUP_CHROOT_INSTALL=1 will put it into chroot mode | |
| @@ -1,5 +1,5 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # Chroot utilities for archup installer | 2 | + | # Chroot utilities for ArchUp installer |
| 3 | # Adapted from Omarchy chroot.sh | 3 | # Adapted from Omarchy chroot.sh | ||
| 4 | 4 | ||||
| 5 | # Starting the installer with ARCHUP_CHROOT_INSTALL=1 will put it into chroot mode | 5 | # 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 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # Error handling for archup installer - improved with logging and interactivity | |
| 2 | + | # Error handling for ArchUp installer - improved with logging and interactivity | |
| 3 | 3 | ||
| 4 | 4 | # QR code for GitHub issues | |
| 5 | 5 | QR_CODE=' | |
| @@ -117,7 +117,7 @@ catch_errors() { | |||
| 117 | 117 | clear_logo | |
| 118 | 118 | 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 | 121 | show_log_tail | |
| 122 | 122 | ||
| 123 | 123 | echo | |
| @@ -128,7 +128,7 @@ catch_errors() { | |||
| 128 | 128 | gum style "$QR_CODE" | |
| 129 | 129 | echo | |
| 130 | 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 | 132 | echo | |
| 133 | 133 | ||
| 134 | 134 | # Interactive menu | |
| @@ -153,6 +153,26 @@ catch_errors() { | |||
| 153 | 153 | 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 | 176 | # Exit handler | |
| 157 | 177 | exit_handler() { | |
| 158 | 178 | local exit_code=$? | |
| @@ -167,7 +187,8 @@ exit_handler() { | |||
| 167 | 187 | } | |
| 168 | 188 | ||
| 169 | 189 | # Set up traps | |
| 170 | - | trap catch_errors ERR INT TERM | |
| 190 | + | trap catch_errors ERR TERM | |
| 191 | + | trap interrupt_handler INT | |
| 171 | 192 | trap exit_handler EXIT | |
| 172 | 193 | ||
| 173 | 194 | # Save original outputs for restoration | |
| @@ -1,5 +1,5 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # Error handling for archup installer - improved with logging and interactivity | 2 | + | # Error handling for ArchUp installer - improved with logging and interactivity |
| 3 | 3 | ||||
| 4 | # QR code for GitHub issues | 4 | # QR code for GitHub issues | ||
| 5 | QR_CODE=' | 5 | QR_CODE=' | ||
| @@ -117,7 +117,7 @@ catch_errors() { | |||||
| 117 | clear_logo | 117 | clear_logo | ||
| 118 | show_cursor | 118 | 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_tail | 121 | show_log_tail | ||
| 122 | 122 | ||||
| 123 | echo | 123 | echo | ||
| @@ -128,7 +128,7 @@ catch_errors() { | |||||
| 128 | gum style "$QR_CODE" | 128 | gum style "$QR_CODE" | ||
| 129 | echo | 129 | 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 | echo | 132 | echo | ||
| 133 | 133 | ||||
| 134 | # Interactive menu | 134 | # Interactive menu | ||
| @@ -153,6 +153,26 @@ catch_errors() { | |||||
| 153 | done | 153 | 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 handler | 176 | # 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 traps | 189 | # Set up traps | ||
| 170 | - | trap catch_errors ERR INT TERM | 190 | + | trap catch_errors ERR TERM |
| 191 | + | trap interrupt_handler INT | |||
| 171 | trap exit_handler EXIT | 192 | trap exit_handler EXIT | ||
| 172 | 193 | ||||
| 173 | # Save original outputs for restoration | 194 | # Save original outputs for restoration | ||
M install/helpers/logging.sh +8 -5
| @@ -1,5 +1,5 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # Logging system for archup installer - fixes variable export issues | |
| 2 | + | # Logging system for ArchUp installer - fixes variable export issues | |
| 3 | 3 | # Uses background process for log display instead of exec redirection | |
| 4 | 4 | ||
| 5 | 5 | # Global variable for monitor background process | |
| @@ -57,6 +57,9 @@ stop_log_output() { | |||
| 57 | 57 | kill $monitor_pid 2>/dev/null || true | |
| 58 | 58 | wait $monitor_pid 2>/dev/null || true | |
| 59 | 59 | unset monitor_pid | |
| 60 | + | ||
| 61 | + | # Clean up terminal state | |
| 62 | + | printf "\033[?25h" # Show cursor | |
| 60 | 63 | fi | |
| 61 | 64 | } | |
| 62 | 65 | ||
| @@ -65,10 +68,9 @@ start_install_log() { | |||
| 65 | 68 | chmod 666 "$ARCHUP_INSTALL_LOG_FILE" | |
| 66 | 69 | ||
| 67 | 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!) | |
| 71 | - | start_log_output | |
| 73 | + | # Don't start log monitor here - run_logged will handle it dynamically | |
| 72 | 74 | } | |
| 73 | 75 | ||
| 74 | 76 | stop_install_log() { | |
| @@ -78,7 +80,7 @@ stop_install_log() { | |||
| 78 | 80 | if [[ -n ${ARCHUP_INSTALL_LOG_FILE:-} ]]; then | |
| 79 | 81 | ARCHUP_END_TIME=$(date '+%Y-%m-%d %H:%M:%S') | |
| 80 | 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 | 85 | if [ -n "$ARCHUP_START_TIME" ]; then | |
| 84 | 86 | ARCHUP_START_EPOCH=$(date -d "$ARCHUP_START_TIME" +%s) | |
| @@ -101,6 +103,7 @@ run_logged() { | |||
| 101 | 103 | ||
| 102 | 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 | 107 | # Use bash -c to create a clean subshell and redirect output to log | |
| 105 | 108 | bash -c "source '$script'" </dev/null >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 106 | 109 | ||
| @@ -1,5 +1,5 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # Logging system for archup installer - fixes variable export issues | 2 | + | # Logging system for ArchUp installer - fixes variable export issues |
| 3 | # Uses background process for log display instead of exec redirection | 3 | # Uses background process for log display instead of exec redirection | ||
| 4 | 4 | ||||
| 5 | # Global variable for monitor background process | 5 | # Global variable for monitor background process | ||
| @@ -57,6 +57,9 @@ stop_log_output() { | |||||
| 57 | kill $monitor_pid 2>/dev/null || true | 57 | kill $monitor_pid 2>/dev/null || true | ||
| 58 | wait $monitor_pid 2>/dev/null || true | 58 | wait $monitor_pid 2>/dev/null || true | ||
| 59 | unset monitor_pid | 59 | unset monitor_pid | ||
| 60 | + | ||||
| 61 | + | # Clean up terminal state | |||
| 62 | + | printf "\033[?25h" # Show cursor | |||
| 60 | fi | 63 | 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:-} ]]; then | 80 | 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" ]; then | 85 | 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 log | 107 | # 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 | 108 | 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 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # Presentation utilities for archup installer | |
| 2 | + | # Presentation utilities for ArchUp installer | |
| 3 | 3 | # Adapted from Omarchy presentation.sh | |
| 4 | 4 | # NOTE: Requires gum to be installed via bootstrap.sh first! | |
| 5 | 5 | ||
| @@ -1,5 +1,5 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # Presentation utilities for archup installer | 2 | + | # Presentation utilities for ArchUp installer |
| 3 | # Adapted from Omarchy presentation.sh | 3 | # 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 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | # Partitioning phase | |
| 3 | 3 | ||
| 4 | + | stop_log_output # Stop for interactive prompts and partition display | |
| 4 | 5 | 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/bash | 1 | #!/bin/bash | ||
| 2 | # Partitioning phase | 2 | # 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-interactive | 6 | + | 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-interactive | 7 | + | source "$ARCHUP_INSTALL/partitioning/format.sh" # Interactive if encryption enabled + exports ARCHUP_CRYPT_ROOT |
| 7 | - | run_logged "$ARCHUP_INSTALL/partitioning/mount.sh" # Non-interactive | 8 | + | 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 @@ | |||
| 3 | 3 | ||
| 4 | 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 | 13 | # 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 | |
| 8 | 15 | echo "Formatted $ARCHUP_EFI_PART as FAT32" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 9 | 16 | ||
| 10 | 17 | # Handle root partition - with or without encryption | |
| 11 | 18 | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |
| 12 | 19 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Setting up LUKS encryption..." | |
| 13 | 20 | ||
| 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 | |
| 25 | 23 | ||
| 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 \ | |
| 28 | 26 | --type luks2 \ | |
| 27 | + | --batch-mode \ | |
| 29 | 28 | --pbkdf argon2id \ | |
| 30 | 29 | --iter-time 2000 \ | |
| 31 | 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 | 35 | # 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" | |
| 36 | 39 | ||
| 37 | 40 | # Export the mapped device path | |
| 38 | 41 | export ARCHUP_CRYPT_ROOT="/dev/mapper/cryptroot" | |
| 39 | 42 | ||
| 40 | 43 | # 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 | 46 | echo "Created LUKS container on $ARCHUP_ROOT_PART" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 44 | 47 | echo "Formatted $ARCHUP_CRYPT_ROOT as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 45 | 48 | ||
| 46 | 49 | # Mount temporarily to create subvolumes | |
| 47 | - | mount "$ARCHUP_CRYPT_ROOT" /mnt | |
| 50 | + | mount "$ARCHUP_CRYPT_ROOT" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 48 | 51 | ||
| 49 | 52 | else | |
| 50 | 53 | # 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 | 55 | echo "Formatted $ARCHUP_ROOT_PART as btrfs" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 53 | 56 | ||
| 54 | 57 | # Mount temporarily to create subvolumes | |
| 55 | - | mount "$ARCHUP_ROOT_PART" /mnt | |
| 58 | + | mount "$ARCHUP_ROOT_PART" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 56 | 59 | fi | |
| 57 | 60 | ||
| 58 | 61 | # Create btrfs subvolumes | |
| 59 | 62 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating btrfs subvolumes..." | |
| 60 | 63 | ||
| 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 | |
| 63 | 66 | ||
| 64 | 67 | echo "Created btrfs subvolume: @" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 65 | 68 | echo "Created btrfs subvolume: @home" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 66 | 69 | ||
| 67 | 70 | # Unmount temporary mount | |
| 68 | - | umount /mnt | |
| 71 | + | umount /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 69 | 72 | ||
| 70 | 73 | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Partitions formatted and subvolumes created" | |
| 71 | 74 | 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 FAT32 | 13 | # 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 |
| 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 encryption | 17 | # Handle root partition - with or without encryption | ||
| 11 | if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | 18 | 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 password | 21 | + | # Wipe any existing signatures on root partition to avoid conflicts |
| 15 | - | while true; do | 22 | + | 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 time | 24 | + | # 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 container | 35 | # 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" | |||
| 36 | 39 | ||||
| 37 | # Export the mapped device path | 40 | # 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 btrfs | 43 | # 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 subvolumes | 49 | # Mount temporarily to create subvolumes | ||
| 47 | - | mount "$ARCHUP_CRYPT_ROOT" /mnt | 50 | + | mount "$ARCHUP_CRYPT_ROOT" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 |
| 48 | 51 | ||||
| 49 | else | 52 | else | ||
| 50 | # No encryption - format directly with btrfs | 53 | # 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 subvolumes | 57 | # Mount temporarily to create subvolumes | ||
| 55 | - | mount "$ARCHUP_ROOT_PART" /mnt | 58 | + | mount "$ARCHUP_ROOT_PART" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 |
| 56 | fi | 59 | fi | ||
| 57 | 60 | ||||
| 58 | # Create btrfs subvolumes | 61 | # 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/@home | 65 | + | 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 mount | 70 | # Unmount temporary mount | ||
| 68 | - | umount /mnt | 71 | + | 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 | |||
| 11 | 11 | fi | |
| 12 | 12 | ||
| 13 | 13 | # Mount @ subvolume as root with optimal btrfs options | |
| 14 | - | mount -o noatime,compress=zstd,subvol=@ "$MOUNT_DEVICE" /mnt | |
| 14 | + | mount -o noatime,compress=zstd,subvol=@ "$MOUNT_DEVICE" /mnt >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 15 | 15 | ||
| 16 | 16 | echo "Mounted @ subvolume to /mnt" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 17 | 17 | ||
| 18 | 18 | # Create home directory | |
| 19 | - | mkdir -p /mnt/home | |
| 19 | + | mkdir -p /mnt/home >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 20 | 20 | ||
| 21 | 21 | # Mount @home subvolume | |
| 22 | - | mount -o noatime,compress=zstd,subvol=@home "$MOUNT_DEVICE" /mnt/home | |
| 22 | + | mount -o noatime,compress=zstd,subvol=@home "$MOUNT_DEVICE" /mnt/home >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 23 | 23 | ||
| 24 | 24 | echo "Mounted @home subvolume to /mnt/home" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 25 | 25 | ||
| 26 | 26 | # 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 | |
| 29 | 29 | ||
| 30 | 30 | echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 31 | 31 | ||
| @@ -11,21 +11,21 @@ else | |||||
| 11 | fi | 11 | fi | ||
| 12 | 12 | ||||
| 13 | # Mount @ subvolume as root with optimal btrfs options | 13 | # Mount @ subvolume as root with optimal btrfs options | ||
| 14 | - | mount -o noatime,compress=zstd,subvol=@ "$MOUNT_DEVICE" /mnt | 14 | + | mount -o noatime,compress=zstd,subvol=@ "$MOUNT_DEVICE" /mnt >> "$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 directory | 18 | # Create home directory | ||
| 19 | - | mkdir -p /mnt/home | 19 | + | mkdir -p /mnt/home >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 |
| 20 | 20 | ||||
| 21 | # Mount @home subvolume | 21 | # Mount @home subvolume | ||
| 22 | - | mount -o noatime,compress=zstd,subvol=@home "$MOUNT_DEVICE" /mnt/home | 22 | + | mount -o noatime,compress=zstd,subvol=@home "$MOUNT_DEVICE" /mnt/home >> "$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 directory | 26 | # Create and mount EFI directory | ||
| 27 | - | mkdir -p /mnt/boot | 27 | + | mkdir -p /mnt/boot >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 |
| 28 | - | mount "$ARCHUP_EFI_PART" /mnt/boot | 28 | + | 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 @@ | |||
| 4 | 4 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating partitions..." | |
| 5 | 5 | ||
| 6 | 6 | # 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 | |
| 9 | 9 | ||
| 10 | 10 | # Create partitions | |
| 11 | 11 | # 1. EFI partition (512MB) | |
| @@ -13,10 +13,10 @@ sgdisk --zap-all "$ARCHUP_DISK" | |||
| 13 | 13 | sgdisk --clear \ | |
| 14 | 14 | --new=1:0:+512M --typecode=1:ef00 --change-name=1:"EFI" \ | |
| 15 | 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 | 18 | # Inform kernel of partition changes | |
| 19 | - | partprobe "$ARCHUP_DISK" | |
| 19 | + | partprobe "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 20 | 20 | sleep 1 | |
| 21 | 21 | ||
| 22 | 22 | # 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 table | 6 | # 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 partitions | 10 | # 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 changes | 18 | # Inform kernel of partition changes | ||
| 19 | - | partprobe "$ARCHUP_DISK" | 19 | + | partprobe "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 |
| 20 | sleep 1 | 20 | sleep 1 | ||
| 21 | 21 | ||||
| 22 | # Set partition variables | 22 | # Set partition variables | ||
M install/preflight/all.sh +2 -2
| @@ -2,5 +2,5 @@ | |||
| 2 | 2 | # Preflight phase | |
| 3 | 3 | ||
| 4 | 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) | |
| 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 phase | 2 | # 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-interactive | 5 | + | 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 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # Begin archup installation | |
| 2 | + | # Begin ArchUp installation | |
| 3 | 3 | # Display welcome message and gather initial configuration choices | |
| 4 | 4 | ||
| 5 | 5 | # 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 | 7 | gum style --padding "0 0 0 $PADDING_LEFT" "A fast, minimal Arch Linux auto-installer" | |
| 8 | 8 | echo | |
| 9 | 9 | ||
| @@ -14,9 +14,9 @@ if ! gum confirm "Ready to begin installation?" --padding "0 0 1 $PADDING_LEFT"; | |||
| 14 | 14 | exit 0 | |
| 15 | 15 | fi | |
| 16 | 16 | ||
| 17 | - | # archup uses Limine bootloader exclusively | |
| 17 | + | # ArchUp uses Limine bootloader exclusively | |
| 18 | 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 | 21 | export ARCHUP_BOOTLOADER="limine" | |
| 22 | 22 | echo "Bootloader: limine" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -35,5 +35,47 @@ else | |||
| 35 | 35 | echo "Encryption: disabled" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 36 | 36 | 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 | 80 | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[OK] Configuration saved" | |
| 39 | 81 | echo "Configuration saved" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,9 +1,9 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # Begin archup installation | 2 | + | # Begin ArchUp installation |
| 3 | # Display welcome message and gather initial configuration choices | 3 | # Display welcome message and gather initial configuration choices | ||
| 4 | 4 | ||||
| 5 | # Display welcome message | 5 | # 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 | echo | 8 | echo | ||
| 9 | 9 | ||||
| @@ -14,9 +14,9 @@ if ! gum confirm "Ready to begin installation?" --padding "0 0 1 $PADDING_LEFT"; | |||||
| 14 | exit 0 | 14 | exit 0 | ||
| 15 | fi | 15 | fi | ||
| 16 | 16 | ||||
| 17 | - | # archup uses Limine bootloader exclusively | 17 | + | # 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 | fi | 36 | 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 | |||
| 16 | 16 | DETECTED_KEYMAP=$(grep "^KEYMAP=" /etc/vconsole.conf | cut -d'=' -f2) | |
| 17 | 17 | fi | |
| 18 | 18 | ||
| 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 | |
| 21 | 21 | DETECTED_KEYMAP="us" | |
| 22 | 22 | fi | |
| 23 | 23 | ||
| 24 | 24 | export ARCHUP_KEYMAP="$DETECTED_KEYMAP" | |
| 25 | 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 | 28 | # Check for network connectivity | |
| 29 | 29 | # First check if we have an active ethernet connection | |
| @@ -31,7 +31,7 @@ HAS_ETHERNET=false | |||
| 31 | 31 | if ip link show | grep -E "^[0-9]+: (eth|enp|eno)" | grep -q "state UP"; then | |
| 32 | 32 | HAS_ETHERNET=true | |
| 33 | 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 | 35 | fi | |
| 36 | 36 | ||
| 37 | 37 | # 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 | 54 | if [ -f "$IWD_CONFIG" ]; then | |
| 55 | 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 | 57 | fi | |
| 58 | 58 | ||
| 59 | 59 | export ARCHUP_WIFI_SSID="$WIFI_SSID" | |
| @@ -61,18 +61,18 @@ if [ "$HAS_ETHERNET" = false ] && command -v iwctl >/dev/null 2>&1; then | |||
| 61 | 61 | export ARCHUP_WIFI_PASSPHRASE="$WIFI_PASSPHRASE" | |
| 62 | 62 | ||
| 63 | 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 | 65 | else | |
| 66 | 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 | 68 | fi | |
| 69 | 69 | else | |
| 70 | 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 | 72 | fi | |
| 73 | 73 | elif [ "$HAS_ETHERNET" = false ]; then | |
| 74 | 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 | 76 | fi | |
| 77 | 77 | ||
| 78 | 78 | 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 | fi | 17 | fi | ||
| 18 | 18 | ||||
| 19 | - | # Default to us if nothing detected | 19 | + | # Default to us if nothing detected or if set to "(unset)" |
| 20 | - | if [ -z "$DETECTED_KEYMAP" ]; then | 20 | + | if [ -z "$DETECTED_KEYMAP" ] || [ "$DETECTED_KEYMAP" = "(unset)" ]; then |
| 21 | DETECTED_KEYMAP="us" | 21 | DETECTED_KEYMAP="us" | ||
| 22 | fi | 22 | fi | ||
| 23 | 23 | ||||
| 24 | export ARCHUP_KEYMAP="$DETECTED_KEYMAP" | 24 | export ARCHUP_KEYMAP="$DETECTED_KEYMAP" | ||
| 25 | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[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 connectivity | 28 | # Check for network connectivity | ||
| 29 | # First check if we have an active ethernet connection | 29 | # 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"; then | 31 | if ip link show | grep -E "^[0-9]+: (eth|enp|eno)" | grep -q "state UP"; then | ||
| 32 | HAS_ETHERNET=true | 32 | 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 | fi | 35 | fi | ||
| 36 | 36 | ||||
| 37 | # Only check for WiFi if no ethernet connection is available | 37 | # 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" ]; then | 54 | 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 | fi | 57 | 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 | else | 65 | 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 | fi | 68 | fi | ||
| 69 | else | 69 | 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 | fi | 72 | fi | ||
| 73 | elif [ "$HAS_ETHERNET" = false ]; then | 73 | 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 | fi | 76 | fi | ||
| 77 | 77 | ||||
| 78 | echo | 78 | echo | ||
M install/preflight/guards.sh +3 -3
| @@ -1,11 +1,11 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # Preflight guards for archup installer | |
| 2 | + | # Preflight guards for ArchUp installer | |
| 3 | 3 | # Validates system requirements before installation | |
| 4 | 4 | ||
| 5 | 5 | abort() { | |
| 6 | - | gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "archup install requires: $1" | |
| 6 | + | gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "ArchUp install requires: $1" | |
| 7 | 7 | echo | |
| 8 | - | echo "Preflight check failed: $1" | |
| 8 | + | echo "Preflight check failed: $1" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 9 | 9 | gum confirm "Proceed anyway on your own accord and without assistance?" --padding "0 0 0 $PADDING_LEFT" || exit 1 | |
| 10 | 10 | } | |
| 11 | 11 | ||
| @@ -1,11 +1,11 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # Preflight guards for archup installer | 2 | + | # Preflight guards for ArchUp installer |
| 3 | # Validates system requirements before installation | 3 | # Validates system requirements before installation | ||
| 4 | 4 | ||||
| 5 | abort() { | 5 | abort() { | ||
| 6 | - | gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "archup install requires: $1" | 6 | + | gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "ArchUp install requires: $1" |
| 7 | echo | 7 | echo | ||
| 8 | - | echo "Preflight check failed: $1" | 8 | + | echo "Preflight check failed: $1" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 9 | gum confirm "Proceed anyway on your own accord and without assistance?" --padding "0 0 0 $PADDING_LEFT" || exit 1 | 9 | 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 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | # Repository setup phase | |
| 3 | 3 | ||
| 4 | + | stop_log_output # Stop for interactive prompts | |
| 4 | 5 | source "$ARCHUP_INSTALL/repos/yay.sh" # Interactive (gum confirm) | |
| 5 | 6 | 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/bash | 1 | #!/bin/bash | ||
| 2 | # Repository setup phase | 2 | # 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 | |||
| 18 | 18 | gum style --padding "0 0 1 $PADDING_LEFT" "Installing keyring and mirrorlist..." | |
| 19 | 19 | ||
| 20 | 20 | # 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 | |
| 23 | 23 | ||
| 24 | 24 | # Install chaotic-keyring and chaotic-mirrorlist | |
| 25 | 25 | arch-chroot /mnt pacman -U --noconfirm \ | |
| 26 | 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 | 29 | # Add Chaotic-AUR to pacman.conf | |
| 30 | 30 | if ! grep -q "\[chaotic-aur\]" /mnt/etc/pacman.conf; then | |
| @@ -39,15 +39,15 @@ EOF | |||
| 39 | 39 | fi | |
| 40 | 40 | ||
| 41 | 41 | # Update package databases | |
| 42 | - | arch-chroot /mnt pacman -Sy | |
| 42 | + | arch-chroot /mnt pacman -Sy >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 43 | 43 | ||
| 44 | 44 | # Verify Chaotic-AUR is working | |
| 45 | 45 | if arch-chroot /mnt pacman -Sl chaotic-aur >/dev/null 2>&1; then | |
| 46 | 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 | 48 | else | |
| 49 | 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 | 51 | export ARCHUP_CHAOTIC="failed" | |
| 52 | 52 | return 1 | |
| 53 | 53 | 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 mirrorlist | 20 | # Install Chaotic-AUR keyring and mirrorlist | ||
| 21 | - | arch-chroot /mnt pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com | 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 | 22 | + | arch-chroot /mnt pacman-key --lsign-key 3056513887B78AEB >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 |
| 23 | 23 | ||||
| 24 | # Install chaotic-keyring and chaotic-mirrorlist | 24 | # 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.conf | 29 | # Add Chaotic-AUR to pacman.conf | ||
| 30 | if ! grep -q "\[chaotic-aur\]" /mnt/etc/pacman.conf; then | 30 | if ! grep -q "\[chaotic-aur\]" /mnt/etc/pacman.conf; then | ||
| @@ -39,15 +39,15 @@ EOF | |||||
| 39 | fi | 39 | fi | ||
| 40 | 40 | ||||
| 41 | # Update package databases | 41 | # Update package databases | ||
| 42 | - | arch-chroot /mnt pacman -Sy | 42 | + | arch-chroot /mnt pacman -Sy >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 |
| 43 | 43 | ||||
| 44 | # Verify Chaotic-AUR is working | 44 | # Verify Chaotic-AUR is working | ||
| 45 | if arch-chroot /mnt pacman -Sl chaotic-aur >/dev/null 2>&1; then | 45 | if arch-chroot /mnt pacman -Sl chaotic-aur >/dev/null 2>&1; then | ||
| 46 | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[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 | else | 48 | 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 1 | 52 | return 1 | ||
| 53 | fi | 53 | fi | ||
M install/repos/yay.sh +8 -8
| @@ -7,7 +7,7 @@ echo | |||
| 7 | 7 | # Ask if user wants AUR support | |
| 8 | 8 | if ! gum confirm "Enable AUR support (install yay)?" --padding "0 0 1 $PADDING_LEFT"; then | |
| 9 | 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 | 11 | export ARCHUP_AUR="disabled" | |
| 12 | 12 | return 0 | |
| 13 | 13 | fi | |
| @@ -18,34 +18,34 @@ gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing yay AUR hel | |||
| 18 | 18 | gum style --padding "0 0 1 $PADDING_LEFT" "This may take a few minutes..." | |
| 19 | 19 | ||
| 20 | 20 | # 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 | |
| 22 | 22 | ||
| 23 | 23 | # Get the username created during installation | |
| 24 | 24 | USERNAME=$(arch-chroot /mnt ls /home | head -1) | |
| 25 | 25 | ||
| 26 | 26 | if [ -z "$USERNAME" ]; then | |
| 27 | 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 | 29 | export ARCHUP_AUR="failed" | |
| 30 | 30 | return 1 | |
| 31 | 31 | fi | |
| 32 | 32 | ||
| 33 | 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 | 36 | # 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 | 39 | # 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 | |
| 41 | 41 | ||
| 42 | 42 | # Verify installation | |
| 43 | 43 | if arch-chroot /mnt su - "$USERNAME" -c "yay --version" >/dev/null 2>&1; then | |
| 44 | 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 | 46 | else | |
| 47 | 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 | 49 | export ARCHUP_AUR="failed" | |
| 50 | 50 | return 1 | |
| 51 | 51 | fi | |
| @@ -7,7 +7,7 @@ echo | |||||
| 7 | # Ask if user wants AUR support | 7 | # Ask if user wants AUR support | ||
| 8 | if ! gum confirm "Enable AUR support (install yay)?" --padding "0 0 1 $PADDING_LEFT"; then | 8 | if ! gum confirm "Enable AUR support (install yay)?" --padding "0 0 1 $PADDING_LEFT"; then | ||
| 9 | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[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 0 | 12 | return 0 | ||
| 13 | fi | 13 | 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 git | 21 | + | arch-chroot /mnt pacman -S --noconfirm --needed base-devel git >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 |
| 22 | 22 | ||||
| 23 | # Get the username created during installation | 23 | # 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" ]; then | 26 | 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 1 | 30 | return 1 | ||
| 31 | fi | 31 | 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 user | 36 | # 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 up | 39 | # 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 |
| 41 | 41 | ||||
| 42 | # Verify installation | 42 | # Verify installation | ||
| 43 | if arch-chroot /mnt su - "$USERNAME" -c "yay --version" >/dev/null 2>&1; then | 43 | if arch-chroot /mnt su - "$USERNAME" -c "yay --version" >/dev/null 2>&1; then | ||
| 44 | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "[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 | else | 46 | 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 1 | 50 | return 1 | ||
| 51 | fi | 51 | fi | ||