feat(multilib): enable multilib repository on ISO and installed system
- commit
- 740acb2b34f689e8e2cb85a48e4d35b2614d5fc1
- author
- bnema · · 2025-10-21 16:35 UTC
- committer
- bnema · · 2025-10-21 20:23 UTC
- parent
- f63c5c5
- signature
- unsigned
8 files · +56 -3
M CHANGELOG.md +1 -0
| @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. | |||
| 7 | 7 | ### Added | |
| 8 | 8 | - **zram swap**: Configured zram-generator for compressed in-memory swap with optimized sysctl parameters | |
| 9 | 9 | - **Broadcom WiFi**: Added broadcom-wl driver to base packages for Broadcom wireless support | |
| 10 | + | - **Multilib support**: Enabled multilib repository on ISO and installed system with reusable helper | |
| 10 | 11 | ||
| 11 | 12 | ### Changed | |
| 12 | 13 | - **Disk selection**: Enhanced disk listing with model, serial, and vendor information using JSON output | |
| @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. | |||||
| 7 | ### Added | 7 | ### Added | ||
| 8 | - **zram swap**: Configured zram-generator for compressed in-memory swap with optimized sysctl parameters | 8 | - **zram swap**: Configured zram-generator for compressed in-memory swap with optimized sysctl parameters | ||
| 9 | - **Broadcom WiFi**: Added broadcom-wl driver to base packages for Broadcom wireless support | 9 | - **Broadcom WiFi**: Added broadcom-wl driver to base packages for Broadcom wireless support | ||
| 10 | + | - **Multilib support**: Enabled multilib repository on ISO and installed system with reusable helper | |||
| 10 | 11 | ||||
| 11 | ### Changed | 12 | ### Changed | ||
| 12 | - **Disk selection**: Enhanced disk listing with model, serial, and vendor information using JSON output | 13 | - **Disk selection**: Enhanced disk listing with model, serial, and vendor information using JSON output | ||
M install/base/all.sh +1 -0
| @@ -5,6 +5,7 @@ stop_log_output # Stop for interactive prompt | |||
| 5 | 5 | source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose) | |
| 6 | 6 | start_log_output # Resume after prompt | |
| 7 | 7 | ||
| 8 | + | run_logged "$ARCHUP_INSTALL/base/enable-multilib.sh" # Enable multilib before pacstrap | |
| 8 | 9 | run_logged "$ARCHUP_INSTALL/base/cachyos-repo.sh" # Configure CachyOS repo if needed | |
| 9 | 10 | run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive (essential packages only) | |
| 10 | 11 | run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive | |
| @@ -5,6 +5,7 @@ stop_log_output # Stop for interactive prompt | |||||
| 5 | source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose) | 5 | source "$ARCHUP_INSTALL/base/kernel.sh" # Interactive (gum choose) | ||
| 6 | start_log_output # Resume after prompt | 6 | start_log_output # Resume after prompt | ||
| 7 | 7 | ||||
| 8 | + | run_logged "$ARCHUP_INSTALL/base/enable-multilib.sh" # Enable multilib before pacstrap | |||
| 8 | run_logged "$ARCHUP_INSTALL/base/cachyos-repo.sh" # Configure CachyOS repo if needed | 9 | run_logged "$ARCHUP_INSTALL/base/cachyos-repo.sh" # Configure CachyOS repo if needed | ||
| 9 | run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive (essential packages only) | 10 | run_logged "$ARCHUP_INSTALL/base/pacstrap.sh" # Non-interactive (essential packages only) | ||
| 10 | run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive | 11 | run_logged "$ARCHUP_INSTALL/base/fstab.sh" # Non-interactive | ||
A install/base/enable-multilib.sh +15 -0
| @@ -0,0 +1,15 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Enable multilib on ISO before pacstrap | |
| 3 | + | ||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Enabling multilib repository..." | |
| 5 | + | ||
| 6 | + | # Enable multilib in ISO's pacman.conf | |
| 7 | + | enable_multilib "/etc/pacman.conf" | |
| 8 | + | ||
| 9 | + | # Update package database | |
| 10 | + | if ! run_with_spinner "Updating package database..." "pacman -Sy"; then | |
| 11 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Failed to update package database" | |
| 12 | + | exit 1 | |
| 13 | + | fi | |
| 14 | + | ||
| 15 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Multilib enabled" | |
| @@ -0,0 +1,15 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Enable multilib on ISO before pacstrap | |||
| 3 | + | ||||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Enabling multilib repository..." | |||
| 5 | + | ||||
| 6 | + | # Enable multilib in ISO's pacman.conf | |||
| 7 | + | enable_multilib "/etc/pacman.conf" | |||
| 8 | + | ||||
| 9 | + | # Update package database | |||
| 10 | + | if ! run_with_spinner "Updating package database..." "pacman -Sy"; then | |||
| 11 | + | gum style --foreground 1 --padding "1 0 1 $PADDING_LEFT" "[ERROR] Failed to update package database" | |||
| 12 | + | exit 1 | |||
| 13 | + | fi | |||
| 14 | + | ||||
| 15 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Multilib enabled" | |||
M install/helpers/all.sh +1 -0
| @@ -7,3 +7,4 @@ source "$ARCHUP_INSTALL/helpers/presentation.sh" | |||
| 7 | 7 | source "$ARCHUP_INSTALL/helpers/logging.sh" | |
| 8 | 8 | source "$ARCHUP_INSTALL/helpers/errors.sh" | |
| 9 | 9 | source "$ARCHUP_INSTALL/helpers/chroot.sh" | |
| 10 | + | source "$ARCHUP_INSTALL/helpers/multilib.sh" | |
| @@ -7,3 +7,4 @@ source "$ARCHUP_INSTALL/helpers/presentation.sh" | |||||
| 7 | source "$ARCHUP_INSTALL/helpers/logging.sh" | 7 | source "$ARCHUP_INSTALL/helpers/logging.sh" | ||
| 8 | source "$ARCHUP_INSTALL/helpers/errors.sh" | 8 | source "$ARCHUP_INSTALL/helpers/errors.sh" | ||
| 9 | source "$ARCHUP_INSTALL/helpers/chroot.sh" | 9 | source "$ARCHUP_INSTALL/helpers/chroot.sh" | ||
| 10 | + | source "$ARCHUP_INSTALL/helpers/multilib.sh" | |||
M install/helpers/download.sh +3 -3
| @@ -30,7 +30,7 @@ download_archup_files() { | |||
| 30 | 30 | ||
| 31 | 31 | # Helpers | |
| 32 | 32 | download_section "Downloading helpers..." "helpers" \ | |
| 33 | - | all.sh config.sh logging.sh errors.sh presentation.sh chroot.sh cleanup.sh | |
| 33 | + | all.sh config.sh logging.sh errors.sh presentation.sh chroot.sh cleanup.sh multilib.sh | |
| 34 | 34 | ||
| 35 | 35 | # Preflight | |
| 36 | 36 | download_section "Downloading preflight checks..." "preflight" \ | |
| @@ -42,7 +42,7 @@ download_archup_files() { | |||
| 42 | 42 | ||
| 43 | 43 | # Base system | |
| 44 | 44 | download_section "Downloading base system scripts..." "base" \ | |
| 45 | - | all.sh kernel.sh pacstrap.sh fstab.sh | |
| 45 | + | all.sh kernel.sh enable-multilib.sh cachyos-repo.sh pacstrap.sh fstab.sh | |
| 46 | 46 | ||
| 47 | 47 | # Configuration | |
| 48 | 48 | download_section "Downloading config scripts..." "config" \ | |
| @@ -54,7 +54,7 @@ download_archup_files() { | |||
| 54 | 54 | ||
| 55 | 55 | # Repositories | |
| 56 | 56 | download_section "Downloading repository setup..." "repos" \ | |
| 57 | - | all.sh aur.sh chaotic.sh | |
| 57 | + | all.sh multilib.sh aur.sh chaotic.sh | |
| 58 | 58 | ||
| 59 | 59 | # Post-install | |
| 60 | 60 | download_section "Downloading post-install scripts..." "post-install" \ | |
| @@ -30,7 +30,7 @@ download_archup_files() { | |||||
| 30 | 30 | ||||
| 31 | # Helpers | 31 | # Helpers | ||
| 32 | download_section "Downloading helpers..." "helpers" \ | 32 | download_section "Downloading helpers..." "helpers" \ | ||
| 33 | - | all.sh config.sh logging.sh errors.sh presentation.sh chroot.sh cleanup.sh | 33 | + | all.sh config.sh logging.sh errors.sh presentation.sh chroot.sh cleanup.sh multilib.sh |
| 34 | 34 | ||||
| 35 | # Preflight | 35 | # Preflight | ||
| 36 | download_section "Downloading preflight checks..." "preflight" \ | 36 | download_section "Downloading preflight checks..." "preflight" \ | ||
| @@ -42,7 +42,7 @@ download_archup_files() { | |||||
| 42 | 42 | ||||
| 43 | # Base system | 43 | # Base system | ||
| 44 | download_section "Downloading base system scripts..." "base" \ | 44 | download_section "Downloading base system scripts..." "base" \ | ||
| 45 | - | all.sh kernel.sh pacstrap.sh fstab.sh | 45 | + | all.sh kernel.sh enable-multilib.sh cachyos-repo.sh pacstrap.sh fstab.sh |
| 46 | 46 | ||||
| 47 | # Configuration | 47 | # Configuration | ||
| 48 | download_section "Downloading config scripts..." "config" \ | 48 | download_section "Downloading config scripts..." "config" \ | ||
| @@ -54,7 +54,7 @@ download_archup_files() { | |||||
| 54 | 54 | ||||
| 55 | # Repositories | 55 | # Repositories | ||
| 56 | download_section "Downloading repository setup..." "repos" \ | 56 | download_section "Downloading repository setup..." "repos" \ | ||
| 57 | - | all.sh aur.sh chaotic.sh | 57 | + | all.sh multilib.sh aur.sh chaotic.sh |
| 58 | 58 | ||||
| 59 | # Post-install | 59 | # Post-install | ||
| 60 | download_section "Downloading post-install scripts..." "post-install" \ | 60 | download_section "Downloading post-install scripts..." "post-install" \ | ||
A install/helpers/multilib.sh +25 -0
| @@ -0,0 +1,25 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Helper function to enable multilib repository | |
| 3 | + | ||
| 4 | + | ####################################### | |
| 5 | + | # Description: Enable multilib in pacman.conf | |
| 6 | + | # Arguments: | |
| 7 | + | # $1 - Path to pacman.conf (optional, defaults to /etc/pacman.conf) | |
| 8 | + | # Returns: | |
| 9 | + | # 0 if successful, 1 on error | |
| 10 | + | ####################################### | |
| 11 | + | enable_multilib() { | |
| 12 | + | local pacman_conf="${1:-/etc/pacman.conf}" | |
| 13 | + | ||
| 14 | + | # Check if multilib is already enabled | |
| 15 | + | if grep -q "^\[multilib\]" "$pacman_conf"; then | |
| 16 | + | echo "Multilib already enabled in $pacman_conf" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 17 | + | return 0 | |
| 18 | + | fi | |
| 19 | + | ||
| 20 | + | # Uncomment multilib section | |
| 21 | + | sed -i '/^#\[multilib\]/,/^#Include = \/etc\/pacman.d\/mirrorlist/ s/^#//' "$pacman_conf" | |
| 22 | + | ||
| 23 | + | echo "Multilib enabled in $pacman_conf" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 24 | + | return 0 | |
| 25 | + | } | |
| @@ -0,0 +1,25 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Helper function to enable multilib repository | |||
| 3 | + | ||||
| 4 | + | ####################################### | |||
| 5 | + | # Description: Enable multilib in pacman.conf | |||
| 6 | + | # Arguments: | |||
| 7 | + | # $1 - Path to pacman.conf (optional, defaults to /etc/pacman.conf) | |||
| 8 | + | # Returns: | |||
| 9 | + | # 0 if successful, 1 on error | |||
| 10 | + | ####################################### | |||
| 11 | + | enable_multilib() { | |||
| 12 | + | local pacman_conf="${1:-/etc/pacman.conf}" | |||
| 13 | + | ||||
| 14 | + | # Check if multilib is already enabled | |||
| 15 | + | if grep -q "^\[multilib\]" "$pacman_conf"; then | |||
| 16 | + | echo "Multilib already enabled in $pacman_conf" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 17 | + | return 0 | |||
| 18 | + | fi | |||
| 19 | + | ||||
| 20 | + | # Uncomment multilib section | |||
| 21 | + | sed -i '/^#\[multilib\]/,/^#Include = \/etc\/pacman.d\/mirrorlist/ s/^#//' "$pacman_conf" | |||
| 22 | + | ||||
| 23 | + | echo "Multilib enabled in $pacman_conf" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 24 | + | return 0 | |||
| 25 | + | } | |||
M install/repos/all.sh +1 -0
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | 4 | stop_log_output # Stop for interactive prompts | |
| 5 | 5 | ||
| 6 | + | run_logged "$ARCHUP_INSTALL/repos/multilib.sh" # Non-interactive - Enable multilib first | |
| 6 | 7 | source "$ARCHUP_INSTALL/repos/chaotic.sh" # Interactive (gum confirm) - MUST be before AUR | |
| 7 | 8 | source "$ARCHUP_INSTALL/repos/aur.sh" # Interactive (gum confirm + choose) | |
| 8 | 9 | ||
| @@ -3,6 +3,7 @@ | |||||
| 3 | 3 | ||||
| 4 | stop_log_output # Stop for interactive prompts | 4 | stop_log_output # Stop for interactive prompts | ||
| 5 | 5 | ||||
| 6 | + | run_logged "$ARCHUP_INSTALL/repos/multilib.sh" # Non-interactive - Enable multilib first | |||
| 6 | source "$ARCHUP_INSTALL/repos/chaotic.sh" # Interactive (gum confirm) - MUST be before AUR | 7 | source "$ARCHUP_INSTALL/repos/chaotic.sh" # Interactive (gum confirm) - MUST be before AUR | ||
| 7 | source "$ARCHUP_INSTALL/repos/aur.sh" # Interactive (gum confirm + choose) | 8 | source "$ARCHUP_INSTALL/repos/aur.sh" # Interactive (gum confirm + choose) | ||
| 8 | 9 | ||||
A install/repos/multilib.sh +9 -0
| @@ -0,0 +1,9 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Enable multilib in installed system | |
| 3 | + | ||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring multilib repository..." | |
| 5 | + | ||
| 6 | + | # Enable multilib in installed system's pacman.conf | |
| 7 | + | enable_multilib "/mnt/etc/pacman.conf" | |
| 8 | + | ||
| 9 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Multilib configured" | |
| @@ -0,0 +1,9 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Enable multilib in installed system | |||
| 3 | + | ||||
| 4 | + | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring multilib repository..." | |||
| 5 | + | ||||
| 6 | + | # Enable multilib in installed system's pacman.conf | |||
| 7 | + | enable_multilib "/mnt/etc/pacman.conf" | |||
| 8 | + | ||||
| 9 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Multilib configured" | |||