Add: 'Grub' bootloader installation: support for 'i386-efi' has been added

Change: When selecting 'linux-hardened' kernel, a warning prompt notifies that 'System Hibernation' is not supported by kernel
Change: Edit prompts for enhanced visuals/aesthetics
This commit is contained in:
Jane Doe 2024-10-22 20:21:08 +00:00
parent 8086f12ff3
commit d0639370b1

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Amelia Installer # Amelia Installer
# Version: 8.0.1 # Version: 8.0.2
set -euo pipefail set -euo pipefail
################################################################################################### ###################################################################################################
@ -397,7 +397,11 @@ uefi_check() {
${magenta}###${nc}---------------------------------${magenta}[ ${bwhite}UEFI Mode Verification${nc} ${magenta}]${nc}---------------------------------${magenta}### ${magenta}###${nc}---------------------------------${magenta}[ ${bwhite}UEFI Mode Verification${nc} ${magenta}]${nc}---------------------------------${magenta}###
" "
if [[ "${bootmode}" == "64" || "${bootmode}" == "32" ]]; then if [[ "${bootmode}" == "64" ]]; then
bitness="x86_64-efi"
ok
elif [[ "${bootmode}" == "32" ]]; then
bitness="i386-efi"
ok ok
else else
RED " RED "
@ -970,7 +974,7 @@ Enter a number: "
if [[ "${kernelnmbr}" == "3" ]]; then if [[ "${kernelnmbr}" == "3" ]]; then
CYAN " CYAN "
(*) ${nc}Swapping is ${yellowl}NOT SUPPORTED (*) ${nc}System Hibernation is ${yellowl}NOT SUPPORTED ${nc}by kernel
" "
fi fi
ok ok
@ -1144,7 +1148,7 @@ Enter [Y/n]: "
y_n y_n
return 1 return 1
fi fi
local prompt="Secure Signing" local prompt="Secure Boot Signing setup"
ok ok
} }
################################################################################################### ###################################################################################################
@ -1265,36 +1269,6 @@ ask_swap() {
${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}Swap Selection${nc} ${magenta}]${nc}-------------------------------------${magenta}### ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}Swap Selection${nc} ${magenta}]${nc}-------------------------------------${magenta}###
" "
if [[ "${kernelnmbr}" == "3" ]]; then
sleep 0.2
RED "
-----------------------------------------------
### ${yellow}Incompatible Kernel has been detected ${red}###
-----------------------------------------------"
CYAN "
(*) ${nc}Swap type will default to ${yellowl}'None' "
NC "
${bwhite}Press any key to continue${nc}
"
read -r -s -n 1
swapmode="4"
skip
ok
if [[ "${vga_slct}" == "yes" ]]; then
local stage_prompt="Graphics Setup"
completion_err
until dtct_hyper; do : ; done
until dtct_vga; do : ; done
fi
return 0
fi
YELLOW " YELLOW "
> Select Swap type: " > Select Swap type: "
@ -1761,9 +1735,9 @@ Enter a number: "
if [[ "${swapmode}" == "3" || "${swapmode}" == "4" ]]; then if [[ "${swapmode}" == "3" || "${swapmode}" == "4" ]]; then
sleep 0.2 sleep 0.2
RED " RED "
------------------------------------------------------ --------------------------------------------
### ${yellow}Incompatible Swap setting have been detected ${red}### ### ${yellow}Incompatible Swap setting detected ${red}###
------------------------------------------------------" --------------------------------------------"
CYAN " CYAN "
(*) ${nc}Nvidia's ${yellowl}'Suspend/Resume' ${nc}feature needs a valid ${yellowl}swapping ${nc}mechanism to work (*) ${nc}Nvidia's ${yellowl}'Suspend/Resume' ${nc}feature needs a valid ${yellowl}swapping ${nc}mechanism to work
@ -3558,15 +3532,15 @@ ${magenta}###${nc}------------------------------------${magenta}[ ${bwhite}Encry
if [[ "${bootloader}" == "2" && "${espmnt}" == "1" ]]; then if [[ "${bootloader}" == "2" && "${espmnt}" == "1" ]]; then
sleep 0.2 sleep 0.2
RED " RED "
-------------------------------------------------- -----------------------------------------
### ${yellow}Incompatible selection has been detected ${red}### ### ${yellow}Incompatible Selection detected ${red}###
--------------------------------------------------" -----------------------------------------"
YELLOW " YELLOW "
### ESP cannot be mounted at '/efi' when using Grub on a LUKS encrypted Root partition ### ESP cannot be mounted at ${nc}'/efi' ${yellow}when using Grub on a LUKS encrypted Root partition
> Change ESP mountpoint to '/boot' instead ? [Y/n] " > Change ESP mountpoint to ${nc}'/boot' ${yellow}instead ? [Y/n] "
BLUE " BLUE "
@ -5058,7 +5032,7 @@ Enter country name or country code ${bwhite}(Empty for Defaults)${blue}: "
YELLOW " YELLOW "
> Enable Pacman's 'Parallel Downloads' feature? [Y/n] " > Enable Pacman's ${nc}'Parallel Downloads' ${yellow}feature ? [Y/n] "
BLUE " BLUE "
@ -5239,7 +5213,7 @@ FSTAB
################################################################################################### ###################################################################################################
swapfile_btrfs() { swapfile_btrfs() {
local stage_prompt="Btfrs Swapfile" local stage_prompt="Btrfs Swapfile"
sleep 0.2 sleep 0.2
NC " NC "
@ -5362,7 +5336,7 @@ GRUB
local stage_prompt="Grub Installation" local stage_prompt="Grub Installation"
if [[ "${sb_sign}" == "y" ]]; then if [[ "${sb_sign}" == "y" ]]; then
if arch-chroot /mnt <<-SBGRUBINST > /dev/null 2>&1 ; then if arch-chroot /mnt <<-SBGRUBINST > /dev/null 2>&1 ; then
grub-install --target=x86_64-efi --efi-directory=${btldr_esp_mount} --bootloader-id=GRUB --modules="tpm" --disable-shim-lock --recheck || exit grub-install --target=${bitness} --efi-directory=${btldr_esp_mount} --bootloader-id=GRUB --modules="tpm" --disable-shim-lock --recheck || exit
sed -i 's/SecureBoot/SecureB00t/' ${btldr_esp_mount}/EFI/GRUB/grubx64.efi || exit sed -i 's/SecureBoot/SecureB00t/' ${btldr_esp_mount}/EFI/GRUB/grubx64.efi || exit
grub-mkconfig -o /boot/grub/grub.cfg || exit grub-mkconfig -o /boot/grub/grub.cfg || exit
SBGRUBINST SBGRUBINST
@ -5372,7 +5346,7 @@ SBGRUBINST
fi fi
elif [[ "${sb_sign}" == "n" ]]; then elif [[ "${sb_sign}" == "n" ]]; then
if arch-chroot /mnt <<-GRUBINST > /dev/null 2>&1 ; then if arch-chroot /mnt <<-GRUBINST > /dev/null 2>&1 ; then
grub-install --target=x86_64-efi --efi-directory=${btldr_esp_mount} --bootloader-id=GRUB --recheck || exit grub-install --target=${bitness} --efi-directory=${btldr_esp_mount} --bootloader-id=GRUB --recheck || exit
grub-mkconfig -o /boot/grub/grub.cfg || exit grub-mkconfig -o /boot/grub/grub.cfg || exit
GRUBINST GRUBINST
stage_ok stage_ok
@ -5590,11 +5564,6 @@ SECSIGN
################################################################################################### ###################################################################################################
set_vars() { set_vars() {
# Linux-Hardened = No Swap
if [[ "${kernelnmbr}" == "3" ]]; then
swapmode="4"
fi
#### Encrypted Setup Vars #### Encrypted Setup Vars
if [[ "${encrypt}" == "yes" ]]; then if [[ "${encrypt}" == "yes" ]]; then
# Encrypted Root Device # Encrypted Root Device
@ -6087,7 +6056,7 @@ OPTIMIZED
tty="$(tty)" tty="$(tty)"
disks="$(lsblk --nodeps --paths --noheadings --output=name,size,model | cat --number)" disks="$(lsblk --nodeps --paths --noheadings --output=name,size,model | cat --number)"
trg="" trg=""
vars=(LOCALESET="" SETLOCALE="" lcl_slct="" USERNAME="" kernelnmbr="" fs="" vgapkgs="" vgacount="" vgacard="" intelcount="" intelcards="" nvidiacount="" nvidiacards="" amdcount="" amdcards="" vgaconf="" vga_conf="" vga_setup="" vendor="" vendor1="" vendor2="" vendor3="" vendor_slct="" packages="" efi_entr_del="" wrlss_rgd="" sanity="" install="" bootldr_pkgs="" devel="" REGDOM="" vga_bootopts="" btrfs_bootopts="" trim="" swapmode="" homecrypt="" greeter="" revision="" greeternmbr="" cust_bootopts="" bluetooth="" vmpkgs="" vm_services="" perf_stream="" displaymanager="" wireless_reg="" bootmode="" bootloader="" vga_slct="" espsize="" autoroot="" autoesp="" autoxboot="" autohome="" autoswap="" rootprt="" espprt="" xbootprt="" homeprt="" swapprt="" partok="" use_manpreset="" instl_drive="" sgdsk_nmbr="" part_mode="" preset="" capacity="" cap_gib="" rootsize="" sgdrive="" cgdrive="" smartpart="" presetpart="" prcnt="" roottype="" stage_prompt="" zram="" zram_bootopts="" xbootloader="" multibooting="" hypervisor="" mkinitcpio_mods="" uki="" ukify="" slct_autoprt="" cng_espmnt="" sep_home="" encr_swap_bootopts="") vars=(LOCALESET="" SETLOCALE="" lcl_slct="" USERNAME="" kernelnmbr="" fs="" vgapkgs="" vgacount="" vgacard="" intelcount="" intelcards="" nvidiacount="" nvidiacards="" amdcount="" amdcards="" vgaconf="" vga_conf="" vga_setup="" vendor="" vendor1="" vendor2="" vendor3="" vendor_slct="" packages="" efi_entr_del="" wrlss_rgd="" sanity="" install="" bootldr_pkgs="" devel="" REGDOM="" vga_bootopts="" btrfs_bootopts="" trim="" swapmode="" homecrypt="" greeter="" revision="" greeternmbr="" cust_bootopts="" bluetooth="" vmpkgs="" vm_services="" perf_stream="" displaymanager="" wireless_reg="" bootmode="" bootloader="" vga_slct="" espsize="" autoroot="" autoesp="" autoxboot="" autohome="" autoswap="" rootprt="" espprt="" xbootprt="" homeprt="" swapprt="" partok="" use_manpreset="" instl_drive="" sgdsk_nmbr="" part_mode="" preset="" capacity="" cap_gib="" rootsize="" sgdrive="" cgdrive="" smartpart="" presetpart="" prcnt="" roottype="" stage_prompt="" zram="" zram_bootopts="" xbootloader="" multibooting="" hypervisor="" mkinitcpio_mods="" uki="" ukify="" slct_autoprt="" cng_espmnt="" sep_home="" encr_swap_bootopts="" bitness="")
export "${vars[@]}" export "${vars[@]}"
clear clear
first_check first_check