feat(repos): implement Phase 5 with AUR support (yay) and Chaotic-AUR repository
- commit
- b2d4a255c9dfc28f6420a77eb772819fa7a934db
- author
- bnema · · 2025-10-19 07:49 UTC
- parent
- 763f191
- signature
- unsigned
6 files · +124 -12
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; 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 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; 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 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; 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 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; 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 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 +10 -6
| @@ -9,6 +9,7 @@ | |||
| 9 | 9 | ✅ **Phase 2: Add btrfs + LUKS Encryption - COMPLETE** | |
| 10 | 10 | ✅ **Phase 3: Limine Bootloader - COMPLETE** | |
| 11 | 11 | ✅ **Phase 4: Kernel Selection + Microcode - COMPLETE** | |
| 12 | + | ✅ **Phase 5: Repository Setup (AUR + Chaotic) - COMPLETE** | |
| 12 | 13 | ||
| 13 | 14 | ### Completed | |
| 14 | 15 | - ✅ Project structure created | |
| @@ -29,6 +30,8 @@ | |||
| 29 | 30 | - ✅ Kernel selection (linux, linux-lts, linux-zen) | |
| 30 | 31 | - ✅ Auto-detected CPU microcode (intel-ucode or amd-ucode) | |
| 31 | 32 | - ✅ AMD P-State driver selection (active/guided/passive) | |
| 33 | + | - ✅ Optional AUR support (yay helper installation) | |
| 34 | + | - ✅ Optional Chaotic-AUR repository | |
| 32 | 35 | ||
| 33 | 36 | ### Project Structure | |
| 34 | 37 | ``` | |
| @@ -142,7 +145,9 @@ sudo ./install.sh | |||
| 142 | 145 | 9. Installs base packages with pacstrap (kernel + microcode + cryptsetup if encrypted) | |
| 143 | 146 | 10. Configures system (timezone, locale, hostname, user) | |
| 144 | 147 | 11. Installs Limine bootloader (with encryption and AMD tuning if enabled) | |
| 145 | - | 12. Creates bootable minimal Arch system with btrfs | |
| 148 | + | 12. Optionally installs yay AUR helper (if user enables AUR support) | |
| 149 | + | 13. Optionally adds Chaotic-AUR repository (pre-built AUR packages) | |
| 150 | + | 14. Creates bootable minimal Arch system with btrfs | |
| 146 | 151 | ||
| 147 | 152 | ## Environment Variables | |
| 148 | 153 | ||
| @@ -152,11 +157,10 @@ sudo ./install.sh | |||
| 152 | 157 | ||
| 153 | 158 | ## Next Steps | |
| 154 | 159 | ||
| 155 | - | **Phase 5: Repository Setup (AUR + Chaotic)** (Week 3-4) | |
| 156 | - | - [ ] Ask user to enable AUR support (install yay) | |
| 157 | - | - [ ] Ask user to enable Chaotic-AUR repository | |
| 158 | - | - [ ] Test yay installation from AUR | |
| 159 | - | - [ ] Test Chaotic-AUR package installation | |
| 160 | + | **Phase 6: Barebone Preset Complete + Testing** (Week 4) | |
| 161 | + | - [ ] Add keyboard layout + WiFi migration from ISO | |
| 162 | + | - [ ] Test matrix for all combinations | |
| 163 | + | - [ ] Production-ready barebone installer | |
| 160 | 164 | ||
| 161 | 165 | ## Reference | |
| 162 | 166 | ||
| @@ -9,6 +9,7 @@ | |||||
| 9 | ✅ **Phase 2: Add btrfs + LUKS Encryption - COMPLETE** | 9 | ✅ **Phase 2: Add btrfs + LUKS Encryption - COMPLETE** | ||
| 10 | ✅ **Phase 3: Limine Bootloader - COMPLETE** | 10 | ✅ **Phase 3: Limine Bootloader - COMPLETE** | ||
| 11 | ✅ **Phase 4: Kernel Selection + Microcode - COMPLETE** | 11 | ✅ **Phase 4: Kernel Selection + Microcode - COMPLETE** | ||
| 12 | + | ✅ **Phase 5: Repository Setup (AUR + Chaotic) - COMPLETE** | |||
| 12 | 13 | ||||
| 13 | ### Completed | 14 | ### Completed | ||
| 14 | - ✅ Project structure created | 15 | - ✅ Project structure created | ||
| @@ -29,6 +30,8 @@ | |||||
| 29 | - ✅ Kernel selection (linux, linux-lts, linux-zen) | 30 | - ✅ Kernel selection (linux, linux-lts, linux-zen) | ||
| 30 | - ✅ Auto-detected CPU microcode (intel-ucode or amd-ucode) | 31 | - ✅ Auto-detected CPU microcode (intel-ucode or amd-ucode) | ||
| 31 | - ✅ AMD P-State driver selection (active/guided/passive) | 32 | - ✅ AMD P-State driver selection (active/guided/passive) | ||
| 33 | + | - ✅ Optional AUR support (yay helper installation) | |||
| 34 | + | - ✅ Optional Chaotic-AUR repository | |||
| 32 | 35 | ||||
| 33 | ### Project Structure | 36 | ### Project Structure | ||
| 34 | ``` | 37 | ``` | ||
| @@ -142,7 +145,9 @@ sudo ./install.sh | |||||
| 142 | 9. Installs base packages with pacstrap (kernel + microcode + cryptsetup if encrypted) | 145 | 9. Installs base packages with pacstrap (kernel + microcode + cryptsetup if encrypted) | ||
| 143 | 10. Configures system (timezone, locale, hostname, user) | 146 | 10. Configures system (timezone, locale, hostname, user) | ||
| 144 | 11. Installs Limine bootloader (with encryption and AMD tuning if enabled) | 147 | 11. Installs Limine bootloader (with encryption and AMD tuning if enabled) | ||
| 145 | - | 12. Creates bootable minimal Arch system with btrfs | 148 | + | 12. Optionally installs yay AUR helper (if user enables AUR support) |
| 149 | + | 13. Optionally adds Chaotic-AUR repository (pre-built AUR packages) | |||
| 150 | + | 14. Creates bootable minimal Arch system with btrfs | |||
| 146 | 151 | ||||
| 147 | ## Environment Variables | 152 | ## Environment Variables | ||
| 148 | 153 | ||||
| @@ -152,11 +157,10 @@ sudo ./install.sh | |||||
| 152 | 157 | ||||
| 153 | ## Next Steps | 158 | ## Next Steps | ||
| 154 | 159 | ||||
| 155 | - | **Phase 5: Repository Setup (AUR + Chaotic)** (Week 3-4) | 160 | + | **Phase 6: Barebone Preset Complete + Testing** (Week 4) |
| 156 | - | - [ ] Ask user to enable AUR support (install yay) | 161 | + | - [ ] Add keyboard layout + WiFi migration from ISO |
| 157 | - | - [ ] Ask user to enable Chaotic-AUR repository | 162 | + | - [ ] Test matrix for all combinations |
| 158 | - | - [ ] Test yay installation from AUR | 163 | + | - [ ] Production-ready barebone installer |
| 159 | - | - [ ] Test Chaotic-AUR package installation | |||
| 160 | 164 | ||||
| 161 | ## Reference | 165 | ## Reference | ||
| 162 | 166 | ||||
M install.sh +3 -4
| @@ -36,13 +36,12 @@ source "$ARCHUP_INSTALL/config/all.sh" | |||
| 36 | 36 | # Bootloader installation | |
| 37 | 37 | source "$ARCHUP_INSTALL/boot/all.sh" | |
| 38 | 38 | ||
| 39 | + | # Repository setup (AUR + Chaotic) | |
| 40 | + | source "$ARCHUP_INSTALL/repos/all.sh" | |
| 41 | + | ||
| 39 | 42 | # ============================================================ | |
| 40 | 43 | # FUTURE PHASES (TO BE IMPLEMENTED) | |
| 41 | 44 | # ============================================================ | |
| 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 | 45 | # Phase 6: Barebone preset testing | |
| 47 | 46 | # Phase 7: Default preset (GUI) | |
| 48 | 47 | ||
| @@ -36,13 +36,12 @@ source "$ARCHUP_INSTALL/config/all.sh" | |||||
| 36 | # Bootloader installation | 36 | # Bootloader installation | ||
| 37 | source "$ARCHUP_INSTALL/boot/all.sh" | 37 | source "$ARCHUP_INSTALL/boot/all.sh" | ||
| 38 | 38 | ||||
| 39 | + | # Repository setup (AUR + Chaotic) | |||
| 40 | + | source "$ARCHUP_INSTALL/repos/all.sh" | |||
| 41 | + | ||||
| 39 | # ============================================================ | 42 | # ============================================================ | ||
| 40 | # FUTURE PHASES (TO BE IMPLEMENTED) | 43 | # FUTURE PHASES (TO BE IMPLEMENTED) | ||
| 41 | # ============================================================ | 44 | # ============================================================ | ||
| 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 | 45 | # Phase 6: Barebone preset testing | ||
| 47 | # Phase 7: Default preset (GUI) | 46 | # Phase 7: Default preset (GUI) | ||
| 48 | 47 | ||||
A install/repos/all.sh +5 -0
| @@ -0,0 +1,5 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Repository setup phase orchestrator | |
| 3 | + | ||
| 4 | + | run_logged "$ARCHUP_INSTALL/repos/yay.sh" | |
| 5 | + | run_logged "$ARCHUP_INSTALL/repos/chaotic.sh" | |
| @@ -0,0 +1,5 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Repository setup phase orchestrator | |||
| 3 | + | ||||
| 4 | + | run_logged "$ARCHUP_INSTALL/repos/yay.sh" | |||
| 5 | + | run_logged "$ARCHUP_INSTALL/repos/chaotic.sh" | |||
A install/repos/chaotic.sh +53 -0
| @@ -0,0 +1,53 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Add Chaotic-AUR repository | |
| 3 | + | ||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Chaotic-AUR Repository" | |
| 5 | + | echo | |
| 6 | + | ||
| 7 | + | # Ask if user wants Chaotic-AUR | |
| 8 | + | if ! gum confirm "Enable Chaotic-AUR repository?" --padding "0 0 1 $PADDING_LEFT"; then | |
| 9 | + | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⊘ Skipping Chaotic-AUR" | |
| 10 | + | echo "Chaotic-AUR: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 11 | + | export ARCHUP_CHAOTIC="disabled" | |
| 12 | + | return 0 | |
| 13 | + | fi | |
| 14 | + | ||
| 15 | + | export ARCHUP_CHAOTIC="enabled" | |
| 16 | + | ||
| 17 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Adding Chaotic-AUR repository..." | |
| 18 | + | gum style --padding "0 0 1 $PADDING_LEFT" "Installing keyring and mirrorlist..." | |
| 19 | + | ||
| 20 | + | # Install Chaotic-AUR keyring and mirrorlist | |
| 21 | + | arch-chroot /mnt pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com | |
| 22 | + | arch-chroot /mnt pacman-key --lsign-key 3056513887B78AEB | |
| 23 | + | ||
| 24 | + | # Install chaotic-keyring and chaotic-mirrorlist | |
| 25 | + | arch-chroot /mnt pacman -U --noconfirm \ | |
| 26 | + | 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' \ | |
| 27 | + | 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' | |
| 28 | + | ||
| 29 | + | # Add Chaotic-AUR to pacman.conf | |
| 30 | + | if ! grep -q "\[chaotic-aur\]" /mnt/etc/pacman.conf; then | |
| 31 | + | cat >> /mnt/etc/pacman.conf <<EOF | |
| 32 | + | ||
| 33 | + | # Chaotic-AUR repository | |
| 34 | + | [chaotic-aur] | |
| 35 | + | Include = /etc/pacman.d/chaotic-mirrorlist | |
| 36 | + | EOF | |
| 37 | + | ||
| 38 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Added Chaotic-AUR to pacman.conf" | |
| 39 | + | fi | |
| 40 | + | ||
| 41 | + | # Update package databases | |
| 42 | + | arch-chroot /mnt pacman -Sy | |
| 43 | + | ||
| 44 | + | # Verify Chaotic-AUR is working | |
| 45 | + | if arch-chroot /mnt pacman -Sl chaotic-aur >/dev/null 2>&1; then | |
| 46 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Chaotic-AUR enabled successfully" | |
| 47 | + | echo "Chaotic-AUR: enabled (repo added to pacman.conf)" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 48 | + | else | |
| 49 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ Chaotic-AUR verification failed" | |
| 50 | + | echo "WARNING: Chaotic-AUR verification failed" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 51 | + | export ARCHUP_CHAOTIC="failed" | |
| 52 | + | return 1 | |
| 53 | + | fi | |
| @@ -0,0 +1,53 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Add Chaotic-AUR repository | |||
| 3 | + | ||||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Chaotic-AUR Repository" | |||
| 5 | + | echo | |||
| 6 | + | ||||
| 7 | + | # Ask if user wants Chaotic-AUR | |||
| 8 | + | if ! gum confirm "Enable Chaotic-AUR repository?" --padding "0 0 1 $PADDING_LEFT"; then | |||
| 9 | + | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⊘ Skipping Chaotic-AUR" | |||
| 10 | + | echo "Chaotic-AUR: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
| 11 | + | export ARCHUP_CHAOTIC="disabled" | |||
| 12 | + | return 0 | |||
| 13 | + | fi | |||
| 14 | + | ||||
| 15 | + | export ARCHUP_CHAOTIC="enabled" | |||
| 16 | + | ||||
| 17 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Adding Chaotic-AUR repository..." | |||
| 18 | + | gum style --padding "0 0 1 $PADDING_LEFT" "Installing keyring and mirrorlist..." | |||
| 19 | + | ||||
| 20 | + | # Install Chaotic-AUR keyring and mirrorlist | |||
| 21 | + | arch-chroot /mnt pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com | |||
| 22 | + | arch-chroot /mnt pacman-key --lsign-key 3056513887B78AEB | |||
| 23 | + | ||||
| 24 | + | # Install chaotic-keyring and chaotic-mirrorlist | |||
| 25 | + | arch-chroot /mnt pacman -U --noconfirm \ | |||
| 26 | + | 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' \ | |||
| 27 | + | 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' | |||
| 28 | + | ||||
| 29 | + | # Add Chaotic-AUR to pacman.conf | |||
| 30 | + | if ! grep -q "\[chaotic-aur\]" /mnt/etc/pacman.conf; then | |||
| 31 | + | cat >> /mnt/etc/pacman.conf <<EOF | |||
| 32 | + | ||||
| 33 | + | # Chaotic-AUR repository | |||
| 34 | + | [chaotic-aur] | |||
| 35 | + | Include = /etc/pacman.d/chaotic-mirrorlist | |||
| 36 | + | EOF | |||
| 37 | + | ||||
| 38 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "✓ Added Chaotic-AUR to pacman.conf" | |||
| 39 | + | fi | |||
| 40 | + | ||||
| 41 | + | # Update package databases | |||
| 42 | + | arch-chroot /mnt pacman -Sy | |||
| 43 | + | ||||
| 44 | + | # Verify Chaotic-AUR is working | |||
| 45 | + | if arch-chroot /mnt pacman -Sl chaotic-aur >/dev/null 2>&1; then | |||
| 46 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ Chaotic-AUR enabled successfully" | |||
| 47 | + | echo "Chaotic-AUR: enabled (repo added to pacman.conf)" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
| 48 | + | else | |||
| 49 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ Chaotic-AUR verification failed" | |||
| 50 | + | echo "WARNING: Chaotic-AUR verification failed" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
| 51 | + | export ARCHUP_CHAOTIC="failed" | |||
| 52 | + | return 1 | |||
| 53 | + | fi | |||
A install/repos/yay.sh +51 -0
| @@ -0,0 +1,51 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Install yay AUR helper | |
| 3 | + | ||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "AUR Support" | |
| 5 | + | echo | |
| 6 | + | ||
| 7 | + | # Ask if user wants AUR support | |
| 8 | + | if ! gum confirm "Enable AUR support (install yay)?" --padding "0 0 1 $PADDING_LEFT"; then | |
| 9 | + | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⊘ Skipping AUR support" | |
| 10 | + | echo "AUR: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 11 | + | export ARCHUP_AUR="disabled" | |
| 12 | + | return 0 | |
| 13 | + | fi | |
| 14 | + | ||
| 15 | + | export ARCHUP_AUR="enabled" | |
| 16 | + | ||
| 17 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing yay AUR helper..." | |
| 18 | + | gum style --padding "0 0 1 $PADDING_LEFT" "This may take a few minutes..." | |
| 19 | + | ||
| 20 | + | # Install base-devel if not already installed (required for building AUR packages) | |
| 21 | + | arch-chroot /mnt pacman -S --noconfirm --needed base-devel git | |
| 22 | + | ||
| 23 | + | # Get the username created during installation | |
| 24 | + | USERNAME=$(arch-chroot /mnt ls /home | head -1) | |
| 25 | + | ||
| 26 | + | if [ -z "$USERNAME" ]; then | |
| 27 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ Error: Could not find user for yay installation" | |
| 28 | + | echo "ERROR: No user found for yay installation" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 29 | + | export ARCHUP_AUR="failed" | |
| 30 | + | return 1 | |
| 31 | + | fi | |
| 32 | + | ||
| 33 | + | # Clone yay-bin from AUR as the user (not root) | |
| 34 | + | arch-chroot /mnt su - "$USERNAME" -c "cd /tmp && git clone https://aur.archlinux.org/yay-bin.git" | |
| 35 | + | ||
| 36 | + | # Build and install yay as the user | |
| 37 | + | arch-chroot /mnt su - "$USERNAME" -c "cd /tmp/yay-bin && makepkg -si --noconfirm" | |
| 38 | + | ||
| 39 | + | # Clean up | |
| 40 | + | arch-chroot /mnt rm -rf /tmp/yay-bin | |
| 41 | + | ||
| 42 | + | # Verify installation | |
| 43 | + | if arch-chroot /mnt su - "$USERNAME" -c "yay --version" >/dev/null 2>&1; then | |
| 44 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ yay installed successfully" | |
| 45 | + | echo "AUR: enabled (yay installed for user: $USERNAME)" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 46 | + | else | |
| 47 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ yay installation failed" | |
| 48 | + | echo "ERROR: yay installation failed" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |
| 49 | + | export ARCHUP_AUR="failed" | |
| 50 | + | return 1 | |
| 51 | + | fi | |
| @@ -0,0 +1,51 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Install yay AUR helper | |||
| 3 | + | ||||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "AUR Support" | |||
| 5 | + | echo | |||
| 6 | + | ||||
| 7 | + | # Ask if user wants AUR support | |||
| 8 | + | if ! gum confirm "Enable AUR support (install yay)?" --padding "0 0 1 $PADDING_LEFT"; then | |||
| 9 | + | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "⊘ Skipping AUR support" | |||
| 10 | + | echo "AUR: disabled" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
| 11 | + | export ARCHUP_AUR="disabled" | |||
| 12 | + | return 0 | |||
| 13 | + | fi | |||
| 14 | + | ||||
| 15 | + | export ARCHUP_AUR="enabled" | |||
| 16 | + | ||||
| 17 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Installing yay AUR helper..." | |||
| 18 | + | gum style --padding "0 0 1 $PADDING_LEFT" "This may take a few minutes..." | |||
| 19 | + | ||||
| 20 | + | # Install base-devel if not already installed (required for building AUR packages) | |||
| 21 | + | arch-chroot /mnt pacman -S --noconfirm --needed base-devel git | |||
| 22 | + | ||||
| 23 | + | # Get the username created during installation | |||
| 24 | + | USERNAME=$(arch-chroot /mnt ls /home | head -1) | |||
| 25 | + | ||||
| 26 | + | if [ -z "$USERNAME" ]; then | |||
| 27 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ Error: Could not find user for yay installation" | |||
| 28 | + | echo "ERROR: No user found for yay installation" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
| 29 | + | export ARCHUP_AUR="failed" | |||
| 30 | + | return 1 | |||
| 31 | + | fi | |||
| 32 | + | ||||
| 33 | + | # Clone yay-bin from AUR as the user (not root) | |||
| 34 | + | arch-chroot /mnt su - "$USERNAME" -c "cd /tmp && git clone https://aur.archlinux.org/yay-bin.git" | |||
| 35 | + | ||||
| 36 | + | # Build and install yay as the user | |||
| 37 | + | arch-chroot /mnt su - "$USERNAME" -c "cd /tmp/yay-bin && makepkg -si --noconfirm" | |||
| 38 | + | ||||
| 39 | + | # Clean up | |||
| 40 | + | arch-chroot /mnt rm -rf /tmp/yay-bin | |||
| 41 | + | ||||
| 42 | + | # Verify installation | |||
| 43 | + | if arch-chroot /mnt su - "$USERNAME" -c "yay --version" >/dev/null 2>&1; then | |||
| 44 | + | gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "✓ yay installed successfully" | |||
| 45 | + | echo "AUR: enabled (yay installed for user: $USERNAME)" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
| 46 | + | else | |||
| 47 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "✗ yay installation failed" | |||
| 48 | + | echo "ERROR: yay installation failed" | tee -a "$ARCHUP_INSTALL_LOG_FILE" | |||
| 49 | + | export ARCHUP_AUR="failed" | |||
| 50 | + | return 1 | |||
| 51 | + | fi | |||