fix(verify): disable ERR trap, use dynamic kernel name, make fallback initramfs optional
- commit
- 163504c5b7b73b4a17470ef204826bedfc72de1e
- author
- bnema · · 2025-10-20 18:25 UTC
- committer
- bnema · · 2025-10-20 20:22 UTC
- parent
- 43bde40
- signature
- unsigned
2 files · +21 -3
M CHANGELOG.md +1 -0
| @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. | |||
| 10 | 10 | ### Fixed | |
| 11 | 11 | - **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 | |
| 12 | 12 | - **Cleanup flag**: Fixed --cleanup flag to run after helper files are downloaded | |
| 13 | + | - **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 | |
| 13 | 14 | ||
| 14 | 15 | ## [0.1.0] - 2025-10-21 | |
| 15 | 16 | ||
| @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. | |||||
| 10 | ### Fixed | 10 | ### Fixed | ||
| 11 | - **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 | 11 | - **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 | ||
| 12 | - **Cleanup flag**: Fixed --cleanup flag to run after helper files are downloaded | 12 | - **Cleanup flag**: Fixed --cleanup flag to run after helper files are downloaded | ||
| 13 | + | - **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 | |||
| 13 | 14 | ||||
| 14 | ## [0.1.0] - 2025-10-21 | 15 | ## [0.1.0] - 2025-10-21 | ||
| 15 | 16 | ||||
M install/post-install/verify.sh +20 -3
| @@ -1,6 +1,10 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | # Post-install verification: Ensure everything is configured correctly | |
| 3 | 3 | ||
| 4 | + | # Disable exit-on-error and ERR trap for this script since we handle failures gracefully | |
| 5 | + | set +e | |
| 6 | + | trap - ERR | |
| 7 | + | ||
| 4 | 8 | ####################################### | |
| 5 | 9 | # Description: Verify installation components | |
| 6 | 10 | # Globals: | |
| @@ -55,9 +59,18 @@ verify_dir() { | |||
| 55 | 59 | return 1 | |
| 56 | 60 | fi | |
| 57 | 61 | } | |
| 58 | - | verify_file "/boot/vmlinuz-linux" "Kernel" | |
| 59 | - | verify_file "/boot/initramfs-linux.img" "Initramfs" | |
| 60 | - | verify_file "/boot/initramfs-linux-fallback.img" "Fallback initramfs" | |
| 62 | + | # Use the selected kernel name from config | |
| 63 | + | KERNEL_NAME="${ARCHUP_KERNEL:-linux}" | |
| 64 | + | ||
| 65 | + | verify_file "/boot/vmlinuz-${KERNEL_NAME}" "Kernel" | |
| 66 | + | verify_file "/boot/initramfs-${KERNEL_NAME}.img" "Initramfs" | |
| 67 | + | ||
| 68 | + | # Fallback initramfs is optional | |
| 69 | + | if [ -f "/mnt/boot/initramfs-${KERNEL_NAME}-fallback.img" ]; then | |
| 70 | + | echo "[OK] Fallback initramfs: /boot/initramfs-${KERNEL_NAME}-fallback.img" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 71 | + | else | |
| 72 | + | echo "[WARN] Fallback initramfs not generated (optional)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 73 | + | fi | |
| 61 | 74 | ||
| 62 | 75 | verify_file "/boot/EFI/limine/BOOTX64.EFI" "Limine bootloader" | |
| 63 | 76 | verify_file "/boot/EFI/limine/limine.conf" "Limine configuration" | |
| @@ -128,3 +141,7 @@ else | |||
| 128 | 141 | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[WARN] Continuing despite verification errors" | |
| 129 | 142 | echo "User chose to continue despite verification errors" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 130 | 143 | fi | |
| 144 | + | ||
| 145 | + | # Re-enable exit-on-error and ERR trap for subsequent scripts | |
| 146 | + | set -e | |
| 147 | + | trap 'catch_errors' ERR | |
| @@ -1,6 +1,10 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | # Post-install verification: Ensure everything is configured correctly | 2 | # Post-install verification: Ensure everything is configured correctly | ||
| 3 | 3 | ||||
| 4 | + | # Disable exit-on-error and ERR trap for this script since we handle failures gracefully | |||
| 5 | + | set +e | |||
| 6 | + | trap - ERR | |||
| 7 | + | ||||
| 4 | ####################################### | 8 | ####################################### | ||
| 5 | # Description: Verify installation components | 9 | # Description: Verify installation components | ||
| 6 | # Globals: | 10 | # Globals: | ||
| @@ -55,9 +59,18 @@ verify_dir() { | |||||
| 55 | return 1 | 59 | return 1 | ||
| 56 | fi | 60 | fi | ||
| 57 | } | 61 | } | ||
| 58 | - | verify_file "/boot/vmlinuz-linux" "Kernel" | 62 | + | # Use the selected kernel name from config |
| 59 | - | verify_file "/boot/initramfs-linux.img" "Initramfs" | 63 | + | KERNEL_NAME="${ARCHUP_KERNEL:-linux}" |
| 60 | - | verify_file "/boot/initramfs-linux-fallback.img" "Fallback initramfs" | 64 | + | |
| 65 | + | verify_file "/boot/vmlinuz-${KERNEL_NAME}" "Kernel" | |||
| 66 | + | verify_file "/boot/initramfs-${KERNEL_NAME}.img" "Initramfs" | |||
| 67 | + | ||||
| 68 | + | # Fallback initramfs is optional | |||
| 69 | + | if [ -f "/mnt/boot/initramfs-${KERNEL_NAME}-fallback.img" ]; then | |||
| 70 | + | echo "[OK] Fallback initramfs: /boot/initramfs-${KERNEL_NAME}-fallback.img" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 71 | + | else | |||
| 72 | + | echo "[WARN] Fallback initramfs not generated (optional)" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 73 | + | fi | |||
| 61 | 74 | ||||
| 62 | verify_file "/boot/EFI/limine/BOOTX64.EFI" "Limine bootloader" | 75 | verify_file "/boot/EFI/limine/BOOTX64.EFI" "Limine bootloader" | ||
| 63 | verify_file "/boot/EFI/limine/limine.conf" "Limine configuration" | 76 | verify_file "/boot/EFI/limine/limine.conf" "Limine configuration" | ||
| @@ -128,3 +141,7 @@ else | |||||
| 128 | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[WARN] Continuing despite verification errors" | 141 | gum style --foreground 3 --padding "0 0 1 $PADDING_LEFT" "[WARN] Continuing despite verification errors" | ||
| 129 | echo "User chose to continue despite verification errors" >> "$ARCHUP_INSTALL_LOG_FILE" | 142 | echo "User chose to continue despite verification errors" >> "$ARCHUP_INSTALL_LOG_FILE" | ||
| 130 | fi | 143 | fi | ||
| 144 | + | ||||
| 145 | + | # Re-enable exit-on-error and ERR trap for subsequent scripts | |||
| 146 | + | set -e | |||
| 147 | + | trap 'catch_errors' ERR | |||