feat(installer): implement phase 1 barebone installer with auto-partitioning, base installation, and systemd-boot
- commit
- dc1caf5b8ba7d2b50a0d6e73cd6550b4f468ff85
- author
- bnema · · 2025-10-19 07:21 UTC
- parent
- 37e8d87
- signature
- unsigned
20 files · +506 -49
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; do \ | |
| 23 | + | @for script in install.sh install/helpers/*.sh install/preflight/*.sh install/partitioning/*.sh install/base/*.sh install/config/*.sh install/boot/*.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; do \ | |
| 42 | + | @for script in install.sh install/helpers/*.sh install/preflight/*.sh install/partitioning/*.sh install/base/*.sh install/config/*.sh install/boot/*.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; do \ | 23 | + | @for script in install.sh install/helpers/*.sh install/preflight/*.sh install/partitioning/*.sh install/base/*.sh install/config/*.sh install/boot/*.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; do \ | 42 | + | @for script in install.sh install/helpers/*.sh install/preflight/*.sh install/partitioning/*.sh install/base/*.sh install/config/*.sh install/boot/*.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 +60 -20
| @@ -5,13 +5,21 @@ | |||
| 5 | 5 | ## Project Status | |
| 6 | 6 | ||
| 7 | 7 | ✅ **Phase 0: Core Infrastructure - COMPLETE** | |
| 8 | + | ✅ **Phase 1: Barebone Installer - Basic - COMPLETE** | |
| 8 | 9 | ||
| 9 | 10 | ### Completed | |
| 10 | 11 | - ✅ Project structure created | |
| 11 | 12 | - ✅ Helper utilities implemented (logging, errors, presentation, chroot) | |
| 12 | 13 | - ✅ Main orchestrator (install.sh) | |
| 13 | - | - ✅ Barebone package list | |
| 14 | + | - ✅ Barebone package list (~15 packages) | |
| 14 | 15 | - ✅ Logo designed | |
| 16 | + | - ✅ System guards (vanilla Arch, UEFI, x86_64, Secure Boot checks) | |
| 17 | + | - ✅ Bootloader selection (systemd-boot or limine) | |
| 18 | + | - ✅ Auto-partitioning (GPT, EFI + root with ext4) | |
| 19 | + | - ✅ Base system installation (pacstrap + fstab) | |
| 20 | + | - ✅ System configuration (timezone, locale, hostname, user creation) | |
| 21 | + | - ✅ Network configuration (systemd-networkd + iwd) | |
| 22 | + | - ✅ Bootloader installation (systemd-boot with boot entries) | |
| 15 | 23 | ||
| 16 | 24 | ### Project Structure | |
| 17 | 25 | ``` | |
| @@ -26,13 +34,30 @@ archup/ | |||
| 26 | 34 | │ │ ├── errors.sh # Trap handlers, error display | |
| 27 | 35 | │ │ ├── presentation.sh # UI helpers (cursor, colors) | |
| 28 | 36 | │ │ └── chroot.sh # Chroot utilities | |
| 29 | - | │ ├── preflight/ # (Phase 1 - TODO) | |
| 30 | - | │ ├── partitioning/ # (Phase 2 - TODO) | |
| 31 | - | │ ├── base/ # (Phase 3 - TODO) | |
| 32 | - | │ ├── config/ # (Phase 4 - TODO) | |
| 33 | - | │ ├── security/ # (Phase 5 - TODO) | |
| 34 | - | │ ├── bootloader/ # (Phase 6 - TODO) | |
| 35 | - | │ ├── post-install/ # (Phase 7 - TODO) | |
| 37 | + | │ ├── preflight/ # Phase 1 ✅ | |
| 38 | + | │ │ ├── all.sh # Preflight orchestrator | |
| 39 | + | │ │ ├── guards.sh # System validation | |
| 40 | + | │ │ └── begin.sh # Welcome and bootloader selection | |
| 41 | + | │ ├── partitioning/ # Phase 1 ✅ | |
| 42 | + | │ │ ├── all.sh # Partitioning orchestrator | |
| 43 | + | │ │ ├── detect-disk.sh # Disk selection | |
| 44 | + | │ │ ├── partition.sh # GPT partitioning (EFI + root) | |
| 45 | + | │ │ ├── format.sh # Format as FAT32 + ext4 | |
| 46 | + | │ │ └── mount.sh # Mount partitions to /mnt | |
| 47 | + | │ ├── base/ # Phase 1 ✅ | |
| 48 | + | │ │ ├── all.sh # Base installation orchestrator | |
| 49 | + | │ │ ├── pacstrap.sh # Install base packages | |
| 50 | + | │ │ └── fstab.sh # Generate fstab | |
| 51 | + | │ ├── config/ # Phase 1 ✅ | |
| 52 | + | │ │ ├── all.sh # Configuration orchestrator | |
| 53 | + | │ │ ├── system.sh # Timezone, locale, hostname | |
| 54 | + | │ │ ├── user.sh # User creation and sudo setup | |
| 55 | + | │ │ └── network.sh # Network configuration | |
| 56 | + | │ ├── boot/ # Phase 1 ✅ | |
| 57 | + | │ │ ├── all.sh # Bootloader orchestrator | |
| 58 | + | │ │ └── systemd-boot.sh # systemd-boot installation | |
| 59 | + | │ ├── security/ # (Future - TODO) | |
| 60 | + | │ ├── post-install/ # (Future - TODO) | |
| 36 | 61 | │ └── presets/ | |
| 37 | 62 | │ └── barebone.packages # Minimal package list (~15 packages) | |
| 38 | 63 | ├── bin/ # (Future utilities) | |
| @@ -61,7 +86,7 @@ chmod +x install.sh | |||
| 61 | 86 | ./install.sh | |
| 62 | 87 | ``` | |
| 63 | 88 | ||
| 64 | - | **Note:** Currently in Phase 0 development. Full installation not yet available. | |
| 89 | + | **Note:** Phase 1 complete! The installer can now install a minimal bootable Arch Linux system. Ready for VM testing. | |
| 65 | 90 | ||
| 66 | 91 | --- | |
| 67 | 92 | ||
| @@ -79,17 +104,32 @@ make check-syntax | |||
| 79 | 104 | make check-shellcheck | |
| 80 | 105 | ``` | |
| 81 | 106 | ||
| 82 | - | ### Testing Installation (Phase 0) | |
| 83 | - | Currently in development. To test Phase 0: | |
| 107 | + | ### Testing Installation (Phase 1) | |
| 108 | + | To test the installer in a VM (QEMU/KVM recommended): | |
| 84 | 109 | ||
| 85 | 110 | ```bash | |
| 111 | + | # Boot Arch ISO in VM with UEFI enabled | |
| 112 | + | # Connect to internet | |
| 113 | + | # Download archup | |
| 114 | + | git clone https://github.com/bnema/archup.git | |
| 115 | + | cd archup | |
| 116 | + | ||
| 86 | 117 | # Set the archup path | |
| 87 | - | export ARCHUP_PATH=/path/to/archup | |
| 118 | + | export ARCHUP_PATH=$(pwd) | |
| 88 | 119 | ||
| 89 | - | # Run the installer (currently just tests helpers) | |
| 90 | - | ./install.sh | |
| 120 | + | # Run the installer | |
| 121 | + | sudo ./install.sh | |
| 91 | 122 | ``` | |
| 92 | 123 | ||
| 124 | + | **What the installer does:** | |
| 125 | + | 1. Validates system (vanilla Arch ISO, UEFI, x86_64) | |
| 126 | + | 2. Selects installation disk (auto-partitions with GPT) | |
| 127 | + | 3. Formats partitions (FAT32 EFI + ext4 root) | |
| 128 | + | 4. Installs ~15 base packages with pacstrap | |
| 129 | + | 5. Configures system (timezone, locale, hostname, user) | |
| 130 | + | 6. Installs systemd-boot bootloader | |
| 131 | + | 7. Creates bootable minimal Arch system | |
| 132 | + | ||
| 93 | 133 | ## Environment Variables | |
| 94 | 134 | ||
| 95 | 135 | - `ARCHUP_PATH` - Installation directory (default: `$HOME/.local/share/archup`) | |
| @@ -98,12 +138,12 @@ export ARCHUP_PATH=/path/to/archup | |||
| 98 | 138 | ||
| 99 | 139 | ## Next Steps | |
| 100 | 140 | ||
| 101 | - | **Phase 1: Preflight Validation** (Week 1) | |
| 102 | - | - [ ] Guards (vanilla Arch check) | |
| 103 | - | - [ ] UEFI check | |
| 104 | - | - [ ] x86_64 architecture check | |
| 105 | - | - [ ] Secure Boot disabled check | |
| 106 | - | - [ ] Begin installation (display logo, start log) | |
| 141 | + | **Phase 2: Add btrfs + LUKS Encryption** (Week 2-3) | |
| 142 | + | - [ ] Replace ext4 with btrfs filesystem | |
| 143 | + | - [ ] Add LUKS full-disk encryption option | |
| 144 | + | - [ ] Configure Argon2id with 2000ms iteration time | |
| 145 | + | - [ ] Create btrfs subvolumes (@ for root, @home for home) | |
| 146 | + | - [ ] Update bootloader for encrypted boot | |
| 107 | 147 | ||
| 108 | 148 | ## Reference | |
| 109 | 149 | ||
| @@ -5,13 +5,21 @@ | |||||
| 5 | ## Project Status | 5 | ## Project Status | ||
| 6 | 6 | ||||
| 7 | ✅ **Phase 0: Core Infrastructure - COMPLETE** | 7 | ✅ **Phase 0: Core Infrastructure - COMPLETE** | ||
| 8 | + | ✅ **Phase 1: Barebone Installer - Basic - COMPLETE** | |||
| 8 | 9 | ||||
| 9 | ### Completed | 10 | ### Completed | ||
| 10 | - ✅ Project structure created | 11 | - ✅ Project structure created | ||
| 11 | - ✅ Helper utilities implemented (logging, errors, presentation, chroot) | 12 | - ✅ Helper utilities implemented (logging, errors, presentation, chroot) | ||
| 12 | - ✅ Main orchestrator (install.sh) | 13 | - ✅ Main orchestrator (install.sh) | ||
| 13 | - | - ✅ Barebone package list | 14 | + | - ✅ Barebone package list (~15 packages) |
| 14 | - ✅ Logo designed | 15 | - ✅ Logo designed | ||
| 16 | + | - ✅ System guards (vanilla Arch, UEFI, x86_64, Secure Boot checks) | |||
| 17 | + | - ✅ Bootloader selection (systemd-boot or limine) | |||
| 18 | + | - ✅ Auto-partitioning (GPT, EFI + root with ext4) | |||
| 19 | + | - ✅ Base system installation (pacstrap + fstab) | |||
| 20 | + | - ✅ System configuration (timezone, locale, hostname, user creation) | |||
| 21 | + | - ✅ Network configuration (systemd-networkd + iwd) | |||
| 22 | + | - ✅ Bootloader installation (systemd-boot with boot entries) | |||
| 15 | 23 | ||||
| 16 | ### Project Structure | 24 | ### Project Structure | ||
| 17 | ``` | 25 | ``` | ||
| @@ -26,13 +34,30 @@ archup/ | |||||
| 26 | │ │ ├── errors.sh # Trap handlers, error display | 34 | │ │ ├── errors.sh # Trap handlers, error display | ||
| 27 | │ │ ├── presentation.sh # UI helpers (cursor, colors) | 35 | │ │ ├── presentation.sh # UI helpers (cursor, colors) | ||
| 28 | │ │ └── chroot.sh # Chroot utilities | 36 | │ │ └── chroot.sh # Chroot utilities | ||
| 29 | - | │ ├── preflight/ # (Phase 1 - TODO) | 37 | + | │ ├── preflight/ # Phase 1 ✅ |
| 30 | - | │ ├── partitioning/ # (Phase 2 - TODO) | 38 | + | │ │ ├── all.sh # Preflight orchestrator |
| 31 | - | │ ├── base/ # (Phase 3 - TODO) | 39 | + | │ │ ├── guards.sh # System validation |
| 32 | - | │ ├── config/ # (Phase 4 - TODO) | 40 | + | │ │ └── begin.sh # Welcome and bootloader selection |
| 33 | - | │ ├── security/ # (Phase 5 - TODO) | 41 | + | │ ├── partitioning/ # Phase 1 ✅ |
| 34 | - | │ ├── bootloader/ # (Phase 6 - TODO) | 42 | + | │ │ ├── all.sh # Partitioning orchestrator |
| 35 | - | │ ├── post-install/ # (Phase 7 - TODO) | 43 | + | │ │ ├── detect-disk.sh # Disk selection |
| 44 | + | │ │ ├── partition.sh # GPT partitioning (EFI + root) | |||
| 45 | + | │ │ ├── format.sh # Format as FAT32 + ext4 | |||
| 46 | + | │ │ └── mount.sh # Mount partitions to /mnt | |||
| 47 | + | │ ├── base/ # Phase 1 ✅ | |||
| 48 | + | │ │ ├── all.sh # Base installation orchestrator | |||
| 49 | + | │ │ ├── pacstrap.sh # Install base packages | |||
| 50 | + | │ │ └── fstab.sh # Generate fstab | |||
| 51 | + | │ ├── config/ # Phase 1 ✅ | |||
| 52 | + | │ │ ├── all.sh # Configuration orchestrator | |||
| 53 | + | │ │ ├── system.sh # Timezone, locale, hostname | |||
| 54 | + | │ │ ├── user.sh # User creation and sudo setup | |||
| 55 | + | │ │ └── network.sh # Network configuration | |||
| 56 | + | │ ├── boot/ # Phase 1 ✅ | |||
| 57 | + | │ │ ├── all.sh # Bootloader orchestrator | |||
| 58 | + | │ │ └── systemd-boot.sh # systemd-boot installation | |||
| 59 | + | │ ├── security/ # (Future - TODO) | |||
| 60 | + | │ ├── post-install/ # (Future - TODO) | |||
| 36 | │ └── presets/ | 61 | │ └── presets/ | ||
| 37 | │ └── barebone.packages # Minimal package list (~15 packages) | 62 | │ └── barebone.packages # Minimal package list (~15 packages) | ||
| 38 | ├── bin/ # (Future utilities) | 63 | ├── bin/ # (Future utilities) | ||
| @@ -61,7 +86,7 @@ chmod +x install.sh | |||||
| 61 | ./install.sh | 86 | ./install.sh | ||
| 62 | ``` | 87 | ``` | ||
| 63 | 88 | ||||
| 64 | - | **Note:** Currently in Phase 0 development. Full installation not yet available. | 89 | + | **Note:** Phase 1 complete! The installer can now install a minimal bootable Arch Linux system. Ready for VM testing. |
| 65 | 90 | ||||
| 66 | --- | 91 | --- | ||
| 67 | 92 | ||||
| @@ -79,17 +104,32 @@ make check-syntax | |||||
| 79 | make check-shellcheck | 104 | make check-shellcheck | ||
| 80 | ``` | 105 | ``` | ||
| 81 | 106 | ||||
| 82 | - | ### Testing Installation (Phase 0) | 107 | + | ### Testing Installation (Phase 1) |
| 83 | - | Currently in development. To test Phase 0: | 108 | + | To test the installer in a VM (QEMU/KVM recommended): |
| 84 | 109 | ||||
| 85 | ```bash | 110 | ```bash | ||
| 111 | + | # Boot Arch ISO in VM with UEFI enabled | |||
| 112 | + | # Connect to internet | |||
| 113 | + | # Download archup | |||
| 114 | + | git clone https://github.com/bnema/archup.git | |||
| 115 | + | cd archup | |||
| 116 | + | ||||
| 86 | # Set the archup path | 117 | # Set the archup path | ||
| 87 | - | export ARCHUP_PATH=/path/to/archup | 118 | + | export ARCHUP_PATH=$(pwd) |
| 88 | 119 | ||||
| 89 | - | # Run the installer (currently just tests helpers) | 120 | + | # Run the installer |
| 90 | - | ./install.sh | 121 | + | sudo ./install.sh |
| 91 | ``` | 122 | ``` | ||
| 92 | 123 | ||||
| 124 | + | **What the installer does:** | |||
| 125 | + | 1. Validates system (vanilla Arch ISO, UEFI, x86_64) | |||
| 126 | + | 2. Selects installation disk (auto-partitions with GPT) | |||
| 127 | + | 3. Formats partitions (FAT32 EFI + ext4 root) | |||
| 128 | + | 4. Installs ~15 base packages with pacstrap | |||
| 129 | + | 5. Configures system (timezone, locale, hostname, user) | |||
| 130 | + | 6. Installs systemd-boot bootloader | |||
| 131 | + | 7. Creates bootable minimal Arch system | |||
| 132 | + | ||||
| 93 | ## Environment Variables | 133 | ## Environment Variables | ||
| 94 | 134 | ||||
| 95 | - `ARCHUP_PATH` - Installation directory (default: `$HOME/.local/share/archup`) | 135 | - `ARCHUP_PATH` - Installation directory (default: `$HOME/.local/share/archup`) | ||
| @@ -98,12 +138,12 @@ export ARCHUP_PATH=/path/to/archup | |||||
| 98 | 138 | ||||
| 99 | ## Next Steps | 139 | ## Next Steps | ||
| 100 | 140 | ||||
| 101 | - | **Phase 1: Preflight Validation** (Week 1) | 141 | + | **Phase 2: Add btrfs + LUKS Encryption** (Week 2-3) |
| 102 | - | - [ ] Guards (vanilla Arch check) | 142 | + | - [ ] Replace ext4 with btrfs filesystem |
| 103 | - | - [ ] UEFI check | 143 | + | - [ ] Add LUKS full-disk encryption option |
| 104 | - | - [ ] x86_64 architecture check | 144 | + | - [ ] Configure Argon2id with 2000ms iteration time |
| 105 | - | - [ ] Secure Boot disabled check | 145 | + | - [ ] Create btrfs subvolumes (@ for root, @home for home) |
| 106 | - | - [ ] Begin installation (display logo, start log) | 146 | + | - [ ] Update bootloader for encrypted boot |
| 107 | 147 | ||||
| 108 | ## Reference | 148 | ## Reference | ||
| 109 | 149 | ||||
M install.sh +31 -27
| @@ -17,34 +17,38 @@ source "$ARCHUP_INSTALL/helpers/all.sh" | |||
| 17 | 17 | clear_logo | |
| 18 | 18 | start_install_log | |
| 19 | 19 | ||
| 20 | - | # Phase 0 test: Display welcome message | |
| 21 | - | gum style --foreground 4 --padding "1 0 1 $PADDING_LEFT" "Welcome to archup!" | |
| 22 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Phase 0: Testing helper utilities..." | |
| 23 | - | ||
| 24 | - | # Test logging | |
| 25 | - | echo "Testing logging functionality..." | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 26 | - | sleep 1 | |
| 27 | - | ||
| 28 | - | # Test gum styling | |
| 29 | - | gum style --foreground 2 --padding "1 0 0 $PADDING_LEFT" "✓ Helpers loaded successfully" | |
| 30 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Logging initialized" | |
| 31 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Error handling ready" | |
| 32 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Presentation utilities working" | |
| 33 | - | ||
| 34 | - | # Test confirmation prompt | |
| 35 | - | if gum confirm "Continue with Phase 0 test?"; then | |
| 36 | - | gum style --foreground 4 --padding "1 0 0 $PADDING_LEFT" "Great! Phase 0 infrastructure is ready." | |
| 37 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Next steps:" | |
| 38 | - | gum style --padding "0 0 0 $PADDING_LEFT" " • Phase 1: Preflight validation" | |
| 39 | - | gum style --padding "0 0 0 $PADDING_LEFT" " • Phase 2: Partitioning & encryption" | |
| 40 | - | gum style --padding "0 0 0 $PADDING_LEFT" " • Phase 3: Base installation" | |
| 41 | - | echo | |
| 42 | - | else | |
| 43 | - | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user" | |
| 44 | - | exit 0 | |
| 45 | - | fi | |
| 20 | + | # ============================================================ | |
| 21 | + | # PHASE 1: BAREBONE INSTALLER - BASIC | |
| 22 | + | # ============================================================ | |
| 23 | + | ||
| 24 | + | # Preflight validation | |
| 25 | + | source "$ARCHUP_INSTALL/preflight/all.sh" | |
| 26 | + | ||
| 27 | + | # Partitioning (auto GPT, ext4, no encryption) | |
| 28 | + | source "$ARCHUP_INSTALL/partitioning/all.sh" | |
| 29 | + | ||
| 30 | + | # Base system installation | |
| 31 | + | source "$ARCHUP_INSTALL/base/all.sh" | |
| 32 | + | ||
| 33 | + | # System configuration | |
| 34 | + | source "$ARCHUP_INSTALL/config/all.sh" | |
| 35 | + | ||
| 36 | + | # Bootloader installation | |
| 37 | + | source "$ARCHUP_INSTALL/boot/all.sh" | |
| 38 | + | ||
| 39 | + | # ============================================================ | |
| 40 | + | # FUTURE PHASES (TO BE IMPLEMENTED) | |
| 41 | + | # ============================================================ | |
| 42 | + | # Phase 2: Add btrfs + LUKS encryption | |
| 43 | + | # Phase 3: Add Limine bootloader option | |
| 44 | + | # Phase 4: Kernel selection + microcode | |
| 45 | + | # Phase 5: Repository setup (AUR + Chaotic) | |
| 46 | + | # Phase 6: Barebone preset testing | |
| 47 | + | # Phase 7: Default preset (GUI) | |
| 46 | 48 | ||
| 47 | 49 | # Stop logging and cleanup | |
| 48 | 50 | stop_install_log | |
| 49 | 51 | ||
| 50 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "Phase 0 complete! ✓" | |
| 52 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "ArchUp installation complete!" | |
| 53 | + | gum style --padding "0 0 0 $PADDING_LEFT" "You can now reboot into your new Arch Linux system." | |
| 54 | + | echo | |
| @@ -17,34 +17,38 @@ source "$ARCHUP_INSTALL/helpers/all.sh" | |||||
| 17 | clear_logo | 17 | clear_logo | ||
| 18 | start_install_log | 18 | start_install_log | ||
| 19 | 19 | ||||
| 20 | - | # Phase 0 test: Display welcome message | 20 | + | # ============================================================ |
| 21 | - | gum style --foreground 4 --padding "1 0 1 $PADDING_LEFT" "Welcome to archup!" | 21 | + | # PHASE 1: BAREBONE INSTALLER - BASIC |
| 22 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Phase 0: Testing helper utilities..." | 22 | + | # ============================================================ |
| 23 | - | 23 | + | ||
| 24 | - | # Test logging | 24 | + | # Preflight validation |
| 25 | - | echo "Testing logging functionality..." | tee -a "$ARCHUP_INSTALL_LOG_FILE" | 25 | + | source "$ARCHUP_INSTALL/preflight/all.sh" |
| 26 | - | sleep 1 | 26 | + | |
| 27 | - | 27 | + | # Partitioning (auto GPT, ext4, no encryption) | |
| 28 | - | # Test gum styling | 28 | + | source "$ARCHUP_INSTALL/partitioning/all.sh" |
| 29 | - | gum style --foreground 2 --padding "1 0 0 $PADDING_LEFT" "✓ Helpers loaded successfully" | 29 | + | |
| 30 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Logging initialized" | 30 | + | # Base system installation |
| 31 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Error handling ready" | 31 | + | source "$ARCHUP_INSTALL/base/all.sh" |
| 32 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Presentation utilities working" | 32 | + | |
| 33 | - | 33 | + | # System configuration | |
| 34 | - | # Test confirmation prompt | 34 | + | source "$ARCHUP_INSTALL/config/all.sh" |
| 35 | - | if gum confirm "Continue with Phase 0 test?"; then | 35 | + | |
| 36 | - | gum style --foreground 4 --padding "1 0 0 $PADDING_LEFT" "Great! Phase 0 infrastructure is ready." | 36 | + | # Bootloader installation |
| 37 | - | gum style --padding "0 0 0 $PADDING_LEFT" "Next steps:" | 37 | + | source "$ARCHUP_INSTALL/boot/all.sh" |
| 38 | - | gum style --padding "0 0 0 $PADDING_LEFT" " • Phase 1: Preflight validation" | 38 | + | |
| 39 | - | gum style --padding "0 0 0 $PADDING_LEFT" " • Phase 2: Partitioning & encryption" | 39 | + | # ============================================================ |
| 40 | - | gum style --padding "0 0 0 $PADDING_LEFT" " • Phase 3: Base installation" | 40 | + | # FUTURE PHASES (TO BE IMPLEMENTED) |
| 41 | - | echo | 41 | + | # ============================================================ |
| 42 | - | else | 42 | + | # Phase 2: Add btrfs + LUKS encryption |
| 43 | - | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user" | 43 | + | # Phase 3: Add Limine bootloader option |
| 44 | - | exit 0 | 44 | + | # Phase 4: Kernel selection + microcode |
| 45 | - | fi | 45 | + | # Phase 5: Repository setup (AUR + Chaotic) |
| 46 | + | # Phase 6: Barebone preset testing | |||
| 47 | + | # Phase 7: Default preset (GUI) | |||
| 46 | 48 | ||||
| 47 | # Stop logging and cleanup | 49 | # Stop logging and cleanup | ||
| 48 | stop_install_log | 50 | stop_install_log | ||
| 49 | 51 | ||||
| 50 | - | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "Phase 0 complete! ✓" | 52 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "ArchUp installation complete!" |
| 53 | + | gum style --padding "0 0 0 $PADDING_LEFT" "You can now reboot into your new Arch Linux system." | |||
| 54 | + | echo | |||
A install/base/all.sh +5 -0
| @@ -0,0 +1,5 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Base installation phase orchestrator | |
| 3 | + | ||
| 4 | + | run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" | |
| 5 | + | run_logged "$ARCHUP_INSTALL/base/fstab.sh" | |
| @@ -0,0 +1,5 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Base installation phase orchestrator | |||
| 3 | + | ||||
| 4 | + | run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" | |||
| 5 | + | run_logged "$ARCHUP_INSTALL/base/fstab.sh" | |||
A install/base/fstab.sh +11 -0
| @@ -0,0 +1,11 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Generate fstab | |
| 3 | + | ||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Generating fstab..." | |
| 5 | + | ||
| 6 | + | # Generate fstab using UUIDs | |
| 7 | + | genfstab -U /mnt >> /mnt/etc/fstab | |
| 8 | + | ||
| 9 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ fstab generated" | |
| 10 | + | ||
| 11 | + | echo "Generated /etc/fstab" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -0,0 +1,11 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Generate fstab | |||
| 3 | + | ||||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Generating fstab..." | |||
| 5 | + | ||||
| 6 | + | # Generate fstab using UUIDs | |||
| 7 | + | genfstab -U /mnt >> /mnt/etc/fstab | |||
| 8 | + | ||||
| 9 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ fstab generated" | |||
| 10 | + | ||||
| 11 | + | echo "Generated /etc/fstab" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
A install/base/pacstrap.sh +15 -0
| @@ -0,0 +1,15 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Install base system with pacstrap | |
| 3 | + | ||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing base system..." | |
| 5 | + | gum style --padding "0 0 1 $PADDING_LEFT" "This may take a few minutes..." | |
| 6 | + | ||
| 7 | + | # Read barebone package list | |
| 8 | + | mapfile -t packages < <(grep -v '^#' "$ARCHUP_INSTALL/presets/barebone.packages" | grep -v '^$') | |
| 9 | + | ||
| 10 | + | # Install base system | |
| 11 | + | pacstrap /mnt "${packages[@]}" | |
| 12 | + | ||
| 13 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Base system installed" | |
| 14 | + | ||
| 15 | + | echo "Installed ${#packages[@]} packages" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -0,0 +1,15 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Install base system with pacstrap | |||
| 3 | + | ||||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing base system..." | |||
| 5 | + | gum style --padding "0 0 1 $PADDING_LEFT" "This may take a few minutes..." | |||
| 6 | + | ||||
| 7 | + | # Read barebone package list | |||
| 8 | + | mapfile -t packages < <(grep -v '^#' "$ARCHUP_INSTALL/presets/barebone.packages" | grep -v '^$') | |||
| 9 | + | ||||
| 10 | + | # Install base system | |||
| 11 | + | pacstrap /mnt "${packages[@]}" | |||
| 12 | + | ||||
| 13 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Base system installed" | |||
| 14 | + | ||||
| 15 | + | echo "Installed ${#packages[@]} packages" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
A install/boot/all.sh +11 -0
| @@ -0,0 +1,11 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Bootloader phase orchestrator | |
| 3 | + | # Phase 1: systemd-boot only (Limine support comes in Phase 3) | |
| 4 | + | ||
| 5 | + | if [ "$ARCHUP_BOOTLOADER" = "systemd-boot" ]; then | |
| 6 | + | run_logged "$ARCHUP_INSTALL/boot/systemd-boot.sh" | |
| 7 | + | else | |
| 8 | + | # For Phase 1, we only support systemd-boot | |
| 9 | + | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Note: Limine support coming in Phase 3. Installing systemd-boot..." | |
| 10 | + | run_logged "$ARCHUP_INSTALL/boot/systemd-boot.sh" | |
| 11 | + | fi | |
| @@ -0,0 +1,11 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Bootloader phase orchestrator | |||
| 3 | + | # Phase 1: systemd-boot only (Limine support comes in Phase 3) | |||
| 4 | + | ||||
| 5 | + | if [ "$ARCHUP_BOOTLOADER" = "systemd-boot" ]; then | |||
| 6 | + | run_logged "$ARCHUP_INSTALL/boot/systemd-boot.sh" | |||
| 7 | + | else | |||
| 8 | + | # For Phase 1, we only support systemd-boot | |||
| 9 | + | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Note: Limine support coming in Phase 3. Installing systemd-boot..." | |||
| 10 | + | run_logged "$ARCHUP_INSTALL/boot/systemd-boot.sh" | |||
| 11 | + | fi | |||
A install/boot/systemd-boot.sh +38 -0
| @@ -0,0 +1,38 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Install and configure systemd-boot | |
| 3 | + | ||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing systemd-boot..." | |
| 5 | + | ||
| 6 | + | # Install systemd-boot | |
| 7 | + | arch-chroot /mnt bootctl install | |
| 8 | + | ||
| 9 | + | # Get root partition UUID | |
| 10 | + | ROOT_UUID=$(blkid -s UUID -o value "$ARCHUP_ROOT_PART") | |
| 11 | + | ||
| 12 | + | # Create loader configuration | |
| 13 | + | cat > /mnt/boot/loader/loader.conf <<EOF | |
| 14 | + | default arch.conf | |
| 15 | + | timeout 3 | |
| 16 | + | console-mode max | |
| 17 | + | editor no | |
| 18 | + | EOF | |
| 19 | + | ||
| 20 | + | # Create boot entry | |
| 21 | + | cat > /mnt/boot/loader/entries/arch.conf <<EOF | |
| 22 | + | title Arch Linux | |
| 23 | + | linux /vmlinuz-linux | |
| 24 | + | initrd /initramfs-linux.img | |
| 25 | + | options root=UUID=$ROOT_UUID rw | |
| 26 | + | EOF | |
| 27 | + | ||
| 28 | + | # Create fallback boot entry | |
| 29 | + | cat > /mnt/boot/loader/entries/arch-fallback.conf <<EOF | |
| 30 | + | title Arch Linux (fallback) | |
| 31 | + | linux /vmlinuz-linux | |
| 32 | + | initrd /initramfs-linux-fallback.img | |
| 33 | + | options root=UUID=$ROOT_UUID rw | |
| 34 | + | EOF | |
| 35 | + | ||
| 36 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ systemd-boot installed and configured" | |
| 37 | + | ||
| 38 | + | echo "Installed systemd-boot with root UUID: $ROOT_UUID" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -0,0 +1,38 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Install and configure systemd-boot | |||
| 3 | + | ||||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing systemd-boot..." | |||
| 5 | + | ||||
| 6 | + | # Install systemd-boot | |||
| 7 | + | arch-chroot /mnt bootctl install | |||
| 8 | + | ||||
| 9 | + | # Get root partition UUID | |||
| 10 | + | ROOT_UUID=$(blkid -s UUID -o value "$ARCHUP_ROOT_PART") | |||
| 11 | + | ||||
| 12 | + | # Create loader configuration | |||
| 13 | + | cat > /mnt/boot/loader/loader.conf <<EOF | |||
| 14 | + | default arch.conf | |||
| 15 | + | timeout 3 | |||
| 16 | + | console-mode max | |||
| 17 | + | editor no | |||
| 18 | + | EOF | |||
| 19 | + | ||||
| 20 | + | # Create boot entry | |||
| 21 | + | cat > /mnt/boot/loader/entries/arch.conf <<EOF | |||
| 22 | + | title Arch Linux | |||
| 23 | + | linux /vmlinuz-linux | |||
| 24 | + | initrd /initramfs-linux.img | |||
| 25 | + | options root=UUID=$ROOT_UUID rw | |||
| 26 | + | EOF | |||
| 27 | + | ||||
| 28 | + | # Create fallback boot entry | |||
| 29 | + | cat > /mnt/boot/loader/entries/arch-fallback.conf <<EOF | |||
| 30 | + | title Arch Linux (fallback) | |||
| 31 | + | linux /vmlinuz-linux | |||
| 32 | + | initrd /initramfs-linux-fallback.img | |||
| 33 | + | options root=UUID=$ROOT_UUID rw | |||
| 34 | + | EOF | |||
| 35 | + | ||||
| 36 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ systemd-boot installed and configured" | |||
| 37 | + | ||||
| 38 | + | echo "Installed systemd-boot with root UUID: $ROOT_UUID" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
A install/config/all.sh +6 -0
| @@ -0,0 +1,6 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Configuration phase orchestrator | |
| 3 | + | ||
| 4 | + | run_logged "$ARCHUP_INSTALL/config/system.sh" | |
| 5 | + | run_logged "$ARCHUP_INSTALL/config/user.sh" | |
| 6 | + | run_logged "$ARCHUP_INSTALL/config/network.sh" | |
| @@ -0,0 +1,6 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Configuration phase orchestrator | |||
| 3 | + | ||||
| 4 | + | run_logged "$ARCHUP_INSTALL/config/system.sh" | |||
| 5 | + | run_logged "$ARCHUP_INSTALL/config/user.sh" | |||
| 6 | + | run_logged "$ARCHUP_INSTALL/config/network.sh" | |||
A install/config/network.sh +34 -0
| @@ -0,0 +1,34 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Configure network (systemd-networkd + systemd-resolved) | |
| 3 | + | ||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring network..." | |
| 5 | + | ||
| 6 | + | # Enable systemd-networkd for DHCP | |
| 7 | + | mkdir -p /mnt/etc/systemd/network | |
| 8 | + | ||
| 9 | + | cat > /mnt/etc/systemd/network/20-wired.network <<EOF | |
| 10 | + | [Match] | |
| 11 | + | Name=en* | |
| 12 | + | ||
| 13 | + | [Network] | |
| 14 | + | DHCP=yes | |
| 15 | + | EOF | |
| 16 | + | ||
| 17 | + | cat > /mnt/etc/systemd/network/25-wireless.network <<EOF | |
| 18 | + | [Match] | |
| 19 | + | Name=wl* | |
| 20 | + | ||
| 21 | + | [Network] | |
| 22 | + | DHCP=yes | |
| 23 | + | EOF | |
| 24 | + | ||
| 25 | + | # Enable services | |
| 26 | + | arch-chroot /mnt systemctl enable systemd-networkd | |
| 27 | + | arch-chroot /mnt systemctl enable systemd-resolved | |
| 28 | + | ||
| 29 | + | # Enable iwd for WiFi | |
| 30 | + | arch-chroot /mnt systemctl enable iwd | |
| 31 | + | ||
| 32 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Network configured (DHCP)" | |
| 33 | + | ||
| 34 | + | echo "Enabled systemd-networkd and iwd" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -0,0 +1,34 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Configure network (systemd-networkd + systemd-resolved) | |||
| 3 | + | ||||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring network..." | |||
| 5 | + | ||||
| 6 | + | # Enable systemd-networkd for DHCP | |||
| 7 | + | mkdir -p /mnt/etc/systemd/network | |||
| 8 | + | ||||
| 9 | + | cat > /mnt/etc/systemd/network/20-wired.network <<EOF | |||
| 10 | + | [Match] | |||
| 11 | + | Name=en* | |||
| 12 | + | ||||
| 13 | + | [Network] | |||
| 14 | + | DHCP=yes | |||
| 15 | + | EOF | |||
| 16 | + | ||||
| 17 | + | cat > /mnt/etc/systemd/network/25-wireless.network <<EOF | |||
| 18 | + | [Match] | |||
| 19 | + | Name=wl* | |||
| 20 | + | ||||
| 21 | + | [Network] | |||
| 22 | + | DHCP=yes | |||
| 23 | + | EOF | |||
| 24 | + | ||||
| 25 | + | # Enable services | |||
| 26 | + | arch-chroot /mnt systemctl enable systemd-networkd | |||
| 27 | + | arch-chroot /mnt systemctl enable systemd-resolved | |||
| 28 | + | ||||
| 29 | + | # Enable iwd for WiFi | |||
| 30 | + | arch-chroot /mnt systemctl enable iwd | |||
| 31 | + | ||||
| 32 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Network configured (DHCP)" | |||
| 33 | + | ||||
| 34 | + | echo "Enabled systemd-networkd and iwd" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
A install/config/system.sh +52 -0
| @@ -0,0 +1,52 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # System configuration (timezone, locale, hostname) | |
| 3 | + | ||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "System Configuration" | |
| 5 | + | echo | |
| 6 | + | ||
| 7 | + | # Ask for timezone | |
| 8 | + | ARCHUP_TIMEZONE=$(gum input --placeholder "Enter timezone (e.g., America/New_York)" \ | |
| 9 | + | --prompt "Timezone: " \ | |
| 10 | + | --padding "0 0 0 $PADDING_LEFT") | |
| 11 | + | ||
| 12 | + | if [ -z "$ARCHUP_TIMEZONE" ]; then | |
| 13 | + | ARCHUP_TIMEZONE="UTC" | |
| 14 | + | fi | |
| 15 | + | ||
| 16 | + | # Set timezone | |
| 17 | + | arch-chroot /mnt ln -sf "/usr/share/zoneinfo/$ARCHUP_TIMEZONE" /etc/localtime | |
| 18 | + | arch-chroot /mnt hwclock --systohc | |
| 19 | + | ||
| 20 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Timezone set to: $ARCHUP_TIMEZONE" | |
| 21 | + | ||
| 22 | + | # Set locale to en_US.UTF-8 | |
| 23 | + | echo "en_US.UTF-8 UTF-8" > /mnt/etc/locale.gen | |
| 24 | + | arch-chroot /mnt locale-gen | |
| 25 | + | echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf | |
| 26 | + | ||
| 27 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Locale set to: en_US.UTF-8" | |
| 28 | + | ||
| 29 | + | # Ask for hostname | |
| 30 | + | ARCHUP_HOSTNAME=$(gum input --placeholder "Enter hostname" \ | |
| 31 | + | --prompt "Hostname: " \ | |
| 32 | + | --padding "0 0 0 $PADDING_LEFT") | |
| 33 | + | ||
| 34 | + | if [ -z "$ARCHUP_HOSTNAME" ]; then | |
| 35 | + | ARCHUP_HOSTNAME="archlinux" | |
| 36 | + | fi | |
| 37 | + | ||
| 38 | + | # Set hostname | |
| 39 | + | echo "$ARCHUP_HOSTNAME" > /mnt/etc/hostname | |
| 40 | + | ||
| 41 | + | # Configure hosts file | |
| 42 | + | cat > /mnt/etc/hosts <<EOF | |
| 43 | + | 127.0.0.1 localhost | |
| 44 | + | ::1 localhost | |
| 45 | + | 127.0.1.1 $ARCHUP_HOSTNAME.localdomain $ARCHUP_HOSTNAME | |
| 46 | + | EOF | |
| 47 | + | ||
| 48 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Hostname set to: $ARCHUP_HOSTNAME" | |
| 49 | + | ||
| 50 | + | echo "Timezone: $ARCHUP_TIMEZONE" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 51 | + | echo "Locale: en_US.UTF-8" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 52 | + | echo "Hostname: $ARCHUP_HOSTNAME" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -0,0 +1,52 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # System configuration (timezone, locale, hostname) | |||
| 3 | + | ||||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "System Configuration" | |||
| 5 | + | echo | |||
| 6 | + | ||||
| 7 | + | # Ask for timezone | |||
| 8 | + | ARCHUP_TIMEZONE=$(gum input --placeholder "Enter timezone (e.g., America/New_York)" \ | |||
| 9 | + | --prompt "Timezone: " \ | |||
| 10 | + | --padding "0 0 0 $PADDING_LEFT") | |||
| 11 | + | ||||
| 12 | + | if [ -z "$ARCHUP_TIMEZONE" ]; then | |||
| 13 | + | ARCHUP_TIMEZONE="UTC" | |||
| 14 | + | fi | |||
| 15 | + | ||||
| 16 | + | # Set timezone | |||
| 17 | + | arch-chroot /mnt ln -sf "/usr/share/zoneinfo/$ARCHUP_TIMEZONE" /etc/localtime | |||
| 18 | + | arch-chroot /mnt hwclock --systohc | |||
| 19 | + | ||||
| 20 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Timezone set to: $ARCHUP_TIMEZONE" | |||
| 21 | + | ||||
| 22 | + | # Set locale to en_US.UTF-8 | |||
| 23 | + | echo "en_US.UTF-8 UTF-8" > /mnt/etc/locale.gen | |||
| 24 | + | arch-chroot /mnt locale-gen | |||
| 25 | + | echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf | |||
| 26 | + | ||||
| 27 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Locale set to: en_US.UTF-8" | |||
| 28 | + | ||||
| 29 | + | # Ask for hostname | |||
| 30 | + | ARCHUP_HOSTNAME=$(gum input --placeholder "Enter hostname" \ | |||
| 31 | + | --prompt "Hostname: " \ | |||
| 32 | + | --padding "0 0 0 $PADDING_LEFT") | |||
| 33 | + | ||||
| 34 | + | if [ -z "$ARCHUP_HOSTNAME" ]; then | |||
| 35 | + | ARCHUP_HOSTNAME="archlinux" | |||
| 36 | + | fi | |||
| 37 | + | ||||
| 38 | + | # Set hostname | |||
| 39 | + | echo "$ARCHUP_HOSTNAME" > /mnt/etc/hostname | |||
| 40 | + | ||||
| 41 | + | # Configure hosts file | |||
| 42 | + | cat > /mnt/etc/hosts <<EOF | |||
| 43 | + | 127.0.0.1 localhost | |||
| 44 | + | ::1 localhost | |||
| 45 | + | 127.0.1.1 $ARCHUP_HOSTNAME.localdomain $ARCHUP_HOSTNAME | |||
| 46 | + | EOF | |||
| 47 | + | ||||
| 48 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Hostname set to: $ARCHUP_HOSTNAME" | |||
| 49 | + | ||||
| 50 | + | echo "Timezone: $ARCHUP_TIMEZONE" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
| 51 | + | echo "Locale: en_US.UTF-8" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
| 52 | + | echo "Hostname: $ARCHUP_HOSTNAME" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
A install/config/user.sh +50 -0
| @@ -0,0 +1,50 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # User creation and configuration | |
| 3 | + | ||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "User Account Setup" | |
| 5 | + | echo | |
| 6 | + | ||
| 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 | |
| 35 | + | ||
| 36 | + | # Create user with home directory | |
| 37 | + | arch-chroot /mnt useradd -m -G wheel -s /bin/bash "$ARCHUP_USERNAME" | |
| 38 | + | ||
| 39 | + | # Set user password | |
| 40 | + | echo "$ARCHUP_USERNAME:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd | |
| 41 | + | ||
| 42 | + | # Enable sudo for wheel group | |
| 43 | + | echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/etc/sudoers.d/wheel | |
| 44 | + | chmod 440 /mnt/etc/sudoers.d/wheel | |
| 45 | + | ||
| 46 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ User created: $ARCHUP_USERNAME" | |
| 47 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Sudo enabled for wheel group" | |
| 48 | + | ||
| 49 | + | echo "Created user: $ARCHUP_USERNAME" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 50 | + | echo "Enabled sudo for wheel group" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -0,0 +1,50 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # User creation and configuration | |||
| 3 | + | ||||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "User Account Setup" | |||
| 5 | + | echo | |||
| 6 | + | ||||
| 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 | |||
| 35 | + | ||||
| 36 | + | # Create user with home directory | |||
| 37 | + | arch-chroot /mnt useradd -m -G wheel -s /bin/bash "$ARCHUP_USERNAME" | |||
| 38 | + | ||||
| 39 | + | # Set user password | |||
| 40 | + | echo "$ARCHUP_USERNAME:$ARCHUP_PASSWORD" | arch-chroot /mnt chpasswd | |||
| 41 | + | ||||
| 42 | + | # Enable sudo for wheel group | |||
| 43 | + | echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/etc/sudoers.d/wheel | |||
| 44 | + | chmod 440 /mnt/etc/sudoers.d/wheel | |||
| 45 | + | ||||
| 46 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ User created: $ARCHUP_USERNAME" | |||
| 47 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Sudo enabled for wheel group" | |||
| 48 | + | ||||
| 49 | + | echo "Created user: $ARCHUP_USERNAME" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
| 50 | + | echo "Enabled sudo for wheel group" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
A install/partitioning/all.sh +7 -0
| @@ -0,0 +1,7 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Partitioning phase orchestrator | |
| 3 | + | ||
| 4 | + | run_logged "$ARCHUP_INSTALL/partitioning/detect-disk.sh" | |
| 5 | + | run_logged "$ARCHUP_INSTALL/partitioning/partition.sh" | |
| 6 | + | run_logged "$ARCHUP_INSTALL/partitioning/format.sh" | |
| 7 | + | run_logged "$ARCHUP_INSTALL/partitioning/mount.sh" | |
| @@ -0,0 +1,7 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Partitioning phase orchestrator | |||
| 3 | + | ||||
| 4 | + | run_logged "$ARCHUP_INSTALL/partitioning/detect-disk.sh" | |||
| 5 | + | run_logged "$ARCHUP_INSTALL/partitioning/partition.sh" | |||
| 6 | + | run_logged "$ARCHUP_INSTALL/partitioning/format.sh" | |||
| 7 | + | run_logged "$ARCHUP_INSTALL/partitioning/mount.sh" | |||
A install/partitioning/detect-disk.sh +36 -0
| @@ -0,0 +1,36 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Detect and select installation disk | |
| 3 | + | ||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Disk Selection" | |
| 5 | + | echo | |
| 6 | + | ||
| 7 | + | # List available disks | |
| 8 | + | mapfile -t disks < <(lsblk -dno NAME,SIZE,TYPE | grep disk | awk '{print "/dev/" $1 " (" $2 ")"}') | |
| 9 | + | ||
| 10 | + | if [ ${#disks[@]} -eq 0 ]; then | |
| 11 | + | gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "No disks found!" | |
| 12 | + | exit 1 | |
| 13 | + | fi | |
| 14 | + | ||
| 15 | + | # Let user select disk | |
| 16 | + | ARCHUP_DISK=$(gum choose "${disks[@]}" \ | |
| 17 | + | --header "Select installation disk (ALL DATA WILL BE ERASED):" \ | |
| 18 | + | --height $((${#disks[@]} + 3)) \ | |
| 19 | + | --padding "0 0 0 $PADDING_LEFT" | awk '{print $1}') | |
| 20 | + | ||
| 21 | + | export ARCHUP_DISK | |
| 22 | + | ||
| 23 | + | # Display selected disk info | |
| 24 | + | gum style --padding "1 0 0 $PADDING_LEFT" "Selected disk: $ARCHUP_DISK" | |
| 25 | + | lsblk "$ARCHUP_DISK" | while IFS= read -r line; do | |
| 26 | + | gum style --padding "0 0 0 $PADDING_LEFT" " $line" | |
| 27 | + | done | |
| 28 | + | echo | |
| 29 | + | ||
| 30 | + | # Final confirmation | |
| 31 | + | if ! gum confirm "WARNING: All data on $ARCHUP_DISK will be permanently erased. Continue?" --padding "0 0 1 $PADDING_LEFT"; then | |
| 32 | + | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user" | |
| 33 | + | exit 0 | |
| 34 | + | fi | |
| 35 | + | ||
| 36 | + | echo "Disk selected: $ARCHUP_DISK" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -0,0 +1,36 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Detect and select installation disk | |||
| 3 | + | ||||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Disk Selection" | |||
| 5 | + | echo | |||
| 6 | + | ||||
| 7 | + | # List available disks | |||
| 8 | + | mapfile -t disks < <(lsblk -dno NAME,SIZE,TYPE | grep disk | awk '{print "/dev/" $1 " (" $2 ")"}') | |||
| 9 | + | ||||
| 10 | + | if [ ${#disks[@]} -eq 0 ]; then | |||
| 11 | + | gum style --foreground 1 --padding "0 0 0 $PADDING_LEFT" "No disks found!" | |||
| 12 | + | exit 1 | |||
| 13 | + | fi | |||
| 14 | + | ||||
| 15 | + | # Let user select disk | |||
| 16 | + | ARCHUP_DISK=$(gum choose "${disks[@]}" \ | |||
| 17 | + | --header "Select installation disk (ALL DATA WILL BE ERASED):" \ | |||
| 18 | + | --height $((${#disks[@]} + 3)) \ | |||
| 19 | + | --padding "0 0 0 $PADDING_LEFT" | awk '{print $1}') | |||
| 20 | + | ||||
| 21 | + | export ARCHUP_DISK | |||
| 22 | + | ||||
| 23 | + | # Display selected disk info | |||
| 24 | + | gum style --padding "1 0 0 $PADDING_LEFT" "Selected disk: $ARCHUP_DISK" | |||
| 25 | + | lsblk "$ARCHUP_DISK" | while IFS= read -r line; do | |||
| 26 | + | gum style --padding "0 0 0 $PADDING_LEFT" " $line" | |||
| 27 | + | done | |||
| 28 | + | echo | |||
| 29 | + | ||||
| 30 | + | # Final confirmation | |||
| 31 | + | if ! gum confirm "WARNING: All data on $ARCHUP_DISK will be permanently erased. Continue?" --padding "0 0 1 $PADDING_LEFT"; then | |||
| 32 | + | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user" | |||
| 33 | + | exit 0 | |||
| 34 | + | fi | |||
| 35 | + | ||||
| 36 | + | echo "Disk selected: $ARCHUP_DISK" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
A install/partitioning/format.sh +15 -0
| @@ -0,0 +1,15 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Format partitions (ext4 for Phase 1, btrfs comes in Phase 2) | |
| 3 | + | ||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Formatting partitions..." | |
| 5 | + | ||
| 6 | + | # Format EFI partition as FAT32 | |
| 7 | + | mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART" | |
| 8 | + | ||
| 9 | + | # Format root partition as ext4 | |
| 10 | + | mkfs.ext4 -F -L ROOT "$ARCHUP_ROOT_PART" | |
| 11 | + | ||
| 12 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Partitions formatted" | |
| 13 | + | ||
| 14 | + | echo "Formatted $ARCHUP_EFI_PART as FAT32" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 15 | + | echo "Formatted $ARCHUP_ROOT_PART as ext4" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -0,0 +1,15 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Format partitions (ext4 for Phase 1, btrfs comes in Phase 2) | |||
| 3 | + | ||||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Formatting partitions..." | |||
| 5 | + | ||||
| 6 | + | # Format EFI partition as FAT32 | |||
| 7 | + | mkfs.fat -F32 -n EFI "$ARCHUP_EFI_PART" | |||
| 8 | + | ||||
| 9 | + | # Format root partition as ext4 | |||
| 10 | + | mkfs.ext4 -F -L ROOT "$ARCHUP_ROOT_PART" | |||
| 11 | + | ||||
| 12 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Partitions formatted" | |||
| 13 | + | ||||
| 14 | + | echo "Formatted $ARCHUP_EFI_PART as FAT32" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
| 15 | + | echo "Formatted $ARCHUP_ROOT_PART as ext4" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
A install/partitioning/mount.sh +16 -0
| @@ -0,0 +1,16 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Mount partitions to /mnt | |
| 3 | + | ||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Mounting partitions..." | |
| 5 | + | ||
| 6 | + | # Mount root partition | |
| 7 | + | mount "$ARCHUP_ROOT_PART" /mnt | |
| 8 | + | ||
| 9 | + | # Create and mount EFI directory | |
| 10 | + | mkdir -p /mnt/boot | |
| 11 | + | mount "$ARCHUP_EFI_PART" /mnt/boot | |
| 12 | + | ||
| 13 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Partitions mounted" | |
| 14 | + | ||
| 15 | + | echo "Mounted $ARCHUP_ROOT_PART to /mnt" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 16 | + | echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -0,0 +1,16 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Mount partitions to /mnt | |||
| 3 | + | ||||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Mounting partitions..." | |||
| 5 | + | ||||
| 6 | + | # Mount root partition | |||
| 7 | + | mount "$ARCHUP_ROOT_PART" /mnt | |||
| 8 | + | ||||
| 9 | + | # Create and mount EFI directory | |||
| 10 | + | mkdir -p /mnt/boot | |||
| 11 | + | mount "$ARCHUP_EFI_PART" /mnt/boot | |||
| 12 | + | ||||
| 13 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ Partitions mounted" | |||
| 14 | + | ||||
| 15 | + | echo "Mounted $ARCHUP_ROOT_PART to /mnt" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
| 16 | + | echo "Mounted $ARCHUP_EFI_PART to /mnt/boot" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
A install/partitioning/partition.sh +36 -0
| @@ -0,0 +1,36 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Auto-partition disk with GPT layout (EFI + root) | |
| 3 | + | ||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating partitions..." | |
| 5 | + | ||
| 6 | + | # Wipe disk and create GPT partition table | |
| 7 | + | wipefs -af "$ARCHUP_DISK" | |
| 8 | + | sgdisk --zap-all "$ARCHUP_DISK" | |
| 9 | + | ||
| 10 | + | # Create partitions | |
| 11 | + | # 1. EFI partition (512MB) | |
| 12 | + | # 2. Root partition (remaining space) | |
| 13 | + | sgdisk --clear \ | |
| 14 | + | --new=1:0:+512M --typecode=1:ef00 --change-name=1:"EFI" \ | |
| 15 | + | --new=2:0:0 --typecode=2:8300 --change-name=2:"ROOT" \ | |
| 16 | + | "$ARCHUP_DISK" | |
| 17 | + | ||
| 18 | + | # Inform kernel of partition changes | |
| 19 | + | partprobe "$ARCHUP_DISK" | |
| 20 | + | sleep 1 | |
| 21 | + | ||
| 22 | + | # Set partition variables | |
| 23 | + | if [[ "$ARCHUP_DISK" =~ nvme ]]; then | |
| 24 | + | export ARCHUP_EFI_PART="${ARCHUP_DISK}p1" | |
| 25 | + | export ARCHUP_ROOT_PART="${ARCHUP_DISK}p2" | |
| 26 | + | else | |
| 27 | + | export ARCHUP_EFI_PART="${ARCHUP_DISK}1" | |
| 28 | + | export ARCHUP_ROOT_PART="${ARCHUP_DISK}2" | |
| 29 | + | fi | |
| 30 | + | ||
| 31 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Partitions created" | |
| 32 | + | gum style --padding "0 0 0 $PADDING_LEFT" " EFI: $ARCHUP_EFI_PART (512MB)" | |
| 33 | + | gum style --padding "0 0 1 $PADDING_LEFT" " Root: $ARCHUP_ROOT_PART" | |
| 34 | + | ||
| 35 | + | echo "EFI partition: $ARCHUP_EFI_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 36 | + | echo "Root partition: $ARCHUP_ROOT_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -0,0 +1,36 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Auto-partition disk with GPT layout (EFI + root) | |||
| 3 | + | ||||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating partitions..." | |||
| 5 | + | ||||
| 6 | + | # Wipe disk and create GPT partition table | |||
| 7 | + | wipefs -af "$ARCHUP_DISK" | |||
| 8 | + | sgdisk --zap-all "$ARCHUP_DISK" | |||
| 9 | + | ||||
| 10 | + | # Create partitions | |||
| 11 | + | # 1. EFI partition (512MB) | |||
| 12 | + | # 2. Root partition (remaining space) | |||
| 13 | + | sgdisk --clear \ | |||
| 14 | + | --new=1:0:+512M --typecode=1:ef00 --change-name=1:"EFI" \ | |||
| 15 | + | --new=2:0:0 --typecode=2:8300 --change-name=2:"ROOT" \ | |||
| 16 | + | "$ARCHUP_DISK" | |||
| 17 | + | ||||
| 18 | + | # Inform kernel of partition changes | |||
| 19 | + | partprobe "$ARCHUP_DISK" | |||
| 20 | + | sleep 1 | |||
| 21 | + | ||||
| 22 | + | # Set partition variables | |||
| 23 | + | if [[ "$ARCHUP_DISK" =~ nvme ]]; then | |||
| 24 | + | export ARCHUP_EFI_PART="${ARCHUP_DISK}p1" | |||
| 25 | + | export ARCHUP_ROOT_PART="${ARCHUP_DISK}p2" | |||
| 26 | + | else | |||
| 27 | + | export ARCHUP_EFI_PART="${ARCHUP_DISK}1" | |||
| 28 | + | export ARCHUP_ROOT_PART="${ARCHUP_DISK}2" | |||
| 29 | + | fi | |||
| 30 | + | ||||
| 31 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Partitions created" | |||
| 32 | + | gum style --padding "0 0 0 $PADDING_LEFT" " EFI: $ARCHUP_EFI_PART (512MB)" | |||
| 33 | + | gum style --padding "0 0 1 $PADDING_LEFT" " Root: $ARCHUP_ROOT_PART" | |||
| 34 | + | ||||
| 35 | + | echo "EFI partition: $ARCHUP_EFI_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
| 36 | + | echo "Root partition: $ARCHUP_ROOT_PART" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
A install/preflight/all.sh +9 -0
| @@ -0,0 +1,9 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Preflight phase orchestrator | |
| 3 | + | # Sources all preflight scripts in order | |
| 4 | + | ||
| 5 | + | # Run guards (system validation) | |
| 6 | + | source "$ARCHUP_INSTALL/preflight/guards.sh" | |
| 7 | + | ||
| 8 | + | # Run begin (welcome and initial config) | |
| 9 | + | run_logged "$ARCHUP_INSTALL/preflight/begin.sh" | |
| @@ -0,0 +1,9 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Preflight phase orchestrator | |||
| 3 | + | # Sources all preflight scripts in order | |||
| 4 | + | ||||
| 5 | + | # Run guards (system validation) | |||
| 6 | + | source "$ARCHUP_INSTALL/preflight/guards.sh" | |||
| 7 | + | ||||
| 8 | + | # Run begin (welcome and initial config) | |||
| 9 | + | run_logged "$ARCHUP_INSTALL/preflight/begin.sh" | |||
A install/preflight/begin.sh +31 -0
| @@ -0,0 +1,31 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Begin archup installation | |
| 3 | + | # Display welcome message and gather initial configuration choices | |
| 4 | + | ||
| 5 | + | # Display welcome message | |
| 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" | |
| 8 | + | echo | |
| 9 | + | ||
| 10 | + | # Confirm installation start | |
| 11 | + | if ! gum confirm "Ready to begin installation?" --padding "0 0 1 $PADDING_LEFT"; then | |
| 12 | + | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user" | |
| 13 | + | exit 0 | |
| 14 | + | fi | |
| 15 | + | ||
| 16 | + | # Ask for bootloader preference (Phase 1 requirement) | |
| 17 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Bootloader Selection" | |
| 18 | + | gum style --padding "0 0 0 $PADDING_LEFT" "archup supports modern bootloaders for UEFI systems:" | |
| 19 | + | echo | |
| 20 | + | ||
| 21 | + | ARCHUP_BOOTLOADER=$(gum choose \ | |
| 22 | + | "systemd-boot" \ | |
| 23 | + | "limine" \ | |
| 24 | + | --header "Select bootloader:" \ | |
| 25 | + | --height 4 \ | |
| 26 | + | --padding "0 0 0 $PADDING_LEFT") | |
| 27 | + | ||
| 28 | + | export ARCHUP_BOOTLOADER | |
| 29 | + | echo "Selected bootloader: $ARCHUP_BOOTLOADER" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 30 | + | ||
| 31 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Configuration saved" | |
| @@ -0,0 +1,31 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Begin archup installation | |||
| 3 | + | # Display welcome message and gather initial configuration choices | |||
| 4 | + | ||||
| 5 | + | # Display welcome message | |||
| 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" | |||
| 8 | + | echo | |||
| 9 | + | ||||
| 10 | + | # Confirm installation start | |||
| 11 | + | if ! gum confirm "Ready to begin installation?" --padding "0 0 1 $PADDING_LEFT"; then | |||
| 12 | + | gum style --foreground 3 --padding "1 0 1 $PADDING_LEFT" "Installation cancelled by user" | |||
| 13 | + | exit 0 | |||
| 14 | + | fi | |||
| 15 | + | ||||
| 16 | + | # Ask for bootloader preference (Phase 1 requirement) | |||
| 17 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Bootloader Selection" | |||
| 18 | + | gum style --padding "0 0 0 $PADDING_LEFT" "archup supports modern bootloaders for UEFI systems:" | |||
| 19 | + | echo | |||
| 20 | + | ||||
| 21 | + | ARCHUP_BOOTLOADER=$(gum choose \ | |||
| 22 | + | "systemd-boot" \ | |||
| 23 | + | "limine" \ | |||
| 24 | + | --header "Select bootloader:" \ | |||
| 25 | + | --height 4 \ | |||
| 26 | + | --padding "0 0 0 $PADDING_LEFT") | |||
| 27 | + | ||||
| 28 | + | export ARCHUP_BOOTLOADER | |||
| 29 | + | echo "Selected bootloader: $ARCHUP_BOOTLOADER" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
| 30 | + | ||||
| 31 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Configuration saved" | |||
A install/preflight/guards.sh +41 -0
| @@ -0,0 +1,41 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Preflight guards for archup installer | |
| 3 | + | # Validates system requirements before installation | |
| 4 | + | ||
| 5 | + | abort() { | |
| 6 | + | gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "❌ archup install requires: $1" | |
| 7 | + | echo | |
| 8 | + | gum confirm "Proceed anyway on your own accord and without assistance?" --padding "0 0 0 $PADDING_LEFT" || exit 1 | |
| 9 | + | } | |
| 10 | + | ||
| 11 | + | gum style --foreground 4 --padding "1 0 0 $PADDING_LEFT" "Running preflight checks..." | |
| 12 | + | ||
| 13 | + | # Must be running from Arch ISO or vanilla Arch | |
| 14 | + | if [[ ! -f /etc/arch-release ]]; then | |
| 15 | + | abort "Vanilla Arch Linux or Arch ISO" | |
| 16 | + | fi | |
| 17 | + | ||
| 18 | + | # Must not be an Arch derivative distro | |
| 19 | + | for marker in /etc/cachyos-release /etc/eos-release /etc/garuda-release /etc/manjaro-release; do | |
| 20 | + | if [[ -f "$marker" ]]; then | |
| 21 | + | abort "Vanilla Arch (detected derivative distro)" | |
| 22 | + | fi | |
| 23 | + | done | |
| 24 | + | ||
| 25 | + | # Must be x86_64 architecture | |
| 26 | + | if [ "$(uname -m)" != "x86_64" ]; then | |
| 27 | + | abort "x86_64 CPU architecture" | |
| 28 | + | fi | |
| 29 | + | ||
| 30 | + | # Must have UEFI boot (check for EFI variables) | |
| 31 | + | if [[ ! -d /sys/firmware/efi/efivars ]]; then | |
| 32 | + | abort "UEFI boot mode (legacy BIOS not supported)" | |
| 33 | + | fi | |
| 34 | + | ||
| 35 | + | # Must have Secure Boot disabled | |
| 36 | + | if bootctl status 2>/dev/null | grep -q 'Secure Boot: enabled'; then | |
| 37 | + | abort "Secure Boot disabled" | |
| 38 | + | fi | |
| 39 | + | ||
| 40 | + | # Cleared all guards | |
| 41 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ All preflight checks passed" | |
| @@ -0,0 +1,41 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Preflight guards for archup installer | |||
| 3 | + | # Validates system requirements before installation | |||
| 4 | + | ||||
| 5 | + | abort() { | |||
| 6 | + | gum style --foreground 1 --padding "1 0 0 $PADDING_LEFT" "❌ archup install requires: $1" | |||
| 7 | + | echo | |||
| 8 | + | gum confirm "Proceed anyway on your own accord and without assistance?" --padding "0 0 0 $PADDING_LEFT" || exit 1 | |||
| 9 | + | } | |||
| 10 | + | ||||
| 11 | + | gum style --foreground 4 --padding "1 0 0 $PADDING_LEFT" "Running preflight checks..." | |||
| 12 | + | ||||
| 13 | + | # Must be running from Arch ISO or vanilla Arch | |||
| 14 | + | if [[ ! -f /etc/arch-release ]]; then | |||
| 15 | + | abort "Vanilla Arch Linux or Arch ISO" | |||
| 16 | + | fi | |||
| 17 | + | ||||
| 18 | + | # Must not be an Arch derivative distro | |||
| 19 | + | for marker in /etc/cachyos-release /etc/eos-release /etc/garuda-release /etc/manjaro-release; do | |||
| 20 | + | if [[ -f "$marker" ]]; then | |||
| 21 | + | abort "Vanilla Arch (detected derivative distro)" | |||
| 22 | + | fi | |||
| 23 | + | done | |||
| 24 | + | ||||
| 25 | + | # Must be x86_64 architecture | |||
| 26 | + | if [ "$(uname -m)" != "x86_64" ]; then | |||
| 27 | + | abort "x86_64 CPU architecture" | |||
| 28 | + | fi | |||
| 29 | + | ||||
| 30 | + | # Must have UEFI boot (check for EFI variables) | |||
| 31 | + | if [[ ! -d /sys/firmware/efi/efivars ]]; then | |||
| 32 | + | abort "UEFI boot mode (legacy BIOS not supported)" | |||
| 33 | + | fi | |||
| 34 | + | ||||
| 35 | + | # Must have Secure Boot disabled | |||
| 36 | + | if bootctl status 2>/dev/null | grep -q 'Secure Boot: enabled'; then | |||
| 37 | + | abort "Secure Boot disabled" | |||
| 38 | + | fi | |||
| 39 | + | ||||
| 40 | + | # Cleared all guards | |||
| 41 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "✓ All preflight checks passed" | |||