fix(install): enable curl-pipe installation with interactive prompts and proper bootstrap
- commit
- 09b7a59c29b34e9200e036ce51e8fec11afc214a
- author
- bnema · · 2025-10-20 19:50 UTC
- committer
- bnema · · 2025-10-20 20:55 UTC
- parent
- d29f303
- signature
- unsigned
3 files · +55 -19
A CHANGELOG.md +25 -0
| @@ -0,0 +1,25 @@ | |||
| 1 | + | # Changelog | |
| 2 | + | ||
| 3 | + | All notable changes to this project will be documented in this file. | |
| 4 | + | ||
| 5 | + | ## [Unreleased] | |
| 6 | + | ||
| 7 | + | ### Fixed | |
| 8 | + | - **Curl-pipe installation**: Fixed curl-based one-liner installation by auto-detecting piped input, re-executing with TTY for interactive prompts, and running bootstrap before downloads | |
| 9 | + | ||
| 10 | + | ## [0.1.0] - 2025-10-21 | |
| 11 | + | ||
| 12 | + | ### Added | |
| 13 | + | - **Post-boot setup**: Dedicated post-boot setup script for first-boot execution | |
| 14 | + | - **archup-cli integration**: Added archup-cli installation to first-boot sequence | |
| 15 | + | - **archup-cli builder**: Download and install archup-cli from latest GitHub release during installation | |
| 16 | + | ||
| 17 | + | ### Changed | |
| 18 | + | - **Helper script refactoring**: Updated helper scripts for improved architecture | |
| 19 | + | - **Build system**: Updated Makefile to remove preset paths and add post-boot paths | |
| 20 | + | - **AUR helpers**: Consolidated AUR helpers into single unified aur.sh script | |
| 21 | + | - **Installer simplification**: Simplified install.sh to use download helper and remove redundant preset logic | |
| 22 | + | ||
| 23 | + | ### Fixed | |
| 24 | + | - Post-install workflow: Removed duplicate post-boot setup logic from snapper script | |
| 25 | + | - Installation sequence: Properly integrated post-boot-setup into main installation flow | |
| @@ -0,0 +1,25 @@ | |||||
| 1 | + | # Changelog | |||
| 2 | + | ||||
| 3 | + | All notable changes to this project will be documented in this file. | |||
| 4 | + | ||||
| 5 | + | ## [Unreleased] | |||
| 6 | + | ||||
| 7 | + | ### Fixed | |||
| 8 | + | - **Curl-pipe installation**: Fixed curl-based one-liner installation by auto-detecting piped input, re-executing with TTY for interactive prompts, and running bootstrap before downloads | |||
| 9 | + | ||||
| 10 | + | ## [0.1.0] - 2025-10-21 | |||
| 11 | + | ||||
| 12 | + | ### Added | |||
| 13 | + | - **Post-boot setup**: Dedicated post-boot setup script for first-boot execution | |||
| 14 | + | - **archup-cli integration**: Added archup-cli installation to first-boot sequence | |||
| 15 | + | - **archup-cli builder**: Download and install archup-cli from latest GitHub release during installation | |||
| 16 | + | ||||
| 17 | + | ### Changed | |||
| 18 | + | - **Helper script refactoring**: Updated helper scripts for improved architecture | |||
| 19 | + | - **Build system**: Updated Makefile to remove preset paths and add post-boot paths | |||
| 20 | + | - **AUR helpers**: Consolidated AUR helpers into single unified aur.sh script | |||
| 21 | + | - **Installer simplification**: Simplified install.sh to use download helper and remove redundant preset logic | |||
| 22 | + | ||||
| 23 | + | ### Fixed | |||
| 24 | + | - Post-install workflow: Removed duplicate post-boot setup logic from snapper script | |||
| 25 | + | - Installation sequence: Properly integrated post-boot-setup into main installation flow | |||
M install.sh +24 -7
| @@ -4,9 +4,20 @@ | |||
| 4 | 4 | ||
| 5 | 5 | set -eo pipefail | |
| 6 | 6 | ||
| 7 | - | # Export global paths | |
| 7 | + | # Export global paths first (needed for re-exec) | |
| 8 | 8 | export ARCHUP_PATH="${ARCHUP_PATH:-$HOME/.local/share/archup}" | |
| 9 | 9 | export ARCHUP_INSTALL="$ARCHUP_PATH/install" | |
| 10 | + | ||
| 11 | + | # If stdin is not a TTY (piped from curl), save and re-exec with TTY | |
| 12 | + | if [ ! -t 0 ]; then | |
| 13 | + | # Save script to proper location | |
| 14 | + | mkdir -p "$ARCHUP_PATH" | |
| 15 | + | INSTALL_SCRIPT="$ARCHUP_PATH/install.sh" | |
| 16 | + | cat > "$INSTALL_SCRIPT" | |
| 17 | + | chmod +x "$INSTALL_SCRIPT" | |
| 18 | + | # Re-exec with TTY connected | |
| 19 | + | exec < /dev/tty "$INSTALL_SCRIPT" "$@" | |
| 20 | + | fi | |
| 10 | 21 | export ARCHUP_INSTALL_LOG_FILE="/var/log/archup-install.log" | |
| 11 | 22 | export ARCHUP_INSTALL_CONFIG="/var/log/archup-install.conf" | |
| 12 | 23 | export ARCHUP_REPO_URL="${ARCHUP_REPO_URL:-https://github.com/bnema/archup}" | |
| @@ -36,21 +47,27 @@ HELP | |||
| 36 | 47 | exit 0 | |
| 37 | 48 | fi | |
| 38 | 49 | ||
| 39 | - | # Download installer files if not present (for curl-based installation) | |
| 50 | + | # Bootstrap FIRST: Install gum and jq (required for download script) | |
| 40 | 51 | if [ ! -d "$ARCHUP_INSTALL" ]; then | |
| 41 | - | # Download the download helper first | |
| 52 | + | # First time running from curl, need to download bootstrap | |
| 53 | + | mkdir -p "$ARCHUP_INSTALL" | |
| 54 | + | curl -sL "$ARCHUP_RAW_URL/install/bootstrap.sh" -o "$ARCHUP_INSTALL/bootstrap.sh" | |
| 55 | + | chmod +x "$ARCHUP_INSTALL/bootstrap.sh" | |
| 56 | + | fi | |
| 57 | + | source "$ARCHUP_INSTALL/bootstrap.sh" | |
| 58 | + | ||
| 59 | + | # Download installer files if not present (for curl-based installation) | |
| 60 | + | if [ ! -f "$ARCHUP_INSTALL/helpers/all.sh" ]; then | |
| 61 | + | # Download the download helper | |
| 42 | 62 | mkdir -p "$ARCHUP_INSTALL/helpers" | |
| 43 | 63 | curl -sL "$ARCHUP_RAW_URL/install/helpers/download.sh" -o "$ARCHUP_INSTALL/helpers/download.sh" | |
| 44 | 64 | chmod +x "$ARCHUP_INSTALL/helpers/download.sh" | |
| 45 | 65 | ||
| 46 | - | # Run the download script | |
| 66 | + | # Run the download script (gum is now available) | |
| 47 | 67 | source "$ARCHUP_INSTALL/helpers/download.sh" | |
| 48 | 68 | download_archup_files | |
| 49 | 69 | fi | |
| 50 | 70 | ||
| 51 | - | # Bootstrap: Install gum and essential dependencies (plain text, no gum usage) | |
| 52 | - | source "$ARCHUP_INSTALL/bootstrap.sh" | |
| 53 | - | ||
| 54 | 71 | # Source all helper utilities (now safe to use gum) | |
| 55 | 72 | source "$ARCHUP_INSTALL/helpers/all.sh" | |
| 56 | 73 | ||
| @@ -4,9 +4,20 @@ | |||||
| 4 | 4 | ||||
| 5 | set -eo pipefail | 5 | set -eo pipefail | ||
| 6 | 6 | ||||
| 7 | - | # Export global paths | 7 | + | # Export global paths first (needed for re-exec) |
| 8 | export ARCHUP_PATH="${ARCHUP_PATH:-$HOME/.local/share/archup}" | 8 | export ARCHUP_PATH="${ARCHUP_PATH:-$HOME/.local/share/archup}" | ||
| 9 | export ARCHUP_INSTALL="$ARCHUP_PATH/install" | 9 | export ARCHUP_INSTALL="$ARCHUP_PATH/install" | ||
| 10 | + | ||||
| 11 | + | # If stdin is not a TTY (piped from curl), save and re-exec with TTY | |||
| 12 | + | if [ ! -t 0 ]; then | |||
| 13 | + | # Save script to proper location | |||
| 14 | + | mkdir -p "$ARCHUP_PATH" | |||
| 15 | + | INSTALL_SCRIPT="$ARCHUP_PATH/install.sh" | |||
| 16 | + | cat > "$INSTALL_SCRIPT" | |||
| 17 | + | chmod +x "$INSTALL_SCRIPT" | |||
| 18 | + | # Re-exec with TTY connected | |||
| 19 | + | exec < /dev/tty "$INSTALL_SCRIPT" "$@" | |||
| 20 | + | fi | |||
| 10 | export ARCHUP_INSTALL_LOG_FILE="/var/log/archup-install.log" | 21 | export ARCHUP_INSTALL_LOG_FILE="/var/log/archup-install.log" | ||
| 11 | export ARCHUP_INSTALL_CONFIG="/var/log/archup-install.conf" | 22 | export ARCHUP_INSTALL_CONFIG="/var/log/archup-install.conf" | ||
| 12 | export ARCHUP_REPO_URL="${ARCHUP_REPO_URL:-https://github.com/bnema/archup}" | 23 | export ARCHUP_REPO_URL="${ARCHUP_REPO_URL:-https://github.com/bnema/archup}" | ||
| @@ -36,21 +47,27 @@ HELP | |||||
| 36 | exit 0 | 47 | exit 0 | ||
| 37 | fi | 48 | fi | ||
| 38 | 49 | ||||
| 39 | - | # Download installer files if not present (for curl-based installation) | 50 | + | # Bootstrap FIRST: Install gum and jq (required for download script) |
| 40 | if [ ! -d "$ARCHUP_INSTALL" ]; then | 51 | if [ ! -d "$ARCHUP_INSTALL" ]; then | ||
| 41 | - | # Download the download helper first | 52 | + | # First time running from curl, need to download bootstrap |
| 53 | + | mkdir -p "$ARCHUP_INSTALL" | |||
| 54 | + | curl -sL "$ARCHUP_RAW_URL/install/bootstrap.sh" -o "$ARCHUP_INSTALL/bootstrap.sh" | |||
| 55 | + | chmod +x "$ARCHUP_INSTALL/bootstrap.sh" | |||
| 56 | + | fi | |||
| 57 | + | source "$ARCHUP_INSTALL/bootstrap.sh" | |||
| 58 | + | ||||
| 59 | + | # Download installer files if not present (for curl-based installation) | |||
| 60 | + | if [ ! -f "$ARCHUP_INSTALL/helpers/all.sh" ]; then | |||
| 61 | + | # Download the download helper | |||
| 42 | mkdir -p "$ARCHUP_INSTALL/helpers" | 62 | mkdir -p "$ARCHUP_INSTALL/helpers" | ||
| 43 | curl -sL "$ARCHUP_RAW_URL/install/helpers/download.sh" -o "$ARCHUP_INSTALL/helpers/download.sh" | 63 | curl -sL "$ARCHUP_RAW_URL/install/helpers/download.sh" -o "$ARCHUP_INSTALL/helpers/download.sh" | ||
| 44 | chmod +x "$ARCHUP_INSTALL/helpers/download.sh" | 64 | chmod +x "$ARCHUP_INSTALL/helpers/download.sh" | ||
| 45 | 65 | ||||
| 46 | - | # Run the download script | 66 | + | # Run the download script (gum is now available) |
| 47 | source "$ARCHUP_INSTALL/helpers/download.sh" | 67 | source "$ARCHUP_INSTALL/helpers/download.sh" | ||
| 48 | download_archup_files | 68 | download_archup_files | ||
| 49 | fi | 69 | fi | ||
| 50 | 70 | ||||
| 51 | - | # Bootstrap: Install gum and essential dependencies (plain text, no gum usage) | |||
| 52 | - | source "$ARCHUP_INSTALL/bootstrap.sh" | |||
| 53 | - | ||||
| 54 | # Source all helper utilities (now safe to use gum) | 71 | # Source all helper utilities (now safe to use gum) | ||
| 55 | source "$ARCHUP_INSTALL/helpers/all.sh" | 72 | source "$ARCHUP_INSTALL/helpers/all.sh" | ||
| 56 | 73 | ||||
M install/helpers/download.sh +6 -12
| @@ -7,11 +7,9 @@ download_section() { | |||
| 7 | 7 | shift 2 | |
| 8 | 8 | local files=("$@") | |
| 9 | 9 | ||
| 10 | - | gum spin --spinner dot --title "$title" -- bash -c " | |
| 11 | - | for file in ${files[*]}; do | |
| 12 | - | curl -sL '$GITHUB_RAW/install/$target_dir/\$file' -o '$ARCHUP_INSTALL/$target_dir/\$file' 2>/dev/null | |
| 13 | - | done | |
| 14 | - | " | |
| 10 | + | for file in "${files[@]}"; do | |
| 11 | + | curl -sL "$GITHUB_RAW/install/$target_dir/$file" -o "$ARCHUP_INSTALL/$target_dir/$file" 2>/dev/null | |
| 12 | + | done | |
| 15 | 13 | gum style --foreground 2 "[OK] ${title/Downloading /Downloaded }" | |
| 16 | 14 | } | |
| 17 | 15 | ||
| @@ -26,10 +24,8 @@ download_archup_files() { | |||
| 26 | 24 | mkdir -p "$ARCHUP_INSTALL"/{helpers,preflight,partitioning,base,config,boot,repos,post-install,post-boot} | |
| 27 | 25 | ||
| 28 | 26 | # Core files | |
| 29 | - | gum spin --spinner dot --title "Downloading core files..." -- bash -c " | |
| 30 | - | curl -sL '$GITHUB_RAW/install/bootstrap.sh' -o '$ARCHUP_INSTALL/bootstrap.sh' 2>/dev/null | |
| 31 | - | curl -sL '$GITHUB_RAW/logo.txt' -o '$ARCHUP_PATH/logo.txt' 2>/dev/null | |
| 32 | - | " | |
| 27 | + | curl -sL "$GITHUB_RAW/install/bootstrap.sh" -o "$ARCHUP_INSTALL/bootstrap.sh" 2>/dev/null | |
| 28 | + | curl -sL "$GITHUB_RAW/logo.txt" -o "$ARCHUP_PATH/logo.txt" 2>/dev/null | |
| 33 | 29 | gum style --foreground 2 "[OK] Core files downloaded" | |
| 34 | 30 | ||
| 35 | 31 | # Helpers | |
| @@ -69,9 +65,7 @@ download_archup_files() { | |||
| 69 | 65 | all.sh snapper.sh ssh-keygen.sh archup-cli.sh archup-first-boot.service | |
| 70 | 66 | ||
| 71 | 67 | # Base packages | |
| 72 | - | gum spin --spinner dot --title "Downloading package list..." -- bash -c " | |
| 73 | - | curl -sL '$GITHUB_RAW/install/base.packages' -o '$ARCHUP_INSTALL/base.packages' 2>/dev/null | |
| 74 | - | " | |
| 68 | + | curl -sL "$GITHUB_RAW/install/base.packages" -o "$ARCHUP_INSTALL/base.packages" 2>/dev/null | |
| 75 | 69 | gum style --foreground 2 "[OK] Package list downloaded" | |
| 76 | 70 | ||
| 77 | 71 | echo "" | |
| @@ -7,11 +7,9 @@ download_section() { | |||||
| 7 | shift 2 | 7 | shift 2 | ||
| 8 | local files=("$@") | 8 | local files=("$@") | ||
| 9 | 9 | ||||
| 10 | - | gum spin --spinner dot --title "$title" -- bash -c " | 10 | + | for file in "${files[@]}"; do |
| 11 | - | for file in ${files[*]}; do | 11 | + | curl -sL "$GITHUB_RAW/install/$target_dir/$file" -o "$ARCHUP_INSTALL/$target_dir/$file" 2>/dev/null |
| 12 | - | curl -sL '$GITHUB_RAW/install/$target_dir/\$file' -o '$ARCHUP_INSTALL/$target_dir/\$file' 2>/dev/null | 12 | + | done |
| 13 | - | done | |||
| 14 | - | " | |||
| 15 | gum style --foreground 2 "[OK] ${title/Downloading /Downloaded }" | 13 | gum style --foreground 2 "[OK] ${title/Downloading /Downloaded }" | ||
| 16 | } | 14 | } | ||
| 17 | 15 | ||||
| @@ -26,10 +24,8 @@ download_archup_files() { | |||||
| 26 | mkdir -p "$ARCHUP_INSTALL"/{helpers,preflight,partitioning,base,config,boot,repos,post-install,post-boot} | 24 | mkdir -p "$ARCHUP_INSTALL"/{helpers,preflight,partitioning,base,config,boot,repos,post-install,post-boot} | ||
| 27 | 25 | ||||
| 28 | # Core files | 26 | # Core files | ||
| 29 | - | gum spin --spinner dot --title "Downloading core files..." -- bash -c " | 27 | + | curl -sL "$GITHUB_RAW/install/bootstrap.sh" -o "$ARCHUP_INSTALL/bootstrap.sh" 2>/dev/null |
| 30 | - | curl -sL '$GITHUB_RAW/install/bootstrap.sh' -o '$ARCHUP_INSTALL/bootstrap.sh' 2>/dev/null | 28 | + | curl -sL "$GITHUB_RAW/logo.txt" -o "$ARCHUP_PATH/logo.txt" 2>/dev/null |
| 31 | - | curl -sL '$GITHUB_RAW/logo.txt' -o '$ARCHUP_PATH/logo.txt' 2>/dev/null | |||
| 32 | - | " | |||
| 33 | gum style --foreground 2 "[OK] Core files downloaded" | 29 | gum style --foreground 2 "[OK] Core files downloaded" | ||
| 34 | 30 | ||||
| 35 | # Helpers | 31 | # Helpers | ||
| @@ -69,9 +65,7 @@ download_archup_files() { | |||||
| 69 | all.sh snapper.sh ssh-keygen.sh archup-cli.sh archup-first-boot.service | 65 | all.sh snapper.sh ssh-keygen.sh archup-cli.sh archup-first-boot.service | ||
| 70 | 66 | ||||
| 71 | # Base packages | 67 | # Base packages | ||
| 72 | - | gum spin --spinner dot --title "Downloading package list..." -- bash -c " | 68 | + | curl -sL "$GITHUB_RAW/install/base.packages" -o "$ARCHUP_INSTALL/base.packages" 2>/dev/null |
| 73 | - | curl -sL '$GITHUB_RAW/install/base.packages' -o '$ARCHUP_INSTALL/base.packages' 2>/dev/null | |||
| 74 | - | " | |||
| 75 | gum style --foreground 2 "[OK] Package list downloaded" | 69 | gum style --foreground 2 "[OK] Package list downloaded" | ||
| 76 | 70 | ||||
| 77 | echo "" | 71 | echo "" | ||