feat(boot): integrate Plymouth splash boot and update Limine EFI configuration
- commit
- fa93e6f81e338a2356c6122d9ee8255fa2970c09
- author
- bnema · · 2025-10-20 18:44 UTC
- parent
- ea692be
- signature
- unsigned
1 file · +26 -23
M install/boot/limine.sh +26 -23
| @@ -8,22 +8,18 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |||
| 8 | 8 | # For encrypted setups, we need the root partition UUID (before LUKS) | |
| 9 | 9 | ROOT_UUID=$(blkid -s UUID -o value "$ARCHUP_ROOT_PART") | |
| 10 | 10 | ||
| 11 | - | # Update mkinitcpio.conf to add encrypt hook | |
| 12 | 11 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring initramfs for encryption..." | |
| 13 | 12 | ||
| 14 | - | # Add encrypt hook before filesystems hook | |
| 15 | - | sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block encrypt filesystems fsck)/' /mnt/etc/mkinitcpio.conf | |
| 13 | + | sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block plymouth encrypt filesystems fsck)/' /mnt/etc/mkinitcpio.conf | |
| 16 | 14 | ||
| 17 | - | # Regenerate initramfs | |
| 18 | - | arch-chroot /mnt mkinitcpio -P >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 15 | + | echo "Configured mkinitcpio hooks for encrypted Plymouth boot" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 19 | 16 | ||
| 20 | - | echo "Updated mkinitcpio.conf with encrypt hook" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 21 | - | ||
| 22 | - | # Kernel parameters for encrypted boot | |
| 23 | 17 | KERNEL_PARAMS="cryptdevice=UUID=$ROOT_UUID:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw" | |
| 24 | 18 | else | |
| 25 | 19 | # For non-encrypted setups, use the root partition UUID directly | |
| 26 | 20 | ROOT_UUID=$(blkid -s UUID -o value "$ARCHUP_ROOT_PART") | |
| 21 | + | sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block plymouth filesystems fsck)/' /mnt/etc/mkinitcpio.conf | |
| 22 | + | echo "Configured mkinitcpio hooks for Plymouth boot" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 27 | 23 | KERNEL_PARAMS="root=UUID=$ROOT_UUID rootflags=subvol=@ rw" | |
| 28 | 24 | fi | |
| 29 | 25 | ||
| @@ -33,13 +29,23 @@ if [ -n "$ARCHUP_AMD_KERNEL_PARAMS" ]; then | |||
| 33 | 29 | echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 34 | 30 | fi | |
| 35 | 31 | ||
| 32 | + | KERNEL_PARAMS="$KERNEL_PARAMS quiet splash loglevel=3 rd.udev.log_priority=3 systemd.show_status=auto" | |
| 33 | + | ||
| 34 | + | # Regenerate initramfs with updated hooks (covers both encrypted and plain setups) | |
| 35 | + | arch-chroot /mnt mkinitcpio -P >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 36 | + | ||
| 36 | 37 | # Install Limine to the disk (BIOS - optional, will fail on UEFI-only systems) | |
| 37 | 38 | arch-chroot /mnt limine bios-install "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true | |
| 38 | 39 | ||
| 39 | - | # Create Limine configuration directory (Limine searches in /EFI/limine/) | |
| 40 | - | mkdir -p /mnt/boot/EFI/BOOT | |
| 40 | + | # Create Limine directory following official Arch Wiki method | |
| 41 | + | mkdir -p /mnt/boot/EFI/limine | |
| 41 | 42 | ||
| 42 | - | cat > /mnt/boot/limine.conf <<EOF | |
| 43 | + | # Copy Limine EFI bootloader to recommended location | |
| 44 | + | cp /mnt/usr/share/limine/BOOTX64.EFI /mnt/boot/EFI/limine/ | |
| 45 | + | ||
| 46 | + | # Create Limine configuration file at recommended location | |
| 47 | + | # Using forward slash syntax and proper key names as per official documentation | |
| 48 | + | cat > /mnt/boot/EFI/limine/limine.conf <<EOF | |
| 43 | 49 | timeout: 0 | |
| 44 | 50 | default_entry: 0 | |
| 45 | 51 | interface_branding: ArchUp | |
| @@ -47,34 +53,31 @@ interface_branding_colour: 6 | |||
| 47 | 53 | graphics: yes | |
| 48 | 54 | quiet: yes | |
| 49 | 55 | ||
| 50 | - | :Arch Linux | |
| 56 | + | /Arch Linux | |
| 51 | 57 | protocol: linux | |
| 52 | - | kernel_path: boot():/vmlinuz-linux | |
| 53 | - | module_path: boot():/initramfs-linux.img | |
| 58 | + | path: boot():/vmlinuz-linux | |
| 54 | 59 | cmdline: $KERNEL_PARAMS | |
| 60 | + | module_path: boot():/initramfs-linux.img | |
| 55 | 61 | ||
| 56 | - | :Arch Linux (fallback) | |
| 62 | + | /Arch Linux (fallback) | |
| 57 | 63 | protocol: linux | |
| 58 | - | kernel_path: boot():/vmlinuz-linux | |
| 59 | - | module_path: boot():/initramfs-linux-fallback.img | |
| 64 | + | path: boot():/vmlinuz-linux | |
| 60 | 65 | cmdline: $KERNEL_PARAMS | |
| 66 | + | module_path: boot():/initramfs-linux-fallback.img | |
| 61 | 67 | EOF | |
| 62 | 68 | ||
| 63 | - | # Copy Limine EFI bootloader | |
| 64 | - | cp /mnt/usr/share/limine/BOOTX64.EFI /mnt/boot/EFI/BOOT/ | |
| 65 | - | ||
| 66 | 69 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Creating UEFI boot entry..." | |
| 67 | 70 | ||
| 68 | 71 | # Detect EFI partition number (usually 1) | |
| 69 | 72 | EFI_PART_NUM=$(echo "$ARCHUP_EFI_PART" | grep -o '[0-9]*$' | sed 's/^p//') | |
| 70 | 73 | ||
| 71 | - | # Add UEFI boot entry using efibootmgr | |
| 72 | - | # Limine doesn't automatically create NVRAM entry, we need to do it manually | |
| 74 | + | # Add UEFI boot entry using efibootmgr following official method | |
| 73 | 75 | arch-chroot /mnt efibootmgr --create \ | |
| 74 | 76 | --disk "$ARCHUP_DISK" \ | |
| 75 | 77 | --part "$EFI_PART_NUM" \ | |
| 76 | 78 | --label "ArchUp" \ | |
| 77 | - | --loader "\\EFI\\BOOT\\BOOTX64.EFI" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 79 | + | --loader "\\EFI\\limine\\BOOTX64.EFI" \ | |
| 80 | + | --unicode >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 78 | 81 | ||
| 79 | 82 | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Limine installed and configured" | |
| 80 | 83 | ||
| @@ -8,22 +8,18 @@ if [ "$ARCHUP_ENCRYPTION" = "enabled" ]; then | |||||
| 8 | # For encrypted setups, we need the root partition UUID (before LUKS) | 8 | # For encrypted setups, we need the root partition UUID (before LUKS) | ||
| 9 | ROOT_UUID=$(blkid -s UUID -o value "$ARCHUP_ROOT_PART") | 9 | ROOT_UUID=$(blkid -s UUID -o value "$ARCHUP_ROOT_PART") | ||
| 10 | 10 | ||||
| 11 | - | # Update mkinitcpio.conf to add encrypt hook | |||
| 12 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring initramfs for encryption..." | 11 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring initramfs for encryption..." | ||
| 13 | 12 | ||||
| 14 | - | # Add encrypt hook before filesystems hook | 13 | + | sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block plymouth encrypt filesystems fsck)/' /mnt/etc/mkinitcpio.conf |
| 15 | - | sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block encrypt filesystems fsck)/' /mnt/etc/mkinitcpio.conf | |||
| 16 | 14 | ||||
| 17 | - | # Regenerate initramfs | 15 | + | echo "Configured mkinitcpio hooks for encrypted Plymouth boot" >> "$ARCHUP_INSTALL_LOG_FILE" |
| 18 | - | arch-chroot /mnt mkinitcpio -P >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 19 | 16 | ||||
| 20 | - | echo "Updated mkinitcpio.conf with encrypt hook" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 21 | - | ||||
| 22 | - | # Kernel parameters for encrypted boot | |||
| 23 | KERNEL_PARAMS="cryptdevice=UUID=$ROOT_UUID:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw" | 17 | KERNEL_PARAMS="cryptdevice=UUID=$ROOT_UUID:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=@ rw" | ||
| 24 | else | 18 | else | ||
| 25 | # For non-encrypted setups, use the root partition UUID directly | 19 | # For non-encrypted setups, use the root partition UUID directly | ||
| 26 | ROOT_UUID=$(blkid -s UUID -o value "$ARCHUP_ROOT_PART") | 20 | ROOT_UUID=$(blkid -s UUID -o value "$ARCHUP_ROOT_PART") | ||
| 21 | + | sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block plymouth filesystems fsck)/' /mnt/etc/mkinitcpio.conf | |||
| 22 | + | echo "Configured mkinitcpio hooks for Plymouth boot" >> "$ARCHUP_INSTALL_LOG_FILE" | |||
| 27 | KERNEL_PARAMS="root=UUID=$ROOT_UUID rootflags=subvol=@ rw" | 23 | KERNEL_PARAMS="root=UUID=$ROOT_UUID rootflags=subvol=@ rw" | ||
| 28 | fi | 24 | fi | ||
| 29 | 25 | ||||
| @@ -33,13 +29,23 @@ if [ -n "$ARCHUP_AMD_KERNEL_PARAMS" ]; then | |||||
| 33 | echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" >> "$ARCHUP_INSTALL_LOG_FILE" | 29 | echo "Added AMD kernel params: $ARCHUP_AMD_KERNEL_PARAMS" >> "$ARCHUP_INSTALL_LOG_FILE" | ||
| 34 | fi | 30 | fi | ||
| 35 | 31 | ||||
| 32 | + | KERNEL_PARAMS="$KERNEL_PARAMS quiet splash loglevel=3 rd.udev.log_priority=3 systemd.show_status=auto" | |||
| 33 | + | ||||
| 34 | + | # Regenerate initramfs with updated hooks (covers both encrypted and plain setups) | |||
| 35 | + | arch-chroot /mnt mkinitcpio -P >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 36 | + | ||||
| 36 | # Install Limine to the disk (BIOS - optional, will fail on UEFI-only systems) | 37 | # Install Limine to the disk (BIOS - optional, will fail on UEFI-only systems) | ||
| 37 | arch-chroot /mnt limine bios-install "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true | 38 | arch-chroot /mnt limine bios-install "$ARCHUP_DISK" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 || true | ||
| 38 | 39 | ||||
| 39 | - | # Create Limine configuration directory (Limine searches in /EFI/limine/) | 40 | + | # Create Limine directory following official Arch Wiki method |
| 40 | - | mkdir -p /mnt/boot/EFI/BOOT | 41 | + | mkdir -p /mnt/boot/EFI/limine |
| 41 | 42 | ||||
| 42 | - | cat > /mnt/boot/limine.conf <<EOF | 43 | + | # Copy Limine EFI bootloader to recommended location |
| 44 | + | cp /mnt/usr/share/limine/BOOTX64.EFI /mnt/boot/EFI/limine/ | |||
| 45 | + | ||||
| 46 | + | # Create Limine configuration file at recommended location | |||
| 47 | + | # Using forward slash syntax and proper key names as per official documentation | |||
| 48 | + | cat > /mnt/boot/EFI/limine/limine.conf <<EOF | |||
| 43 | timeout: 0 | 49 | timeout: 0 | ||
| 44 | default_entry: 0 | 50 | default_entry: 0 | ||
| 45 | interface_branding: ArchUp | 51 | interface_branding: ArchUp | ||
| @@ -47,34 +53,31 @@ interface_branding_colour: 6 | |||||
| 47 | graphics: yes | 53 | graphics: yes | ||
| 48 | quiet: yes | 54 | quiet: yes | ||
| 49 | 55 | ||||
| 50 | - | :Arch Linux | 56 | + | /Arch Linux |
| 51 | protocol: linux | 57 | protocol: linux | ||
| 52 | - | kernel_path: boot():/vmlinuz-linux | 58 | + | path: boot():/vmlinuz-linux |
| 53 | - | module_path: boot():/initramfs-linux.img | |||
| 54 | cmdline: $KERNEL_PARAMS | 59 | cmdline: $KERNEL_PARAMS | ||
| 60 | + | module_path: boot():/initramfs-linux.img | |||
| 55 | 61 | ||||
| 56 | - | :Arch Linux (fallback) | 62 | + | /Arch Linux (fallback) |
| 57 | protocol: linux | 63 | protocol: linux | ||
| 58 | - | kernel_path: boot():/vmlinuz-linux | 64 | + | path: boot():/vmlinuz-linux |
| 59 | - | module_path: boot():/initramfs-linux-fallback.img | |||
| 60 | cmdline: $KERNEL_PARAMS | 65 | cmdline: $KERNEL_PARAMS | ||
| 66 | + | module_path: boot():/initramfs-linux-fallback.img | |||
| 61 | EOF | 67 | EOF | ||
| 62 | 68 | ||||
| 63 | - | # Copy Limine EFI bootloader | |||
| 64 | - | cp /mnt/usr/share/limine/BOOTX64.EFI /mnt/boot/EFI/BOOT/ | |||
| 65 | - | ||||
| 66 | 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..." | ||
| 67 | 70 | ||||
| 68 | # Detect EFI partition number (usually 1) | 71 | # Detect EFI partition number (usually 1) | ||
| 69 | EFI_PART_NUM=$(echo "$ARCHUP_EFI_PART" | grep -o '[0-9]*$' | sed 's/^p//') | 72 | EFI_PART_NUM=$(echo "$ARCHUP_EFI_PART" | grep -o '[0-9]*$' | sed 's/^p//') | ||
| 70 | 73 | ||||
| 71 | - | # Add UEFI boot entry using efibootmgr | 74 | + | # Add UEFI boot entry using efibootmgr following official method |
| 72 | - | # Limine doesn't automatically create NVRAM entry, we need to do it manually | |||
| 73 | arch-chroot /mnt efibootmgr --create \ | 75 | arch-chroot /mnt efibootmgr --create \ | ||
| 74 | --disk "$ARCHUP_DISK" \ | 76 | --disk "$ARCHUP_DISK" \ | ||
| 75 | --part "$EFI_PART_NUM" \ | 77 | --part "$EFI_PART_NUM" \ | ||
| 76 | --label "ArchUp" \ | 78 | --label "ArchUp" \ | ||
| 77 | - | --loader "\\EFI\\BOOT\\BOOTX64.EFI" >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | 79 | + | --loader "\\EFI\\limine\\BOOTX64.EFI" \ |
| 80 | + | --unicode >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 78 | 81 | ||||
| 79 | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Limine installed and configured" | 82 | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Limine installed and configured" | ||
| 80 | 83 | ||||