feat(bootstrap): implement dependency installation phase before preflight checks
- commit
- fd3c1399b3f1619c01df35da6a5b5cf3dfeb2c63
- author
- bnema · · 2025-10-19 08:00 UTC
- parent
- be87177
- signature
- unsigned
3 files · +33 -6
M install.sh +4 -1
| @@ -10,7 +10,10 @@ export ARCHUP_INSTALL="$ARCHUP_PATH/install" | |||
| 10 | 10 | export ARCHUP_INSTALL_LOG_FILE="/var/log/archup-install.log" | |
| 11 | 11 | export ARCHUP_REPO_URL="${ARCHUP_REPO_URL:-https://github.com/bnema/archup}" | |
| 12 | 12 | ||
| 13 | - | # Source all helper utilities | |
| 13 | + | # Bootstrap: Install gum and essential dependencies (plain text, no gum usage) | |
| 14 | + | source "$ARCHUP_INSTALL/bootstrap.sh" | |
| 15 | + | ||
| 16 | + | # Source all helper utilities (now safe to use gum) | |
| 14 | 17 | source "$ARCHUP_INSTALL/helpers/all.sh" | |
| 15 | 18 | ||
| 16 | 19 | # Display logo and start installation | |
| @@ -10,7 +10,10 @@ export ARCHUP_INSTALL="$ARCHUP_PATH/install" | |||||
| 10 | export ARCHUP_INSTALL_LOG_FILE="/var/log/archup-install.log" | 10 | export ARCHUP_INSTALL_LOG_FILE="/var/log/archup-install.log" | ||
| 11 | export ARCHUP_REPO_URL="${ARCHUP_REPO_URL:-https://github.com/bnema/archup}" | 11 | export ARCHUP_REPO_URL="${ARCHUP_REPO_URL:-https://github.com/bnema/archup}" | ||
| 12 | 12 | ||||
| 13 | - | # Source all helper utilities | 13 | + | # Bootstrap: Install gum and essential dependencies (plain text, no gum usage) |
| 14 | + | source "$ARCHUP_INSTALL/bootstrap.sh" | |||
| 15 | + | ||||
| 16 | + | # Source all helper utilities (now safe to use gum) | |||
| 14 | source "$ARCHUP_INSTALL/helpers/all.sh" | 17 | source "$ARCHUP_INSTALL/helpers/all.sh" | ||
| 15 | 18 | ||||
| 16 | # Display logo and start installation | 19 | # Display logo and start installation | ||
A install/bootstrap.sh +28 -0
| @@ -0,0 +1,28 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Bootstrap: Install essential dependencies before running preflight | |
| 3 | + | # This script cannot use gum since it installs gum! | |
| 4 | + | # Must be run with internet connectivity (after wifi setup in ISO) | |
| 5 | + | ||
| 6 | + | set -e | |
| 7 | + | ||
| 8 | + | echo "=== ArchUp Bootstrap ===" | |
| 9 | + | echo "Installing essential dependencies..." | |
| 10 | + | ||
| 11 | + | # Sync package database (required on fresh ISO boot) | |
| 12 | + | echo "Syncing package database..." | |
| 13 | + | pacman -Sy --noconfirm | |
| 14 | + | ||
| 15 | + | # Install gum for TUI | |
| 16 | + | if ! command -v gum &>/dev/null; then | |
| 17 | + | echo "Installing gum for interactive TUI..." | |
| 18 | + | pacman -S --needed --noconfirm gum | |
| 19 | + | echo "✓ gum installed" | |
| 20 | + | else | |
| 21 | + | echo "✓ gum already available" | |
| 22 | + | fi | |
| 23 | + | ||
| 24 | + | # Any other critical dependencies that preflight needs can go here | |
| 25 | + | # Example: pacman -S --needed --noconfirm other-tool | |
| 26 | + | ||
| 27 | + | echo "✓ Bootstrap complete!" | |
| 28 | + | echo | |
| @@ -0,0 +1,28 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Bootstrap: Install essential dependencies before running preflight | |||
| 3 | + | # This script cannot use gum since it installs gum! | |||
| 4 | + | # Must be run with internet connectivity (after wifi setup in ISO) | |||
| 5 | + | ||||
| 6 | + | set -e | |||
| 7 | + | ||||
| 8 | + | echo "=== ArchUp Bootstrap ===" | |||
| 9 | + | echo "Installing essential dependencies..." | |||
| 10 | + | ||||
| 11 | + | # Sync package database (required on fresh ISO boot) | |||
| 12 | + | echo "Syncing package database..." | |||
| 13 | + | pacman -Sy --noconfirm | |||
| 14 | + | ||||
| 15 | + | # Install gum for TUI | |||
| 16 | + | if ! command -v gum &>/dev/null; then | |||
| 17 | + | echo "Installing gum for interactive TUI..." | |||
| 18 | + | pacman -S --needed --noconfirm gum | |||
| 19 | + | echo "✓ gum installed" | |||
| 20 | + | else | |||
| 21 | + | echo "✓ gum already available" | |||
| 22 | + | fi | |||
| 23 | + | ||||
| 24 | + | # Any other critical dependencies that preflight needs can go here | |||
| 25 | + | # Example: pacman -S --needed --noconfirm other-tool | |||
| 26 | + | ||||
| 27 | + | echo "✓ Bootstrap complete!" | |||
| 28 | + | echo | |||
M install/helpers/presentation.sh +1 -5
| @@ -1,11 +1,7 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | # Presentation utilities for archup installer | |
| 3 | 3 | # Adapted from Omarchy presentation.sh | |
| 4 | - | ||
| 5 | - | # Ensure we have gum available | |
| 6 | - | if ! command -v gum &>/dev/null; then | |
| 7 | - | sudo pacman -S --needed --noconfirm gum | |
| 8 | - | fi | |
| 4 | + | # NOTE: Requires gum to be installed via bootstrap.sh first! | |
| 9 | 5 | ||
| 10 | 6 | # Get terminal size from /dev/tty (works in all scenarios: direct, sourced, or piped) | |
| 11 | 7 | if [ -e /dev/tty ]; then | |
| @@ -1,11 +1,7 @@ | |||||
| 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 | - | 4 | + | # NOTE: Requires gum to be installed via bootstrap.sh first! | |
| 5 | - | # Ensure we have gum available | |||
| 6 | - | if ! command -v gum &>/dev/null; then | |||
| 7 | - | sudo pacman -S --needed --noconfirm gum | |||
| 8 | - | fi | |||
| 9 | 5 | ||||
| 10 | # Get terminal size from /dev/tty (works in all scenarios: direct, sourced, or piped) | 6 | # Get terminal size from /dev/tty (works in all scenarios: direct, sourced, or piped) | ||
| 11 | if [ -e /dev/tty ]; then | 7 | if [ -e /dev/tty ]; then | ||