feat(install): add automatic file download via curl for ISO installation
- commit
- 49bca676ea7ea71c525ba2c6af721a358248e5f7
- author
- bnema · · 2025-10-19 08:13 UTC
- parent
- fd3c139
- signature
- unsigned
3 files · +68 -23
M Makefile +2 -2
| @@ -20,7 +20,7 @@ check-syntax: | |||
| 20 | 20 | @echo "=========================================" | |
| 21 | 21 | @echo "Checking shell script syntax..." | |
| 22 | 22 | @echo "=========================================" | |
| 23 | - | @for script in install.sh install/helpers/*.sh install/preflight/*.sh install/partitioning/*.sh install/base/*.sh install/config/*.sh install/boot/*.sh install/repos/*.sh; do \ | |
| 23 | + | @for script in install.sh install/bootstrap.sh install/helpers/*.sh install/preflight/*.sh install/partitioning/*.sh install/base/*.sh install/config/*.sh install/boot/*.sh install/repos/*.sh; do \ | |
| 24 | 24 | if [ -f "$$script" ]; then \ | |
| 25 | 25 | echo "Checking: $$script"; \ | |
| 26 | 26 | bash -n "$$script" || exit 1; \ | |
| @@ -39,7 +39,7 @@ check-shellcheck: | |||
| 39 | 39 | echo "Install with: sudo pacman -S shellcheck"; \ | |
| 40 | 40 | exit 0; \ | |
| 41 | 41 | fi | |
| 42 | - | @for script in install.sh install/helpers/*.sh install/preflight/*.sh install/partitioning/*.sh install/base/*.sh install/config/*.sh install/boot/*.sh install/repos/*.sh; do \ | |
| 42 | + | @for script in install.sh install/bootstrap.sh install/helpers/*.sh install/preflight/*.sh install/partitioning/*.sh install/base/*.sh install/config/*.sh install/boot/*.sh install/repos/*.sh; do \ | |
| 43 | 43 | if [ -f "$$script" ]; then \ | |
| 44 | 44 | echo ""; \ | |
| 45 | 45 | echo "Checking: $$script"; \ | |
| @@ -20,7 +20,7 @@ check-syntax: | |||||
| 20 | @echo "=========================================" | 20 | @echo "=========================================" | ||
| 21 | @echo "Checking shell script syntax..." | 21 | @echo "Checking shell script syntax..." | ||
| 22 | @echo "=========================================" | 22 | @echo "=========================================" | ||
| 23 | - | @for script in install.sh install/helpers/*.sh install/preflight/*.sh install/partitioning/*.sh install/base/*.sh install/config/*.sh install/boot/*.sh install/repos/*.sh; do \ | 23 | + | @for script in install.sh install/bootstrap.sh install/helpers/*.sh install/preflight/*.sh install/partitioning/*.sh install/base/*.sh install/config/*.sh install/boot/*.sh install/repos/*.sh; do \ |
| 24 | if [ -f "$$script" ]; then \ | 24 | if [ -f "$$script" ]; then \ | ||
| 25 | echo "Checking: $$script"; \ | 25 | echo "Checking: $$script"; \ | ||
| 26 | bash -n "$$script" || exit 1; \ | 26 | bash -n "$$script" || exit 1; \ | ||
| @@ -39,7 +39,7 @@ check-shellcheck: | |||||
| 39 | echo "Install with: sudo pacman -S shellcheck"; \ | 39 | echo "Install with: sudo pacman -S shellcheck"; \ | ||
| 40 | exit 0; \ | 40 | exit 0; \ | ||
| 41 | fi | 41 | fi | ||
| 42 | - | @for script in install.sh install/helpers/*.sh install/preflight/*.sh install/partitioning/*.sh install/base/*.sh install/config/*.sh install/boot/*.sh install/repos/*.sh; do \ | 42 | + | @for script in install.sh install/bootstrap.sh install/helpers/*.sh install/preflight/*.sh install/partitioning/*.sh install/base/*.sh install/config/*.sh install/boot/*.sh install/repos/*.sh; do \ |
| 43 | if [ -f "$$script" ]; then \ | 43 | if [ -f "$$script" ]; then \ | ||
| 44 | echo ""; \ | 44 | echo ""; \ | ||
| 45 | echo "Checking: $$script"; \ | 45 | echo "Checking: $$script"; \ | ||
M README.md +8 -21
| @@ -84,21 +84,12 @@ archup/ | |||
| 84 | 84 | ### Quick Install (from Arch ISO) | |
| 85 | 85 | ||
| 86 | 86 | ```bash | |
| 87 | - | # Download and run archup installer | |
| 88 | - | wget -O- https://raw.githubusercontent.com/bnema/archup/main/install.sh | bash | |
| 89 | - | ``` | |
| 90 | - | ||
| 91 | - | Or download first, then run: | |
| 92 | - | ||
| 93 | - | ```bash | |
| 94 | - | # Download the installer | |
| 95 | - | wget https://raw.githubusercontent.com/bnema/archup/main/install.sh | |
| 96 | - | ||
| 97 | - | # Make it executable | |
| 87 | + | # Download the installation script (curl is available by default on Arch ISO) | |
| 88 | + | curl -L https://raw.githubusercontent.com/bnema/archup/main/install.sh -o install.sh | |
| 98 | 89 | chmod +x install.sh | |
| 99 | 90 | ||
| 100 | - | # Run the installer | |
| 101 | - | ./install.sh | |
| 91 | + | # Run the installer (it will download all required files) | |
| 92 | + | sudo ./install.sh | |
| 102 | 93 | ``` | |
| 103 | 94 | ||
| 104 | 95 | **Note:** Phase 1 complete! The installer can now install a minimal bootable Arch Linux system. Ready for VM testing. | |
| @@ -119,20 +110,16 @@ make check-syntax | |||
| 119 | 110 | make check-shellcheck | |
| 120 | 111 | ``` | |
| 121 | 112 | ||
| 122 | - | ### Testing Installation (Phase 1) | |
| 113 | + | ### Testing Installation | |
| 123 | 114 | To test the installer in a VM (QEMU/KVM recommended): | |
| 124 | 115 | ||
| 125 | 116 | ```bash | |
| 126 | 117 | # Boot Arch ISO in VM with UEFI enabled | |
| 127 | 118 | # Connect to internet | |
| 128 | - | # Download archup | |
| 129 | - | git clone https://github.com/bnema/archup.git | |
| 130 | - | cd archup | |
| 131 | 119 | ||
| 132 | - | # Set the archup path | |
| 133 | - | export ARCHUP_PATH=$(pwd) | |
| 134 | - | ||
| 135 | - | # Run the installer | |
| 120 | + | # Download and run installer (automatically downloads all required files) | |
| 121 | + | curl -L https://raw.githubusercontent.com/bnema/archup/main/install.sh -o install.sh | |
| 122 | + | chmod +x install.sh | |
| 136 | 123 | sudo ./install.sh | |
| 137 | 124 | ``` | |
| 138 | 125 | ||
| @@ -84,21 +84,12 @@ archup/ | |||||
| 84 | ### Quick Install (from Arch ISO) | 84 | ### Quick Install (from Arch ISO) | ||
| 85 | 85 | ||||
| 86 | ```bash | 86 | ```bash | ||
| 87 | - | # Download and run archup installer | 87 | + | # Download the installation script (curl is available by default on Arch ISO) |
| 88 | - | wget -O- https://raw.githubusercontent.com/bnema/archup/main/install.sh | bash | 88 | + | curl -L https://raw.githubusercontent.com/bnema/archup/main/install.sh -o install.sh |
| 89 | - | ``` | |||
| 90 | - | ||||
| 91 | - | Or download first, then run: | |||
| 92 | - | ||||
| 93 | - | ```bash | |||
| 94 | - | # Download the installer | |||
| 95 | - | wget https://raw.githubusercontent.com/bnema/archup/main/install.sh | |||
| 96 | - | ||||
| 97 | - | # Make it executable | |||
| 98 | chmod +x install.sh | 89 | chmod +x install.sh | ||
| 99 | 90 | ||||
| 100 | - | # Run the installer | 91 | + | # Run the installer (it will download all required files) |
| 101 | - | ./install.sh | 92 | + | sudo ./install.sh |
| 102 | ``` | 93 | ``` | ||
| 103 | 94 | ||||
| 104 | **Note:** Phase 1 complete! The installer can now install a minimal bootable Arch Linux system. Ready for VM testing. | 95 | **Note:** Phase 1 complete! The installer can now install a minimal bootable Arch Linux system. Ready for VM testing. | ||
| @@ -119,20 +110,16 @@ make check-syntax | |||||
| 119 | make check-shellcheck | 110 | make check-shellcheck | ||
| 120 | ``` | 111 | ``` | ||
| 121 | 112 | ||||
| 122 | - | ### Testing Installation (Phase 1) | 113 | + | ### Testing Installation |
| 123 | To test the installer in a VM (QEMU/KVM recommended): | 114 | To test the installer in a VM (QEMU/KVM recommended): | ||
| 124 | 115 | ||||
| 125 | ```bash | 116 | ```bash | ||
| 126 | # Boot Arch ISO in VM with UEFI enabled | 117 | # Boot Arch ISO in VM with UEFI enabled | ||
| 127 | # Connect to internet | 118 | # Connect to internet | ||
| 128 | - | # Download archup | |||
| 129 | - | git clone https://github.com/bnema/archup.git | |||
| 130 | - | cd archup | |||
| 131 | 119 | ||||
| 132 | - | # Set the archup path | 120 | + | # Download and run installer (automatically downloads all required files) |
| 133 | - | export ARCHUP_PATH=$(pwd) | 121 | + | curl -L https://raw.githubusercontent.com/bnema/archup/main/install.sh -o install.sh |
| 134 | - | 122 | + | chmod +x install.sh | |
| 135 | - | # Run the installer | |||
| 136 | sudo ./install.sh | 123 | sudo ./install.sh | ||
| 137 | ``` | 124 | ``` | ||
| 138 | 125 | ||||
M install.sh +58 -0
| @@ -9,6 +9,64 @@ export ARCHUP_PATH="${ARCHUP_PATH:-$HOME/.local/share/archup}" | |||
| 9 | 9 | 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 | + | export ARCHUP_RAW_URL="https://raw.githubusercontent.com/bnema/archup/main" | |
| 13 | + | ||
| 14 | + | # Download installer files if not present (for curl-based installation) | |
| 15 | + | if [ ! -d "$ARCHUP_INSTALL" ]; then | |
| 16 | + | echo "=== Downloading archup installer files ===" | |
| 17 | + | mkdir -p "$ARCHUP_INSTALL" | |
| 18 | + | ||
| 19 | + | # Download all required files using curl | |
| 20 | + | GITHUB_RAW="$ARCHUP_RAW_URL" | |
| 21 | + | ||
| 22 | + | # Create directory structure | |
| 23 | + | mkdir -p "$ARCHUP_INSTALL"/{helpers,preflight,partitioning,base,config,boot,repos,presets} | |
| 24 | + | ||
| 25 | + | echo "Downloading core files..." | |
| 26 | + | curl -sL "$GITHUB_RAW/install/bootstrap.sh" -o "$ARCHUP_INSTALL/bootstrap.sh" | |
| 27 | + | curl -sL "$GITHUB_RAW/logo.txt" -o "$ARCHUP_PATH/logo.txt" | |
| 28 | + | ||
| 29 | + | echo "Downloading helpers..." | |
| 30 | + | for file in all.sh logging.sh errors.sh presentation.sh chroot.sh; do | |
| 31 | + | curl -sL "$GITHUB_RAW/install/helpers/$file" -o "$ARCHUP_INSTALL/helpers/$file" | |
| 32 | + | done | |
| 33 | + | ||
| 34 | + | echo "Downloading preflight..." | |
| 35 | + | for file in all.sh guards.sh begin.sh detect-environment.sh; do | |
| 36 | + | curl -sL "$GITHUB_RAW/install/preflight/$file" -o "$ARCHUP_INSTALL/preflight/$file" | |
| 37 | + | done | |
| 38 | + | ||
| 39 | + | echo "Downloading partitioning..." | |
| 40 | + | for file in all.sh detect-disk.sh partition.sh format.sh mount.sh; do | |
| 41 | + | curl -sL "$GITHUB_RAW/install/partitioning/$file" -o "$ARCHUP_INSTALL/partitioning/$file" | |
| 42 | + | done | |
| 43 | + | ||
| 44 | + | echo "Downloading base..." | |
| 45 | + | for file in all.sh kernel.sh pacstrap.sh fstab.sh; do | |
| 46 | + | curl -sL "$GITHUB_RAW/install/base/$file" -o "$ARCHUP_INSTALL/base/$file" | |
| 47 | + | done | |
| 48 | + | ||
| 49 | + | echo "Downloading config..." | |
| 50 | + | for file in all.sh system.sh user.sh network.sh; do | |
| 51 | + | curl -sL "$GITHUB_RAW/install/config/$file" -o "$ARCHUP_INSTALL/config/$file" | |
| 52 | + | done | |
| 53 | + | ||
| 54 | + | echo "Downloading boot..." | |
| 55 | + | for file in all.sh limine.sh; do | |
| 56 | + | curl -sL "$GITHUB_RAW/install/boot/$file" -o "$ARCHUP_INSTALL/boot/$file" | |
| 57 | + | done | |
| 58 | + | ||
| 59 | + | echo "Downloading repos..." | |
| 60 | + | for file in all.sh yay.sh chaotic.sh; do | |
| 61 | + | curl -sL "$GITHUB_RAW/install/repos/$file" -o "$ARCHUP_INSTALL/repos/$file" | |
| 62 | + | done | |
| 63 | + | ||
| 64 | + | echo "Downloading presets..." | |
| 65 | + | curl -sL "$GITHUB_RAW/install/presets/barebone.packages" -o "$ARCHUP_INSTALL/presets/barebone.packages" | |
| 66 | + | ||
| 67 | + | echo "✓ All files downloaded successfully" | |
| 68 | + | echo "" | |
| 69 | + | fi | |
| 12 | 70 | ||
| 13 | 71 | # Bootstrap: Install gum and essential dependencies (plain text, no gum usage) | |
| 14 | 72 | source "$ARCHUP_INSTALL/bootstrap.sh" | |
| @@ -9,6 +9,64 @@ export ARCHUP_PATH="${ARCHUP_PATH:-$HOME/.local/share/archup}" | |||||
| 9 | export ARCHUP_INSTALL="$ARCHUP_PATH/install" | 9 | 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 | + | export ARCHUP_RAW_URL="https://raw.githubusercontent.com/bnema/archup/main" | |||
| 13 | + | ||||
| 14 | + | # Download installer files if not present (for curl-based installation) | |||
| 15 | + | if [ ! -d "$ARCHUP_INSTALL" ]; then | |||
| 16 | + | echo "=== Downloading archup installer files ===" | |||
| 17 | + | mkdir -p "$ARCHUP_INSTALL" | |||
| 18 | + | ||||
| 19 | + | # Download all required files using curl | |||
| 20 | + | GITHUB_RAW="$ARCHUP_RAW_URL" | |||
| 21 | + | ||||
| 22 | + | # Create directory structure | |||
| 23 | + | mkdir -p "$ARCHUP_INSTALL"/{helpers,preflight,partitioning,base,config,boot,repos,presets} | |||
| 24 | + | ||||
| 25 | + | echo "Downloading core files..." | |||
| 26 | + | curl -sL "$GITHUB_RAW/install/bootstrap.sh" -o "$ARCHUP_INSTALL/bootstrap.sh" | |||
| 27 | + | curl -sL "$GITHUB_RAW/logo.txt" -o "$ARCHUP_PATH/logo.txt" | |||
| 28 | + | ||||
| 29 | + | echo "Downloading helpers..." | |||
| 30 | + | for file in all.sh logging.sh errors.sh presentation.sh chroot.sh; do | |||
| 31 | + | curl -sL "$GITHUB_RAW/install/helpers/$file" -o "$ARCHUP_INSTALL/helpers/$file" | |||
| 32 | + | done | |||
| 33 | + | ||||
| 34 | + | echo "Downloading preflight..." | |||
| 35 | + | for file in all.sh guards.sh begin.sh detect-environment.sh; do | |||
| 36 | + | curl -sL "$GITHUB_RAW/install/preflight/$file" -o "$ARCHUP_INSTALL/preflight/$file" | |||
| 37 | + | done | |||
| 38 | + | ||||
| 39 | + | echo "Downloading partitioning..." | |||
| 40 | + | for file in all.sh detect-disk.sh partition.sh format.sh mount.sh; do | |||
| 41 | + | curl -sL "$GITHUB_RAW/install/partitioning/$file" -o "$ARCHUP_INSTALL/partitioning/$file" | |||
| 42 | + | done | |||
| 43 | + | ||||
| 44 | + | echo "Downloading base..." | |||
| 45 | + | for file in all.sh kernel.sh pacstrap.sh fstab.sh; do | |||
| 46 | + | curl -sL "$GITHUB_RAW/install/base/$file" -o "$ARCHUP_INSTALL/base/$file" | |||
| 47 | + | done | |||
| 48 | + | ||||
| 49 | + | echo "Downloading config..." | |||
| 50 | + | for file in all.sh system.sh user.sh network.sh; do | |||
| 51 | + | curl -sL "$GITHUB_RAW/install/config/$file" -o "$ARCHUP_INSTALL/config/$file" | |||
| 52 | + | done | |||
| 53 | + | ||||
| 54 | + | echo "Downloading boot..." | |||
| 55 | + | for file in all.sh limine.sh; do | |||
| 56 | + | curl -sL "$GITHUB_RAW/install/boot/$file" -o "$ARCHUP_INSTALL/boot/$file" | |||
| 57 | + | done | |||
| 58 | + | ||||
| 59 | + | echo "Downloading repos..." | |||
| 60 | + | for file in all.sh yay.sh chaotic.sh; do | |||
| 61 | + | curl -sL "$GITHUB_RAW/install/repos/$file" -o "$ARCHUP_INSTALL/repos/$file" | |||
| 62 | + | done | |||
| 63 | + | ||||
| 64 | + | echo "Downloading presets..." | |||
| 65 | + | curl -sL "$GITHUB_RAW/install/presets/barebone.packages" -o "$ARCHUP_INSTALL/presets/barebone.packages" | |||
| 66 | + | ||||
| 67 | + | echo "✓ All files downloaded successfully" | |||
| 68 | + | echo "" | |||
| 69 | + | fi | |||
| 12 | 70 | ||||
| 13 | # Bootstrap: Install gum and essential dependencies (plain text, no gum usage) | 71 | # Bootstrap: Install gum and essential dependencies (plain text, no gum usage) | ||
| 14 | source "$ARCHUP_INSTALL/bootstrap.sh" | 72 | source "$ARCHUP_INSTALL/bootstrap.sh" | ||