fix(boot): support all kernel variants in Limine config and auto-select single AMD P-State option
- commit
- 79d696db9f914df9575b08963216fceabcb0b7a6
- author
- bnema · · 2025-10-20 20:55 UTC
- committer
- bnema · · 2025-10-20 21:07 UTC
- parent
- 518bffa
- signature
- unsigned
3 files · +35 -26
M CHANGELOG.md +2 -0
| @@ -9,6 +9,8 @@ All notable changes to this project will be documented in this file. | |||
| 9 | 9 | - **Kernel selection**: Simplified AMD P-State mode descriptions for better user clarity | |
| 10 | 10 | ||
| 11 | 11 | ### Fixed | |
| 12 | + | - **Limine bootloader**: Fixed kernel panic with non-default kernels (cachyos, zen, lts) | |
| 13 | + | - **AMD P-State selection**: Auto-select when only one mode available | |
| 12 | 14 | - **Curl-pipe installation**: Fixed curl-based one-liner installation by auto-detecting piped input, re-executing with TTY for interactive prompts, and running bootstrap before downloads | |
| 13 | 15 | - **Cleanup flag**: Fixed --cleanup flag to run after helper files are downloaded | |
| 14 | 16 | - **Verification script**: Disabled ERR trap during verification to properly show all failures and prompt user, use dynamic kernel name instead of hardcoded linux, made fallback initramfs optional | |
| @@ -9,6 +9,8 @@ All notable changes to this project will be documented in this file. | |||||
| 9 | - **Kernel selection**: Simplified AMD P-State mode descriptions for better user clarity | 9 | - **Kernel selection**: Simplified AMD P-State mode descriptions for better user clarity | ||
| 10 | 10 | ||||
| 11 | ### Fixed | 11 | ### Fixed | ||
| 12 | + | - **Limine bootloader**: Fixed kernel panic with non-default kernels (cachyos, zen, lts) | |||
| 13 | + | - **AMD P-State selection**: Auto-select when only one mode available | |||
| 12 | - **Curl-pipe installation**: Fixed curl-based one-liner installation by auto-detecting piped input, re-executing with TTY for interactive prompts, and running bootstrap before downloads | 14 | - **Curl-pipe installation**: Fixed curl-based one-liner installation by auto-detecting piped input, re-executing with TTY for interactive prompts, and running bootstrap before downloads | ||
| 13 | - **Cleanup flag**: Fixed --cleanup flag to run after helper files are downloaded | 15 | - **Cleanup flag**: Fixed --cleanup flag to run after helper files are downloaded | ||
| 14 | - **Verification script**: Disabled ERR trap during verification to properly show all failures and prompt user, use dynamic kernel name instead of hardcoded linux, made fallback initramfs optional | 16 | - **Verification script**: Disabled ERR trap during verification to properly show all failures and prompt user, use dynamic kernel name instead of hardcoded linux, made fallback initramfs optional | ||
M install/base/kernel.sh +29 -22
| @@ -89,29 +89,36 @@ if [ "$CPU_TYPE" = "AMD" ]; then | |||
| 89 | 89 | AVAILABLE_MODES=("passive") | |
| 90 | 90 | fi | |
| 91 | 91 | ||
| 92 | - | echo | |
| 93 | - | # Build choice options with descriptions | |
| 94 | - | declare -a MODE_CHOICES | |
| 95 | - | for mode in "${AVAILABLE_MODES[@]}"; do | |
| 96 | - | case "$mode" in | |
| 97 | - | active) | |
| 98 | - | MODE_CHOICES+=("active - Best performance (recommended for desktop/gaming)") | |
| 99 | - | ;; | |
| 100 | - | guided) | |
| 101 | - | MODE_CHOICES+=("guided - Balanced performance and efficiency (recommended for laptops)") | |
| 102 | - | ;; | |
| 103 | - | passive) | |
| 104 | - | MODE_CHOICES+=("passive - Maximum compatibility (older CPUs)") | |
| 105 | - | ;; | |
| 106 | - | esac | |
| 107 | - | done | |
| 108 | - | ||
| 109 | - | AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${MODE_CHOICES[@]}") | |
| 110 | - | ||
| 111 | - | # Extract just the mode name (before the dash) | |
| 112 | - | AMD_PSTATE=$(echo "$AMD_PSTATE" | awk '{print $1}') | |
| 92 | + | # Auto-select if only one mode available, otherwise prompt user | |
| 93 | + | if [ ${#AVAILABLE_MODES[@]} -eq 1 ]; then | |
| 94 | + | AMD_PSTATE="${AVAILABLE_MODES[0]}" | |
| 95 | + | gum style --foreground 2 --padding "1 0 0 $PADDING_LEFT" "[OK] Auto-selected: $AMD_PSTATE (only available mode)" | |
| 96 | + | else | |
| 97 | + | echo | |
| 98 | + | # Build choice options with descriptions | |
| 99 | + | declare -a MODE_CHOICES | |
| 100 | + | for mode in "${AVAILABLE_MODES[@]}"; do | |
| 101 | + | case "$mode" in | |
| 102 | + | active) | |
| 103 | + | MODE_CHOICES+=("active - Best performance (recommended for desktop/gaming)") | |
| 104 | + | ;; | |
| 105 | + | guided) | |
| 106 | + | MODE_CHOICES+=("guided - Balanced performance and efficiency (recommended for laptops)") | |
| 107 | + | ;; | |
| 108 | + | passive) | |
| 109 | + | MODE_CHOICES+=("passive - Maximum compatibility (older CPUs)") | |
| 110 | + | ;; | |
| 111 | + | esac | |
| 112 | + | done | |
| 113 | + | ||
| 114 | + | AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${MODE_CHOICES[@]}") | |
| 115 | + | ||
| 116 | + | # Extract just the mode name (before the dash) | |
| 117 | + | AMD_PSTATE=$(echo "$AMD_PSTATE" | awk '{print $1}') | |
| 118 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] P-State: $AMD_PSTATE" | |
| 119 | + | fi | |
| 120 | + | ||
| 113 | 121 | export ARCHUP_AMD_PSTATE="$AMD_PSTATE" | |
| 114 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] P-State: $AMD_PSTATE" | |
| 115 | 122 | echo "AMD P-State: $AMD_PSTATE (kernel parameter)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 116 | 123 | ||
| 117 | 124 | # Prepare kernel parameters for AMD P-State | |
| @@ -89,29 +89,36 @@ if [ "$CPU_TYPE" = "AMD" ]; then | |||||
| 89 | AVAILABLE_MODES=("passive") | 89 | AVAILABLE_MODES=("passive") | ||
| 90 | fi | 90 | fi | ||
| 91 | 91 | ||||
| 92 | - | echo | 92 | + | # Auto-select if only one mode available, otherwise prompt user |
| 93 | - | # Build choice options with descriptions | 93 | + | if [ ${#AVAILABLE_MODES[@]} -eq 1 ]; then |
| 94 | - | declare -a MODE_CHOICES | 94 | + | AMD_PSTATE="${AVAILABLE_MODES[0]}" |
| 95 | - | for mode in "${AVAILABLE_MODES[@]}"; do | 95 | + | gum style --foreground 2 --padding "1 0 0 $PADDING_LEFT" "[OK] Auto-selected: $AMD_PSTATE (only available mode)" |
| 96 | - | case "$mode" in | 96 | + | else |
| 97 | - | active) | 97 | + | echo |
| 98 | - | MODE_CHOICES+=("active - Best performance (recommended for desktop/gaming)") | 98 | + | # Build choice options with descriptions |
| 99 | - | ;; | 99 | + | declare -a MODE_CHOICES |
| 100 | - | guided) | 100 | + | for mode in "${AVAILABLE_MODES[@]}"; do |
| 101 | - | MODE_CHOICES+=("guided - Balanced performance and efficiency (recommended for laptops)") | 101 | + | case "$mode" in |
| 102 | - | ;; | 102 | + | active) |
| 103 | - | passive) | 103 | + | MODE_CHOICES+=("active - Best performance (recommended for desktop/gaming)") |
| 104 | - | MODE_CHOICES+=("passive - Maximum compatibility (older CPUs)") | 104 | + | ;; |
| 105 | - | ;; | 105 | + | guided) |
| 106 | - | esac | 106 | + | MODE_CHOICES+=("guided - Balanced performance and efficiency (recommended for laptops)") |
| 107 | - | done | 107 | + | ;; |
| 108 | - | 108 | + | passive) | |
| 109 | - | AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${MODE_CHOICES[@]}") | 109 | + | MODE_CHOICES+=("passive - Maximum compatibility (older CPUs)") |
| 110 | - | 110 | + | ;; | |
| 111 | - | # Extract just the mode name (before the dash) | 111 | + | esac |
| 112 | - | AMD_PSTATE=$(echo "$AMD_PSTATE" | awk '{print $1}') | 112 | + | done |
| 113 | + | ||||
| 114 | + | AMD_PSTATE=$(gum choose --padding "0 0 1 $PADDING_LEFT" "${MODE_CHOICES[@]}") | |||
| 115 | + | ||||
| 116 | + | # Extract just the mode name (before the dash) | |||
| 117 | + | AMD_PSTATE=$(echo "$AMD_PSTATE" | awk '{print $1}') | |||
| 118 | + | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] P-State: $AMD_PSTATE" | |||
| 119 | + | fi | |||
| 120 | + | ||||
| 113 | export ARCHUP_AMD_PSTATE="$AMD_PSTATE" | 121 | export ARCHUP_AMD_PSTATE="$AMD_PSTATE" | ||
| 114 | - | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] P-State: $AMD_PSTATE" | |||
| 115 | echo "AMD P-State: $AMD_PSTATE (kernel parameter)" >> "$ARCHUP_INSTALL_LOG_FILE" | 122 | echo "AMD P-State: $AMD_PSTATE (kernel parameter)" >> "$ARCHUP_INSTALL_LOG_FILE" | ||
| 116 | 123 | ||||
| 117 | # Prepare kernel parameters for AMD P-State | 124 | # Prepare kernel parameters for AMD P-State | ||
M install/boot/limine.sh +4 -4
| @@ -55,15 +55,15 @@ quiet: yes | |||
| 55 | 55 | ||
| 56 | 56 | /Arch Linux | |
| 57 | 57 | protocol: linux | |
| 58 | - | path: boot():/vmlinuz-linux | |
| 58 | + | path: boot():/vmlinuz-$ARCHUP_KERNEL | |
| 59 | 59 | cmdline: $KERNEL_PARAMS | |
| 60 | - | module_path: boot():/initramfs-linux.img | |
| 60 | + | module_path: boot():/initramfs-$ARCHUP_KERNEL.img | |
| 61 | 61 | ||
| 62 | 62 | /Arch Linux (fallback) | |
| 63 | 63 | protocol: linux | |
| 64 | - | path: boot():/vmlinuz-linux | |
| 64 | + | path: boot():/vmlinuz-$ARCHUP_KERNEL | |
| 65 | 65 | cmdline: $KERNEL_PARAMS | |
| 66 | - | module_path: boot():/initramfs-linux-fallback.img | |
| 66 | + | module_path: boot():/initramfs-$ARCHUP_KERNEL-fallback.img | |
| 67 | 67 | EOF | |
| 68 | 68 | ||
| 69 | 69 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating UEFI boot entry..." | |
| @@ -55,15 +55,15 @@ quiet: yes | |||||
| 55 | 55 | ||||
| 56 | /Arch Linux | 56 | /Arch Linux | ||
| 57 | protocol: linux | 57 | protocol: linux | ||
| 58 | - | path: boot():/vmlinuz-linux | 58 | + | path: boot():/vmlinuz-$ARCHUP_KERNEL |
| 59 | cmdline: $KERNEL_PARAMS | 59 | cmdline: $KERNEL_PARAMS | ||
| 60 | - | module_path: boot():/initramfs-linux.img | 60 | + | module_path: boot():/initramfs-$ARCHUP_KERNEL.img |
| 61 | 61 | ||||
| 62 | /Arch Linux (fallback) | 62 | /Arch Linux (fallback) | ||
| 63 | protocol: linux | 63 | protocol: linux | ||
| 64 | - | path: boot():/vmlinuz-linux | 64 | + | path: boot():/vmlinuz-$ARCHUP_KERNEL |
| 65 | cmdline: $KERNEL_PARAMS | 65 | cmdline: $KERNEL_PARAMS | ||
| 66 | - | module_path: boot():/initramfs-linux-fallback.img | 66 | + | module_path: boot():/initramfs-$ARCHUP_KERNEL-fallback.img |
| 67 | EOF | 67 | EOF | ||
| 68 | 68 | ||||
| 69 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating UEFI boot entry..." | 69 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating UEFI boot entry..." | ||