Add: New feature > The installer now offers automatic, post-installation, UKI creation for all Kernels

Change: Some prompt edits, identation fixes, code refinement.
This commit is contained in:
Jane Doe
2026-04-07 23:03:29 +03:00
parent e4d57713ae
commit fe5ca09c87
+119 -70
View File
@@ -1,8 +1,9 @@
#!/bin/bash #!/usr/bin/env bash
# Amelia installer for Archlinux # Amelia installer for Archlinux
# Version: 1.4.3 # Version: 1.5.0
# Source: https://gitlab.com/prism7/archery # Source: https://gitlab.com/prism7/archery
# shellcheck disable=SC2154
set -euo pipefail set -euo pipefail
@@ -615,7 +616,7 @@ slct_shell() {
sys_submn() { sys_submn() {
title "System Configuration" title "System Configuration"
ask "Select a Submenu" ask "Select a Submenu"
NC "\n\n [1] Kernel, Secureboot Signing, Bootloader & ESP Mountpoint\n\n [2] Filesystem & Swap Setup\n\n [3] Graphics Setup\n\n [4] Desktop Setup\n\n [5] EFI Boot Entries Deletion\n\n [6] Extended Options\n\n [ ] Return to Main Menu" NC "\n\n [1] Kernel, Secure Boot Signing, Bootloader & ESP Mountpoint\n\n [2] Filesystem & Swap Setup\n\n [3] Graphics Setup\n\n [4] Desktop Setup\n\n [5] EFI Boot Entries Deletion\n\n [6] Extended Options\n\n [ ] Return to Main Menu"
get "Enter a number" get "Enter a number"
read -r -p "==> " sysmenu read -r -p "==> " sysmenu
case "${sysmenu}" in case "${sysmenu}" in
@@ -681,7 +682,7 @@ slct_krnl() {
ok ok
} }
ask_sign() { ask_sign() {
title "Secureboot Signing" title "Secure Boot Signing"
ask "Sign UKI(s), Kernel & binaries for use with Secure Boot ? [y/N]" ask "Sign UKI(s), Kernel & binaries for use with Secure Boot ? [y/N]"
get "Enter [y/N]" get "Enter [y/N]"
read -r -p "==> " sb_sign read -r -p "==> " sb_sign
@@ -733,7 +734,27 @@ slct_bootldr() {
1) 1)
uki="y" uki="y"
ukify="systemd-ukify" ukify="systemd-ukify"
ack "Systemd-boot has been selected" ;; ack "Systemd-boot has been selected"
local prompt="UKI(s) Auto-generation"
CYAN "\n\n\n ### ${nc}UKIs can be generated for every additional Kernel installed\n\n${cyan} ### ${nc}Secure Boot signing will be performed automatically for all subsequent UKIs"
ask "Automate UKI(s) generation ? [Y/n]"
get "Enter [Y/n]"
read -r -p "==> " uki_use
uki_use="${uki_use:-y}"
uki_use="${uki_use,,}"
case "${uki_use}" in
y)
ack "UKI(s) Auto-generation has been selected" ;;
n)
skip ;;
"")
y_n
reload
return 1 ;;
*)
invalid
return 1 ;;
esac ;;
2) 2)
uki="n" uki="n"
ask "Select a Boot Path to install to" ask "Select a Boot Path to install to"
@@ -2757,7 +2778,7 @@ instl() {
until slct_shell; do : ; done until slct_shell; do : ; done
fi fi
if [[ -z "${kernelnmbr}" || "${revision}" == "y" ]]; then if [[ -z "${kernelnmbr}" || "${revision}" == "y" ]]; then
local stage_prompt="Kernel, Secureboot Signing, Bootloader & ESP Mountpoint" local stage_prompt="Kernel, Secure Boot Signing, Bootloader & ESP Mountpoint"
completion_err completion_err
until slct_krnl; do : ; done until slct_krnl; do : ; done
until ask_sign; do : ; done until ask_sign; do : ; done
@@ -3415,7 +3436,7 @@ revise() {
revision="y" revision="y"
gfxpkgs=() gfxpkgs=()
validpkgs=() validpkgs=()
reset=(trg="" xbootloader="" desktop="" terminal="" custompkgs="" customservices="" cust_bootopts="" REGDOM="" autoroot="" autoxboot="" autohome="" autoswap="" lowlat="" nogsp="" sanity="" partok="" preset="" set_ext_opt="" ask_param="" kill_watchdog="" sys_optm="" desk_setup="" devel="" web="" web_pkg="" web_aur="" web_slct="" oomd="" irqbalance="" thermald="" rngd="" rtkit="" tlp="" CRYPTPASS="" CRYPTPASS2="" show_extopts="" gptslct="" gptok="" gptabort="" nvidiaprop="" nowarning="" hometype="" homeform="" smartpart="" LuksParts="" nvidia_aur="" web_aur_url="" session="" alt_session="" session_support="" alt_session_pack="") reset=(trg="" xbootloader="" desktop="" terminal="" custompkgs="" customservices="" cust_bootopts="" REGDOM="" autoroot="" autoxboot="" autohome="" autoswap="" lowlat="" nogsp="" sanity="" partok="" preset="" set_ext_opt="" ask_param="" kill_watchdog="" sys_optm="" desk_setup="" devel="" web="" web_pkg="" web_aur="" web_slct="" oomd="" irqbalance="" thermald="" rngd="" rtkit="" tlp="" CRYPTPASS="" CRYPTPASS2="" show_extopts="" gptslct="" gptok="" gptabort="" nvidiaprop="" nowarning="" hometype="" homeform="" smartpart="" LuksParts="" nvidia_aur="" web_aur_url="" session="" alt_session="" session_support="" alt_session_pack="" uki_use="" p="" k="")
export "${reset[@]}" export "${reset[@]}"
instl instl
} }
@@ -3669,6 +3690,7 @@ pkg_collection() {
[[ "${vendor}" == "Virtual Machine" ]] && basepkgs+=("${vmpkgs}") [[ "${vendor}" == "Virtual Machine" ]] && basepkgs+=("${vmpkgs}")
[[ "${vendor}" != "Virtual Machine" ]] && basepkgs+=(alsa-firmware linux-firmware sof-firmware) [[ "${vendor}" != "Virtual Machine" ]] && basepkgs+=(alsa-firmware linux-firmware sof-firmware)
[[ "${terminal}" == "y" ]] && basepkgs+=(gnome-terminal) [[ "${terminal}" == "y" ]] && basepkgs+=(gnome-terminal)
[[ "${sb_sign}" == "y" ]] && basepkgs+=(sbctl)
[[ "${nvidiaprop}" == "y" ]] && basepkgs+=("${kernel}-headers") [[ "${nvidiaprop}" == "y" ]] && basepkgs+=("${kernel}-headers")
[[ "${session_support}" == "y" ]] && basepkgs+=("${alt_session_pack}") [[ "${session_support}" == "y" ]] && basepkgs+=("${alt_session_pack}")
[[ ! "${desktop}" =~ ^(11|12)$ ]] && basepkgs+=(7zip alsa-plugins alsa-utils bluez bluez-hid2hci bluez-obex bluez-utils exfatprogs git glibc-locales gst-libav gst-plugin-libcamera gst-plugin-pipewire gst-plugins-bad gst-plugins-good gst-plugins-ugly libfido2 man-db man-pages mesa-utils nano-syntax-highlighting pacman-contrib pipewire-alsa pipewire-libcamera pipewire-onnx pipewire-pulse pipewire-zeroconf reflector usb_modeswitch xdg-user-dirs) [[ ! "${desktop}" =~ ^(11|12)$ ]] && basepkgs+=(7zip alsa-plugins alsa-utils bluez bluez-hid2hci bluez-obex bluez-utils exfatprogs git glibc-locales gst-libav gst-plugin-libcamera gst-plugin-pipewire gst-plugins-bad gst-plugins-good gst-plugins-ugly libfido2 man-db man-pages mesa-utils nano-syntax-highlighting pacman-contrib pipewire-alsa pipewire-libcamera pipewire-onnx pipewire-pulse pipewire-zeroconf reflector usb_modeswitch xdg-user-dirs)
@@ -3716,6 +3738,7 @@ pkg_collection() {
[[ -n "${print_pkgs}" ]] && custarray+=("${print_pkgs}") [[ -n "${print_pkgs}" ]] && custarray+=("${print_pkgs}")
[[ "${vendor}" == "Virtual Machine" ]] && custarray+=("${vmpkgs}") [[ "${vendor}" == "Virtual Machine" ]] && custarray+=("${vmpkgs}")
[[ "${vendor}" != "Virtual Machine" ]] && custarray+=(linux-firmware) [[ "${vendor}" != "Virtual Machine" ]] && custarray+=(linux-firmware)
[[ "${sb_sign}" == "y" ]] && custarray+=(sbctl)
[[ "${nvidiaprop}" == "y" ]] && custarray+=("${kernel}-headers") [[ "${nvidiaprop}" == "y" ]] && custarray+=("${kernel}-headers")
deskpkgs="${custarray[*]}" ;; deskpkgs="${custarray[*]}" ;;
13) # Cosmic Desktop: 13) # Cosmic Desktop:
@@ -3736,7 +3759,7 @@ pkg_validation() {
keypress keypress
valids="${validpkgs[*]}" valids="${validpkgs[*]}"
printf "\n\n" printf "\n\n"
if pacman -Syy > "${void}" 2>&1 2> "${log}" && pacman -Spd ${valids} > "${void}" 2>&1 2> "${log}"; then if pacman -Syy > "${log}" 2>&1 && pacman -Spd ${valids} > "${log}" 2>&1; then
ok ok
if [[ -n "${web_aur}" ]]; then if [[ -n "${web_aur}" ]]; then
local prompt="${web_name} Package Validation" local prompt="${web_name} Package Validation"
@@ -3782,7 +3805,7 @@ pacstrap_system() {
YELLOWL "\n\n\n ---------------------------------------\n ### ${nc}Building ${bwhite}Nvidia-580xx ${nc}Drivers ${yellowl}###\n ---------------------------------------${nc}\n ... Please Wait ...\n\n\n" YELLOWL "\n\n\n ---------------------------------------\n ### ${nc}Building ${bwhite}Nvidia-580xx ${nc}Drivers ${yellowl}###\n ---------------------------------------${nc}\n ... Please Wait ...\n\n\n"
if [[ "${dev}" != "y" ]]; then if [[ "${dev}" != "y" ]]; then
local stage_prompt="Base-devel Package Installation" local stage_prompt="Base-devel Package Installation"
if arch-chroot /mnt <<-BASE_DEVEL > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-BASE_DEVEL > "${log}" 2>&1 ; then
pacman -S --noconfirm base-devel pacman -S --noconfirm base-devel
BASE_DEVEL BASE_DEVEL
stage_ok stage_ok
@@ -3792,7 +3815,7 @@ BASE_DEVEL
fi fi
if [[ "${desktop}" =~ ^(11|12)$ ]]; then if [[ "${desktop}" =~ ^(11|12)$ ]]; then
local stage_prompt="Git Package Installation" local stage_prompt="Git Package Installation"
if arch-chroot /mnt <<-GIT > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-GIT > "${log}" 2>&1 ; then
pacman -S --noconfirm git pacman -S --noconfirm git
GIT GIT
stage_ok stage_ok
@@ -3801,7 +3824,7 @@ GIT
fi fi
fi fi
local stage_prompt="AUR Nvidia Packages Installation" local stage_prompt="AUR Nvidia Packages Installation"
if arch-chroot /mnt <<-AUR_NVIDIA_PKGS > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-AUR_NVIDIA_PKGS > "${log}" 2>&1 ; then
sed -i 's|if (( EUID == 0 )); then|if (( EUID != 0 )); then|g' /usr/bin/makepkg sed -i 's|if (( EUID == 0 )); then|if (( EUID != 0 )); then|g' /usr/bin/makepkg
git clone --branch nvidia-580xx-utils --single-branch https://github.com/archlinux/aur.git nvidia-580xx-utils && cd nvidia-580xx-utils && makepkg -s --noconfirm && sudo pacman -U --noconfirm *x86_64.pkg.tar.zst && cd .. && rm -rf nvidia-580xx-utils git clone --branch nvidia-580xx-utils --single-branch https://github.com/archlinux/aur.git nvidia-580xx-utils && cd nvidia-580xx-utils && makepkg -s --noconfirm && sudo pacman -U --noconfirm *x86_64.pkg.tar.zst && cd .. && rm -rf nvidia-580xx-utils
git clone --branch nvidia-580xx-settings --single-branch https://github.com/archlinux/aur.git nvidia-580xx-settings && cd nvidia-580xx-settings && makepkg -s --noconfirm && sudo pacman -U --noconfirm *x86_64.pkg.tar.zst && cd .. && rm -rf nvidia-580xx-settings git clone --branch nvidia-580xx-settings --single-branch https://github.com/archlinux/aur.git nvidia-580xx-settings && cd nvidia-580xx-settings && makepkg -s --noconfirm && sudo pacman -U --noconfirm *x86_64.pkg.tar.zst && cd .. && rm -rf nvidia-580xx-settings
@@ -3822,7 +3845,7 @@ AUR_NVIDIA_PKGS
local prompt="Fstab" local prompt="Fstab"
local stage_prompt="Fstab" local stage_prompt="Fstab"
genfstab -t PARTUUID /mnt >> /mnt/etc/fstab 2> "${log}" || stage_fail genfstab -t PARTUUID /mnt >> /mnt/etc/fstab 2> "${log}" || stage_fail
arch-chroot /mnt <<-FSTAB_SBVL_MNT_OPTS > "${void}" 2>&1 2> "${log}" || stage_fail arch-chroot /mnt <<-FSTAB_SBVL_MNT_OPTS > "${log}" 2>&1 || stage_fail
sed -i 's/^rw.*/${sbvl_mnt_opts}/' /etc/fstab sed -i 's/^rw.*/${sbvl_mnt_opts}/' /etc/fstab
FSTAB_SBVL_MNT_OPTS FSTAB_SBVL_MNT_OPTS
ok ok
@@ -3835,7 +3858,7 @@ swapfile() {
local prompt="Swapfile Setup" local prompt="Swapfile Setup"
local stage_prompt="Swapfile Setup" local stage_prompt="Swapfile Setup"
title "${prompt}" title "${prompt}"
if arch-chroot /mnt <<-SWAPFILE > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-SWAPFILE > "${log}" 2>&1 ; then
mkswap -U clear --size ${swapsize}G --file /swapfile mkswap -U clear --size ${swapsize}G --file /swapfile
SWAPFILE SWAPFILE
cat >> /mnt/etc/fstab <<-FSTAB || err_abort cat >> /mnt/etc/fstab <<-FSTAB || err_abort
@@ -3850,7 +3873,7 @@ swapfile_btrfs() {
local prompt="Btrfs Swapfile Setup" local prompt="Btrfs Swapfile Setup"
local stage_prompt="Btrfs Swapfile Setup" local stage_prompt="Btrfs Swapfile Setup"
title "${prompt}" title "${prompt}"
if arch-chroot /mnt <<-SWAPFILE_BTRFS > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-SWAPFILE_BTRFS > "${log}" 2>&1 ; then
btrfs filesystem mkswapfile --size ${swapsize}g --uuid clear /swap/swapfile btrfs filesystem mkswapfile --size ${swapsize}g --uuid clear /swap/swapfile
SWAPFILE_BTRFS SWAPFILE_BTRFS
cat >> /mnt/etc/fstab <<-FSTAB || err_abort cat >> /mnt/etc/fstab <<-FSTAB || err_abort
@@ -3873,7 +3896,7 @@ set_wireless_regdom() {
} }
main_chroot() { main_chroot() {
local stage_prompt="Base System Configuration" local stage_prompt="Base System Configuration"
if arch-chroot /mnt <<-CONF > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-CONF > "${log}" 2>&1 ; then
sed -i "/^#${SETLOCALE}/s/^#//" /etc/locale.gen sed -i "/^#${SETLOCALE}/s/^#//" /etc/locale.gen
locale-gen locale-gen
echo LANG=${SETLOCALE} > /etc/locale.conf echo LANG=${SETLOCALE} > /etc/locale.conf
@@ -3912,7 +3935,7 @@ mkinitcpio_preset() {
fi fi
if [[ "${setrescue}" == "y" ]]; then if [[ "${setrescue}" == "y" ]]; then
local stage_prompt="Uki + Rescue Uki Creation" local stage_prompt="Uki + Rescue Uki Creation"
if arch-chroot /mnt <<-UKI_RESCUE > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-UKI_RESCUE > "${log}" 2>&1 ; then
mkdir /etc/cmdline.d mkdir /etc/cmdline.d
echo "rw ${boot_opts[*]}" | tee /etc/cmdline.d/cmdlined.conf echo "rw ${boot_opts[*]}" | tee /etc/cmdline.d/cmdlined.conf
echo "systemd.unit=rescue.target rw ${boot_opts[*]}" | tee /etc/cmdline.d/rescued.conf echo "systemd.unit=rescue.target rw ${boot_opts[*]}" | tee /etc/cmdline.d/rescued.conf
@@ -3933,9 +3956,9 @@ UKI_RESCUE
else else
stage_fail stage_fail
fi fi
elif [[ -z "${setrescue}" ]]; then elif [[ "${setrescue}" == "n" ]]; then
local stage_prompt="Uki Creation" local stage_prompt="Uki Creation"
if arch-chroot /mnt <<-UKI > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-UKI > "${log}" 2>&1 ; then
mkdir /etc/cmdline.d mkdir /etc/cmdline.d
echo "rw ${boot_opts[*]}" | tee /etc/cmdline.d/cmdlined.conf echo "rw ${boot_opts[*]}" | tee /etc/cmdline.d/cmdlined.conf
cp /etc/mkinitcpio.d/${kernel}.preset /etc/mkinitcpio.d/${kernel}.preset.bak cp /etc/mkinitcpio.d/${kernel}.preset /etc/mkinitcpio.d/${kernel}.preset.bak
@@ -3945,7 +3968,7 @@ UKI_RESCUE
ALL_kver="/boot/vmlinuz-${kernel}" ALL_kver="/boot/vmlinuz-${kernel}"
PRESETS=('default') PRESETS=('default')
default_uki="${btldr_esp_mount}/EFI/Linux/arch-${kernel}.efi" default_uki="${btldr_esp_mount}/EFI/Linux/arch-${kernel}.efi"
default_options="--cmdline /etc/cmdline.d/cmdlined.conf default_options="--cmdline /etc/cmdline.d/cmdlined.conf"
MKINITCPIO_PRESET MKINITCPIO_PRESET
mkinitcpio -P mkinitcpio -P
UKI UKI
@@ -3961,7 +3984,7 @@ UKI
done done
elif [[ "${uki}" == "n" ]]; then elif [[ "${uki}" == "n" ]]; then
local stage_prompt="Initramfs Creation" local stage_prompt="Initramfs Creation"
if arch-chroot /mnt <<-INITRAMFS > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-INITRAMFS > "${log}" 2>&1 ; then
cp /etc/mkinitcpio.d/${kernel}.preset /etc/mkinitcpio.d/${kernel}.preset.bak cp /etc/mkinitcpio.d/${kernel}.preset /etc/mkinitcpio.d/${kernel}.preset.bak
cat <<-MKINITCPIO_PRESET > /etc/mkinitcpio.d/${kernel}.preset cat <<-MKINITCPIO_PRESET > /etc/mkinitcpio.d/${kernel}.preset
# mkinitcpio preset file for the '${kernel}' package # mkinitcpio preset file for the '${kernel}' package
@@ -3982,7 +4005,7 @@ btldrcfg() {
if [[ "${bootloader}" == "1" ]]; then if [[ "${bootloader}" == "1" ]]; then
local stage_prompt="Systemd-boot Configuration" local stage_prompt="Systemd-boot Configuration"
if [[ "${xbootloader}" == "no" ]]; then if [[ "${xbootloader}" == "no" ]]; then
if arch-chroot -S /mnt <<-SDBOOT_INSTL > "${void}" 2>&1 2> "${log}" ; then if arch-chroot -S /mnt <<-SDBOOT_INSTL > "${log}" 2>&1 ; then
bootctl install bootctl install
cat <<-LOADER_CFG > ${btldr_esp_mount}/loader/loader.conf cat <<-LOADER_CFG > ${btldr_esp_mount}/loader/loader.conf
timeout 3 timeout 3
@@ -3996,7 +4019,7 @@ SDBOOT_INSTL
stage_fail stage_fail
fi fi
elif [[ "${xbootloader}" == "yes" ]]; then elif [[ "${xbootloader}" == "yes" ]]; then
if arch-chroot -S /mnt <<-SDBOOT_XBOOTLDR_INSTL > "${void}" 2>&1 2> "${log}" ; then if arch-chroot -S /mnt <<-SDBOOT_XBOOTLDR_INSTL > "${log}" 2>&1 ; then
bootctl --esp-path=/efi --boot-path=/boot install bootctl --esp-path=/efi --boot-path=/boot install
cat <<-LOADER_CFG > ${btldr_esp_mount}/loader/loader.conf cat <<-LOADER_CFG > ${btldr_esp_mount}/loader/loader.conf
default arch.conf default arch.conf
@@ -4017,7 +4040,7 @@ SDBOOT_XBOOTLDR_INSTL
stage_fail stage_fail
fi fi
if [[ "${setrescue}" == "y" ]]; then if [[ "${setrescue}" == "y" ]]; then
if arch-chroot -S /mnt <<-RESCUE_ENTRY > "${void}" 2>&1 2> "${log}" ; then if arch-chroot -S /mnt <<-RESCUE_ENTRY > "${log}" 2>&1 ; then
cat <<-XBOOTLDR_RESCUE_CONF > /boot/loader/entries/rescue.conf cat <<-XBOOTLDR_RESCUE_CONF > /boot/loader/entries/rescue.conf
title Arch Rescue title Arch Rescue
linux /vmlinuz-${kernel} linux /vmlinuz-${kernel}
@@ -4033,7 +4056,7 @@ RESCUE_ENTRY
fi fi
elif [[ "${bootloader}" == "2" ]]; then elif [[ "${bootloader}" == "2" ]]; then
local stage_prompt="Grub Configuration" local stage_prompt="Grub Configuration"
if arch-chroot /mnt <<-GRUB_CONF > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-GRUB_CONF > "${log}" 2>&1 ; then
cp /etc/default/grub /etc/default/grub.bak cp /etc/default/grub /etc/default/grub.bak
cat <<-CFG > /etc/default/grub cat <<-CFG > /etc/default/grub
GRUB_DEFAULT=0 GRUB_DEFAULT=0
@@ -4057,7 +4080,7 @@ GRUB_CONF
fi fi
local stage_prompt="Grub Installation" local stage_prompt="Grub Installation"
if [[ "${sb_sign}" == "y" && "${path}" == "1" ]]; then if [[ "${sb_sign}" == "y" && "${path}" == "1" ]]; then
if arch-chroot /mnt <<-SB_GRUB_INSTL > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-SB_GRUB_INSTL > "${log}" 2>&1 ; then
grub-install --target=${uefimode} --efi-directory=${btldr_esp_mount} --bootloader-id=GRUB --modules="tpm" --disable-shim-lock --recheck grub-install --target=${uefimode} --efi-directory=${btldr_esp_mount} --bootloader-id=GRUB --modules="tpm" --disable-shim-lock --recheck
sed -i 's/SecureBoot/SecureB00t/' ${btldr_esp_mount}/EFI/GRUB/grubx${bitness}.efi sed -i 's/SecureBoot/SecureB00t/' ${btldr_esp_mount}/EFI/GRUB/grubx${bitness}.efi
grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig -o /boot/grub/grub.cfg
@@ -4067,7 +4090,7 @@ SB_GRUB_INSTL
stage_fail stage_fail
fi fi
elif [[ "${sb_sign}" == "y" && "${path}" == "2" ]]; then elif [[ "${sb_sign}" == "y" && "${path}" == "2" ]]; then
if arch-chroot /mnt <<-SB_GRUB_INSTL_RMV > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-SB_GRUB_INSTL_RMV > "${log}" 2>&1 ; then
grub-install --target=${uefimode} --efi-directory=${btldr_esp_mount} --bootloader-id=GRUB --removable --modules="tpm" --disable-shim-lock --recheck grub-install --target=${uefimode} --efi-directory=${btldr_esp_mount} --bootloader-id=GRUB --removable --modules="tpm" --disable-shim-lock --recheck
sed -i 's/SecureBoot/SecureB00t/' ${btldr_esp_mount}/EFI/BOOT/${efiname}.EFI sed -i 's/SecureBoot/SecureB00t/' ${btldr_esp_mount}/EFI/BOOT/${efiname}.EFI
grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig -o /boot/grub/grub.cfg
@@ -4077,7 +4100,7 @@ SB_GRUB_INSTL_RMV
stage_fail stage_fail
fi fi
elif [[ "${sb_sign}" == "n" && "${path}" == "1" ]]; then elif [[ "${sb_sign}" == "n" && "${path}" == "1" ]]; then
if arch-chroot /mnt <<-GRUB_INSTL > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-GRUB_INSTL > "${log}" 2>&1 ; then
grub-install --target=${uefimode} --efi-directory=${btldr_esp_mount} --bootloader-id=GRUB --recheck grub-install --target=${uefimode} --efi-directory=${btldr_esp_mount} --bootloader-id=GRUB --recheck
grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig -o /boot/grub/grub.cfg
GRUB_INSTL GRUB_INSTL
@@ -4086,7 +4109,7 @@ GRUB_INSTL
stage_fail stage_fail
fi fi
elif [[ "${sb_sign}" == "n" && "${path}" == "2" ]]; then elif [[ "${sb_sign}" == "n" && "${path}" == "2" ]]; then
if arch-chroot /mnt <<-GRUB_INSTL_RMV > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-GRUB_INSTL_RMV > "${log}" 2>&1 ; then
grub-install --target=${uefimode} --efi-directory=${btldr_esp_mount} --bootloader-id=GRUB --removable --recheck grub-install --target=${uefimode} --efi-directory=${btldr_esp_mount} --bootloader-id=GRUB --removable --recheck
grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig -o /boot/grub/grub.cfg
GRUB_INSTL_RMV GRUB_INSTL_RMV
@@ -4097,7 +4120,7 @@ GRUB_INSTL_RMV
fi fi
if [[ "${setrescue}" == "y" ]]; then if [[ "${setrescue}" == "y" ]]; then
local stage_prompt="Rescue Entry Creation" local stage_prompt="Rescue Entry Creation"
if arch-chroot /mnt <<-GRUB_RESCUE_ENTRY > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-GRUB_RESCUE_ENTRY > "${log}" 2>&1 ; then
touch /boot/grub/custom.cfg touch /boot/grub/custom.cfg
grep -E -A 11 "'Arch Linux'" /boot/grub/grub.cfg > /boot/grub/custom.cfg grep -E -A 11 "'Arch Linux'" /boot/grub/grub.cfg > /boot/grub/custom.cfg
sed -i 's/Arch Linux/Rescue Environment/' /boot/grub/custom.cfg sed -i 's/Arch Linux/Rescue Environment/' /boot/grub/custom.cfg
@@ -4110,7 +4133,7 @@ GRUB_RESCUE_ENTRY
fi fi
if [[ "${fs}" == "2" ]]; then if [[ "${fs}" == "2" ]]; then
local stage_prompt="Grub-Btrfsd Service Activation" local stage_prompt="Grub-Btrfsd Service Activation"
if arch-chroot /mnt <<-GRUB_BTRFSD > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-GRUB_BTRFSD > "${log}" 2>&1 ; then
systemctl enable grub-btrfsd systemctl enable grub-btrfsd
GRUB_BTRFSD GRUB_BTRFSD
stage_ok stage_ok
@@ -4120,7 +4143,7 @@ GRUB_BTRFSD
fi fi
if [[ "${nvidiaprop}" == "y" ]]; then if [[ "${nvidiaprop}" == "y" ]]; then
local stage_prompt="Grub/Nvidia Configuration" local stage_prompt="Grub/Nvidia Configuration"
if arch-chroot /mnt <<-NVIDIA_GRUB > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-NVIDIA_GRUB > "${log}" 2>&1 ; then
sed -i "/^#GRUB_TERMINAL_OUTPUT=console/s/^#//" /etc/default/grub sed -i "/^#GRUB_TERMINAL_OUTPUT=console/s/^#//" /etc/default/grub
grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig -o /boot/grub/grub.cfg
NVIDIA_GRUB NVIDIA_GRUB
@@ -4134,7 +4157,7 @@ NVIDIA_GRUB
trimcfg() { trimcfg() {
if [[ -n "${trim}" ]]; then if [[ -n "${trim}" ]]; then
local stage_prompt="Trim Service Activation" local stage_prompt="Trim Service Activation"
if arch-chroot /mnt <<-TRIM > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-TRIM > "${log}" 2>&1 ; then
systemctl enable ${trim} systemctl enable ${trim}
TRIM TRIM
stage_ok stage_ok
@@ -4146,7 +4169,7 @@ TRIM
vm_serv() { vm_serv() {
if [[ -n "${vm_services}" ]]; then if [[ -n "${vm_services}" ]]; then
local stage_prompt="VM Service(s) Activation" local stage_prompt="VM Service(s) Activation"
if arch-chroot /mnt <<-VM_SRVC > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-VM_SRVC > "${log}" 2>&1 ; then
systemctl enable ${vm_services} systemctl enable ${vm_services}
VM_SRVC VM_SRVC
stage_ok stage_ok
@@ -4159,7 +4182,7 @@ zramcfg() {
if [[ -n "${zram}" ]]; then if [[ -n "${zram}" ]]; then
local stage_prompt="Zram Swap Activation" local stage_prompt="Zram Swap Activation"
zram_service="systemd-zram-setup@zram0.service" zram_service="systemd-zram-setup@zram0.service"
if arch-chroot /mnt <<-ZRAM_CONF > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-ZRAM_CONF > "${log}" 2>&1 ; then
mkdir -p /etc/systemd/zram-generator.conf.d mkdir -p /etc/systemd/zram-generator.conf.d
cat <<-ZRAM_GEN > /etc/systemd/zram-generator.conf.d/zram.conf cat <<-ZRAM_GEN > /etc/systemd/zram-generator.conf.d/zram.conf
[zram0] [zram0]
@@ -4184,7 +4207,7 @@ ZRAM_CONF
nvidia_hook() { nvidia_hook() {
if [[ "${nvidiaprop}" == "y" && -n "${nvname}" ]]; then if [[ "${nvidiaprop}" == "y" && -n "${nvname}" ]]; then
local stage_prompt="Nvidia Hook Creation" local stage_prompt="Nvidia Hook Creation"
if arch-chroot /mnt <<-NVIDIA_HOOK > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-NVIDIA_HOOK > "${log}" 2>&1 ; then
mkdir -p /etc/pacman.d/hooks/ mkdir -p /etc/pacman.d/hooks/
cat <<-HOOK > /etc/pacman.d/hooks/nvidia.hook cat <<-HOOK > /etc/pacman.d/hooks/nvidia.hook
[Trigger] [Trigger]
@@ -4212,7 +4235,7 @@ NVIDIA_HOOK
var_opts() { var_opts() {
if [[ "${multilib}" == "y" ]]; then if [[ "${multilib}" == "y" ]]; then
local stage_prompt="Multilib Configuration" local stage_prompt="Multilib Configuration"
if arch-chroot /mnt <<-MULTILIB > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-MULTILIB > "${log}" 2>&1 ; then
sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
pacman -Syy pacman -Syy
MULTILIB MULTILIB
@@ -4223,7 +4246,7 @@ MULTILIB
fi fi
if [[ "${CPU}" == *"GenuineIntel"* && "${kill_watchdog}" == "y" ]]; then if [[ "${CPU}" == *"GenuineIntel"* && "${kill_watchdog}" == "y" ]]; then
local stage_prompt="Intel Watchdog Configuration" local stage_prompt="Intel Watchdog Configuration"
if arch-chroot /mnt <<-INTEL_WATCHDOG > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-INTEL_WATCHDOG > "${log}" 2>&1 ; then
echo "blacklist iTCO_wdt" | tee /etc/modprobe.d/blacklist.conf echo "blacklist iTCO_wdt" | tee /etc/modprobe.d/blacklist.conf
INTEL_WATCHDOG INTEL_WATCHDOG
stage_ok stage_ok
@@ -4232,7 +4255,7 @@ INTEL_WATCHDOG
fi fi
elif [[ "${CPU}" == *"AuthenticAMD"* && "${kill_watchdog}" == "y" ]]; then elif [[ "${CPU}" == *"AuthenticAMD"* && "${kill_watchdog}" == "y" ]]; then
local stage_prompt="AMD Watchdog Configuration" local stage_prompt="AMD Watchdog Configuration"
if arch-chroot /mnt <<-AMD_WATCHDOG > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-AMD_WATCHDOG > "${log}" 2>&1 ; then
echo "blacklist sp5100_tco" | tee /etc/modprobe.d/blacklist.conf echo "blacklist sp5100_tco" | tee /etc/modprobe.d/blacklist.conf
AMD_WATCHDOG AMD_WATCHDOG
stage_ok stage_ok
@@ -4242,7 +4265,7 @@ AMD_WATCHDOG
fi fi
if [[ "${oomd}" == "y" ]]; then if [[ "${oomd}" == "y" ]]; then
local stage_prompt="Systemd-oomd Service Activation" local stage_prompt="Systemd-oomd Service Activation"
if arch-chroot /mnt <<-OOMD > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-OOMD > "${log}" 2>&1 ; then
mkdir -p /etc/systemd/system.conf.d > "${void}" 2>&1 mkdir -p /etc/systemd/system.conf.d > "${void}" 2>&1
cat <<-OOMD_CONF > /etc/systemd/system.conf.d/00-oomd.conf cat <<-OOMD_CONF > /etc/systemd/system.conf.d/00-oomd.conf
[Manager] [Manager]
@@ -4257,7 +4280,7 @@ OOMD
fi fi
if [[ "${irqbalance}" == "y" ]]; then if [[ "${irqbalance}" == "y" ]]; then
local stage_prompt="Irqbalance Service Activation" local stage_prompt="Irqbalance Service Activation"
if arch-chroot /mnt <<-IRQBALANCE > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-IRQBALANCE > "${log}" 2>&1 ; then
pacman -S --noconfirm irqbalance pacman -S --noconfirm irqbalance
systemctl enable irqbalance systemctl enable irqbalance
IRQBALANCE IRQBALANCE
@@ -4268,7 +4291,7 @@ IRQBALANCE
fi fi
if [[ "${thermald}" == "y" ]]; then if [[ "${thermald}" == "y" ]]; then
local stage_prompt="Thermald Service Activation" local stage_prompt="Thermald Service Activation"
if arch-chroot /mnt <<-THERMALD > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-THERMALD > "${log}" 2>&1 ; then
pacman -S --noconfirm thermald pacman -S --noconfirm thermald
systemctl enable thermald systemctl enable thermald
THERMALD THERMALD
@@ -4279,7 +4302,7 @@ THERMALD
fi fi
if [[ "${rngd}" == "y" ]]; then if [[ "${rngd}" == "y" ]]; then
local stage_prompt="Rngd Service Activation" local stage_prompt="Rngd Service Activation"
if arch-chroot /mnt <<-RNGD > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-RNGD > "${log}" 2>&1 ; then
pacman -S --noconfirm rng-tools pacman -S --noconfirm rng-tools
systemctl enable rngd systemctl enable rngd
RNGD RNGD
@@ -4290,7 +4313,7 @@ RNGD
fi fi
if [[ "${rtkit}" == "y" ]]; then if [[ "${rtkit}" == "y" ]]; then
local stage_prompt="Rtkit Service Activation" local stage_prompt="Rtkit Service Activation"
if arch-chroot /mnt <<-RTKIT > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-RTKIT > "${log}" 2>&1 ; then
pacman -S --noconfirm realtime-privileges rtkit pacman -S --noconfirm realtime-privileges rtkit
systemctl enable rtkit-daemon systemctl enable rtkit-daemon
usermod -aG realtime ${USERNAME} usermod -aG realtime ${USERNAME}
@@ -4303,7 +4326,7 @@ RTKIT
if [[ "${tlp}" == "y" ]]; then if [[ "${tlp}" == "y" ]]; then
local stage_prompt="Power-profiles-daemon Removal" local stage_prompt="Power-profiles-daemon Removal"
if [[ -e usr/lib/power-profiles-daemon ]]; then if [[ -e usr/lib/power-profiles-daemon ]]; then
if arch-chroot /mnt <<-PPD > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-PPD > "${log}" 2>&1 ; then
pacman -Rns --noconfirm power-profiles-daemon pacman -Rns --noconfirm power-profiles-daemon
PPD PPD
stage_ok stage_ok
@@ -4312,7 +4335,7 @@ PPD
fi fi
fi fi
local stage_prompt="Tlp Service Activation" local stage_prompt="Tlp Service Activation"
if arch-chroot /mnt <<-TLP > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-TLP > "${log}" 2>&1 ; then
pacman -S --noconfirm tlp pacman -S --noconfirm tlp
systemctl enable tlp systemctl enable tlp
systemctl mask systemd-rfkill.service systemd-rfkill.socket systemctl mask systemd-rfkill.service systemd-rfkill.socket
@@ -4324,7 +4347,7 @@ TLP
fi fi
if [[ "${printer}" == "y" ]]; then if [[ "${printer}" == "y" ]]; then
local stage_prompt="Print & Scan Services Activation" local stage_prompt="Print & Scan Services Activation"
if arch-chroot /mnt <<-PRINT_CONF > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-PRINT_CONF > "${log}" 2>&1 ; then
systemctl enable avahi-daemon.socket cups.socket cups-browsed ipp-usb systemctl enable avahi-daemon.socket cups.socket cups-browsed ipp-usb
sed -i 's|^hosts.*|hosts: mymachines mdns_minimal resolve [!UNAVAIL=return] files myhostname dns|g' /etc/nsswitch.conf sed -i 's|^hosts.*|hosts: mymachines mdns_minimal resolve [!UNAVAIL=return] files myhostname dns|g' /etc/nsswitch.conf
sed -i 's/ interface = [^ ]*/ interface = all/g' /etc/ipp-usb/ipp-usb.conf sed -i 's/ interface = [^ ]*/ interface = all/g' /etc/ipp-usb/ipp-usb.conf
@@ -4340,7 +4363,7 @@ foreign() {
if [[ -z "${nvidia_aur}" ]]; then if [[ -z "${nvidia_aur}" ]]; then
if [[ "${dev}" != "y" ]]; then if [[ "${dev}" != "y" ]]; then
local stage_prompt="Base-devel Package Installation" local stage_prompt="Base-devel Package Installation"
if arch-chroot /mnt <<-BASE_DEVEL > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-BASE_DEVEL > "${log}" 2>&1 ; then
pacman -S --noconfirm base-devel pacman -S --noconfirm base-devel
BASE_DEVEL BASE_DEVEL
stage_ok stage_ok
@@ -4350,7 +4373,7 @@ BASE_DEVEL
fi fi
if [[ "${desktop}" =~ ^(11|12)$ ]]; then if [[ "${desktop}" =~ ^(11|12)$ ]]; then
local stage_prompt="Git Package Installation" local stage_prompt="Git Package Installation"
if arch-chroot /mnt <<-GIT > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-GIT > "${log}" 2>&1 ; then
pacman -S --noconfirm git pacman -S --noconfirm git
GIT GIT
stage_ok stage_ok
@@ -4360,7 +4383,7 @@ GIT
fi fi
fi fi
local stage_prompt="${web_name} Package Installation" local stage_prompt="${web_name} Package Installation"
if arch-chroot /mnt <<-AUR_WEB_PKGS > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-AUR_WEB_PKGS > "${log}" 2>&1 ; then
sed -i 's|if (( EUID == 0 )); then|if (( EUID != 0 )); then|g' /usr/bin/makepkg sed -i 's|if (( EUID == 0 )); then|if (( EUID != 0 )); then|g' /usr/bin/makepkg
git clone --branch ${web_aur} --single-branch https://github.com/archlinux/aur.git ${web_aur} && cd ${web_aur} && makepkg -s --noconfirm && sudo pacman -U --noconfirm *x86_64.pkg.tar.zst && cd .. && rm -rf ${web_aur} git clone --branch ${web_aur} --single-branch https://github.com/archlinux/aur.git ${web_aur} && cd ${web_aur} && makepkg -s --noconfirm && sudo pacman -U --noconfirm *x86_64.pkg.tar.zst && cd .. && rm -rf ${web_aur}
sed -i 's|if (( EUID != 0 )); then|if (( EUID == 0 )); then|g' /usr/bin/makepkg sed -i 's|if (( EUID != 0 )); then|if (( EUID == 0 )); then|g' /usr/bin/makepkg
@@ -4374,7 +4397,7 @@ AUR_WEB_PKGS
optimizations() { optimizations() {
if [[ "${sys_optm}" == "y" ]]; then if [[ "${sys_optm}" == "y" ]]; then
local stage_prompt="General System Optimizations" local stage_prompt="General System Optimizations"
if arch-chroot /mnt <<-SYS_OPTM > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-SYS_OPTM > "${log}" 2>&1 ; then
pacman -S --noconfirm ccache ntfs-3g pbzip2 pigz pacman -S --noconfirm ccache ntfs-3g pbzip2 pigz
sed -i 's/^#Color/Color\nILoveCandy/' /etc/pacman.conf sed -i 's/^#Color/Color\nILoveCandy/' /etc/pacman.conf
update-pciids update-pciids
@@ -4480,7 +4503,7 @@ SYS_OPTM
fi fi
if [[ -d /mnt/etc/udisks2 ]]; then if [[ -d /mnt/etc/udisks2 ]]; then
local stage_prompt="Udisks2 Mount Options" local stage_prompt="Udisks2 Mount Options"
if arch-chroot /mnt <<-UDISKS2 > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-UDISKS2 > "${log}" 2>&1 ; then
cat <<-UDISKS_CONF > /etc/udisks2/mount_options.conf cat <<-UDISKS_CONF > /etc/udisks2/mount_options.conf
[defaults] [defaults]
ntfs_drivers=ntfs3,ntfs ntfs_drivers=ntfs3,ntfs
@@ -4496,7 +4519,7 @@ UDISKS2
fi fi
if [[ -n "${REGDOM}" ]]; then if [[ -n "${REGDOM}" ]]; then
local stage_prompt="Wpa_Supplicant Configuration" local stage_prompt="Wpa_Supplicant Configuration"
if arch-chroot /mnt <<-WPA > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-WPA > "${log}" 2>&1 ; then
cat <<-SUPPLICANT > /etc/wpa_supplicant/wpa_supplicant.conf cat <<-SUPPLICANT > /etc/wpa_supplicant/wpa_supplicant.conf
country=${REGDOM} country=${REGDOM}
wps_cred_add_sae=1 wps_cred_add_sae=1
@@ -4517,9 +4540,8 @@ view_optm() {
} }
secboot_sign() { secboot_sign() {
if [[ "${sb_sign}" == "y" ]]; then if [[ "${sb_sign}" == "y" ]]; then
local stage_prompt="Secure-Boot Signing" local stage_prompt="Secure Boot Signing"
if arch-chroot /mnt <<-SECSIGN_MAIN > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-SECSIGN_MAIN > "${log}" 2>&1 ; then
pacman -S --noconfirm sbctl
sbctl create-keys sbctl create-keys
sbctl enroll-keys -m sbctl enroll-keys -m
sbctl sign -s /boot/vmlinuz-${kernel} sbctl sign -s /boot/vmlinuz-${kernel}
@@ -4529,7 +4551,7 @@ SECSIGN_MAIN
stage_fail stage_fail
fi fi
if [[ "${bootloader}" == "1" && "${uki}" == "y" ]]; then if [[ "${bootloader}" == "1" && "${uki}" == "y" ]]; then
if arch-chroot /mnt <<-SDBOOT_SECSIGN > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-SDBOOT_SECSIGN > "${log}" 2>&1 ; then
sbctl sign -s ${btldr_esp_mount}/EFI/BOOT/${efiname}.EFI sbctl sign -s ${btldr_esp_mount}/EFI/BOOT/${efiname}.EFI
sbctl sign -s ${btldr_esp_mount}/EFI/Linux/arch-${kernel}.efi sbctl sign -s ${btldr_esp_mount}/EFI/Linux/arch-${kernel}.efi
sbctl sign -s ${btldr_esp_mount}/EFI/systemd/systemd-bootx${bitness}.efi sbctl sign -s ${btldr_esp_mount}/EFI/systemd/systemd-bootx${bitness}.efi
@@ -4540,8 +4562,8 @@ SDBOOT_SECSIGN
stage_fail stage_fail
fi fi
if [[ "${setrescue}" == "y" ]]; then if [[ "${setrescue}" == "y" ]]; then
local stage_prompt="Rescue Entry Secure-Boot Signing" local stage_prompt="Rescue Entry Secure Boot Signing"
if arch-chroot /mnt <<-SDBOOT_RESCUE_SECSIGN > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-SDBOOT_RESCUE_SECSIGN > "${log}" 2>&1 ; then
sbctl sign -s ${btldr_esp_mount}/EFI/Linux/rescue.efi sbctl sign -s ${btldr_esp_mount}/EFI/Linux/rescue.efi
SDBOOT_RESCUE_SECSIGN SDBOOT_RESCUE_SECSIGN
stage_ok stage_ok
@@ -4550,7 +4572,7 @@ SDBOOT_RESCUE_SECSIGN
fi fi
fi fi
elif [[ "${bootloader}" == "1" && "${uki}" == "n" ]]; then elif [[ "${bootloader}" == "1" && "${uki}" == "n" ]]; then
if arch-chroot /mnt <<-SD_XBOOTLDR_SECSIGN > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-SD_XBOOTLDR_SECSIGN > "${log}" 2>&1 ; then
sbctl sign -s ${btldr_esp_mount}/EFI/BOOT/${efiname}.EFI sbctl sign -s ${btldr_esp_mount}/EFI/BOOT/${efiname}.EFI
sbctl sign -s ${btldr_esp_mount}/EFI/systemd/systemd-bootx${bitness}.efi sbctl sign -s ${btldr_esp_mount}/EFI/systemd/systemd-bootx${bitness}.efi
sbctl sign -s -o /usr/lib/systemd/boot/efi/systemd-bootx${bitness}.efi.signed /usr/lib/systemd/boot/efi/systemd-bootx${bitness}.efi sbctl sign -s -o /usr/lib/systemd/boot/efi/systemd-bootx${bitness}.efi.signed /usr/lib/systemd/boot/efi/systemd-bootx${bitness}.efi
@@ -4561,7 +4583,7 @@ SD_XBOOTLDR_SECSIGN
fi fi
elif [[ "${bootloader}" == "2" ]]; then elif [[ "${bootloader}" == "2" ]]; then
if [[ "${path}" == "1" ]]; then if [[ "${path}" == "1" ]]; then
if arch-chroot /mnt <<-GRUB_SECSIGN > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-GRUB_SECSIGN > "${log}" 2>&1 ; then
sbctl sign -s ${btldr_esp_mount}/EFI/GRUB/grubx${bitness}.efi sbctl sign -s ${btldr_esp_mount}/EFI/GRUB/grubx${bitness}.efi
GRUB_SECSIGN GRUB_SECSIGN
stage_ok stage_ok
@@ -4569,7 +4591,7 @@ GRUB_SECSIGN
stage_fail stage_fail
fi fi
elif [[ "${path}" == "2" ]]; then elif [[ "${path}" == "2" ]]; then
if arch-chroot /mnt <<-GRUB_FALLBACK_SECSIGN > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-GRUB_FALLBACK_SECSIGN > "${log}" 2>&1 ; then
sbctl sign -s ${btldr_esp_mount}/EFI/BOOT/${efiname}.EFI sbctl sign -s ${btldr_esp_mount}/EFI/BOOT/${efiname}.EFI
GRUB_FALLBACK_SECSIGN GRUB_FALLBACK_SECSIGN
stage_ok stage_ok
@@ -4580,6 +4602,32 @@ GRUB_FALLBACK_SECSIGN
fi fi
fi fi
} }
uki_hook() {
local stage_prompt="UKI Automation"
if [[ "${uki_use}" == "y" ]]; then
if arch-chroot /mnt <<-'UKIHOOK' > "${log}" 2>&1 ; then
mkdir -p /etc/pacman.d/hooks
cat > "/etc/pacman.d/hooks/uki.hook" <<'UKI_HOOK'
[Trigger]
Type = Package
Operation = Install
Target = linux
Target = linux-lts
Target = linux-hardened
Target = linux-zen
[Action]
Description = Creating UKIs...
When = PostTransaction
Exec = /usr/bin/bash -c 'for p in /etc/mkinitcpio.d/*.preset; do k=$(basename "$p" .preset); case "$k" in linux|linux-lts|linux-hardened|linux-zen) sed -i -e "s|^#ALL_config=.*|ALL_config=\"/etc/mkinitcpio.conf.d/mkinitcpiod.conf\"|" -e "s|^default_image=|#default_image=|" -e "s|^#default_uki=.*|default_uki=\"/efi/EFI/Linux/arch-${k}.efi\"|" -e "s|^#default_options=.*|default_options=\"--cmdline /etc/cmdline.d/cmdlined.conf\"|" "$p";; esac; done; /usr/bin/mkinitcpio -P'
UKI_HOOK
UKIHOOK
stage_ok
else
stage_fail
fi
fi
}
set_vars() { set_vars() {
if [[ "${multibooting}" == "y" && "${xbootloader}" == "yes" ]]; then if [[ "${multibooting}" == "y" && "${xbootloader}" == "yes" ]]; then
uki="n" uki="n"
@@ -4671,7 +4719,7 @@ chroot_conf() {
if [[ -f /mnt/etc/lightdm/lightdm.conf ]]; then if [[ -f /mnt/etc/lightdm/lightdm.conf ]]; then
if [[ "${desktop}" =~ ^(5|8|10)$ ]]; then if [[ "${desktop}" =~ ^(5|8|10)$ ]]; then
local stage_prompt="GTK Greeter Configuration" local stage_prompt="GTK Greeter Configuration"
if arch-chroot /mnt <<-GTK > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-GTK > "${log}" 2>&1 ; then
sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-gtk-greeter|g' /etc/lightdm/lightdm.conf sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-gtk-greeter|g' /etc/lightdm/lightdm.conf
GTK GTK
stage_ok stage_ok
@@ -4680,7 +4728,7 @@ GTK
fi fi
elif [[ "${desktop}" == "6" ]]; then elif [[ "${desktop}" == "6" ]]; then
local stage_prompt="Slick Greeter Configuration" local stage_prompt="Slick Greeter Configuration"
if arch-chroot /mnt <<-SLICK > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-SLICK > "${log}" 2>&1 ; then
sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-slick-greeter|g' /etc/lightdm/lightdm.conf sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-slick-greeter|g' /etc/lightdm/lightdm.conf
SLICK SLICK
stage_ok stage_ok
@@ -4689,7 +4737,7 @@ SLICK
fi fi
elif [[ "${desktop}" == "7" ]]; then elif [[ "${desktop}" == "7" ]]; then
local stage_prompt="Deepin Greeter Configuration" local stage_prompt="Deepin Greeter Configuration"
if arch-chroot /mnt <<-DEEPIN > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-DEEPIN > "${log}" 2>&1 ; then
sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-deepin-greeter|g' /etc/lightdm/lightdm.conf sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-deepin-greeter|g' /etc/lightdm/lightdm.conf
DEEPIN DEEPIN
stage_ok stage_ok
@@ -4698,7 +4746,7 @@ DEEPIN
fi fi
elif [[ "${desktop}" == "14" ]]; then elif [[ "${desktop}" == "14" ]]; then
local stage_prompt="Pantheon Greeter Configuration" local stage_prompt="Pantheon Greeter Configuration"
if arch-chroot /mnt <<-PANTHEON > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-PANTHEON > "${log}" 2>&1 ; then
sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=io.elementary.greeter|g' /etc/lightdm/lightdm.conf sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=io.elementary.greeter|g' /etc/lightdm/lightdm.conf
PANTHEON PANTHEON
stage_ok stage_ok
@@ -4709,7 +4757,7 @@ PANTHEON
fi fi
if [[ "${vendor}" != "Virtual Machine" && "${desktop}" != "11" ]]; then if [[ "${vendor}" != "Virtual Machine" && "${desktop}" != "11" ]]; then
local stage_prompt="Bluetooth Service Activation" local stage_prompt="Bluetooth Service Activation"
if arch-chroot /mnt <<-BLUETOOTH > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-BLUETOOTH > "${log}" 2>&1 ; then
systemctl enable bluetooth systemctl enable bluetooth
BLUETOOTH BLUETOOTH
stage_ok stage_ok
@@ -4719,7 +4767,7 @@ BLUETOOTH
fi fi
if [[ -n "${displaymanager}" ]]; then if [[ -n "${displaymanager}" ]]; then
local stage_prompt="Display Manager Service Activation" local stage_prompt="Display Manager Service Activation"
if arch-chroot /mnt <<-DM > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-DM > "${log}" 2>&1 ; then
systemctl enable ${displaymanager} systemctl enable ${displaymanager}
DM DM
stage_ok stage_ok
@@ -4729,7 +4777,7 @@ DM
fi fi
if [[ "${desktop}" != "12" ]]; then if [[ "${desktop}" != "12" ]]; then
local stage_prompt="Network Manager Service Activation" local stage_prompt="Network Manager Service Activation"
if arch-chroot /mnt <<-NETWORK > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-NETWORK > "${log}" 2>&1 ; then
systemctl enable NetworkManager systemctl enable NetworkManager
NETWORK NETWORK
stage_ok stage_ok
@@ -4744,7 +4792,7 @@ NETWORK
main_chroot main_chroot
if [[ -n "${customservices}" ]]; then if [[ -n "${customservices}" ]]; then
local stage_prompt="Custom Service(s) Activation" local stage_prompt="Custom Service(s) Activation"
if arch-chroot /mnt <<-CUSTOM_SRVC > "${void}" 2>&1 2> "${log}" ; then if arch-chroot /mnt <<-CUSTOM_SRVC > "${log}" 2>&1 ; then
systemctl enable ${customservices} systemctl enable ${customservices}
CUSTOM_SRVC CUSTOM_SRVC
stage_ok stage_ok
@@ -4763,6 +4811,7 @@ CUSTOM_SRVC
foreign foreign
optimizations optimizations
secboot_sign secboot_sign
uki_hook
completion completion
installation="ok" installation="ok"
umount -R /mnt umount -R /mnt
@@ -4793,7 +4842,7 @@ CUSTOM_SRVC
tty="$(tty)" tty="$(tty)"
trg="" trg=""
disks="$(lsblk --nodeps --paths --noheadings --output=name,size,model | cat --number)" disks="$(lsblk --nodeps --paths --noheadings --output=name,size,model | cat --number)"
vars=(LOCALESET="" SETLOCALE="" lcl_slct="" USERNAME="" kernelnmbr="" fs="" gfxcount="" gfxcard="" intelcount="" intelcards="" nvidiacount="" nvidiacards="" amdcount="" amdcards="" vendor="" vendors="" desktop="" terminal="" efi_entr_del="" sanity="" install="" bootldr_pkgs="" devel="" REGDOM="" gfx_bootopts="" btrfs_bootopts="" trim="" swapmode="" greeter="" cust_bootopts="" vmpkgs="" vm_services="" perf_stream="" displaymanager="" wireless_reg="" bitness="" bootloader="" gfx_slct="" espsize="" autoroot="" autoesp="" autoxboot="" autohome="" autoswap="" rootprt="" espprt="" xbootprt="" homeprt="" swapprt="" partok="" instl_drive="" sgdsk_nmbr="" part_mode="" preset="" capacity="" cap_gib="" rootsize="" sgdrive="" cgdrive="" smartpart="" presetpart="" prcnt="" roottype="" stage_prompt="" zram="" xbootloader="" multibooting="" hypervisor="" mkinitcpio_mods="" mkinitcpio_bins="" uki="" ukify="" cng_espmnt="" sep_home="" encr_swap_bootopts="" encr_home_bootopts="" uefimode="" luks_encrypt="" nrg_plc="" multilib="" nvname="" nogsp="" luks_root="" luks_swap="" luks_home="" installation="" kill_watchdog="" oomd="" setrescue="" lowlat="" dev="" web="" web_pkg="" web_aur="" web_slct="" printer="" print_pkgs="" shellnmbr="" shell="" shellname="" shellname2="" shell_pkgs="" sys_optm="" set_ext_opt="" ask_param="" desk_setup="" irqbalance="" thermald="" rngd="" rtkit="" tlp="" CRYPTPASS="" CRYPTPASS2="" show_extopts="" gptslct="" gptok="" gptabort="" nvidiaprop="" nowarning="" efiname="" path="" hometype="" homeform="" LuksParts="" nvidia_aur="" web_aur_url="" session="" alt_session="" session_support="" alt_session_pack="" revision="") vars=(LOCALESET="" SETLOCALE="" lcl_slct="" USERNAME="" kernelnmbr="" fs="" gfxcount="" gfxcard="" intelcount="" intelcards="" nvidiacount="" nvidiacards="" amdcount="" amdcards="" vendor="" vendors="" desktop="" terminal="" efi_entr_del="" sanity="" install="" bootldr_pkgs="" devel="" REGDOM="" gfx_bootopts="" btrfs_bootopts="" trim="" swapmode="" greeter="" cust_bootopts="" vmpkgs="" vm_services="" perf_stream="" displaymanager="" wireless_reg="" bitness="" bootloader="" gfx_slct="" espsize="" autoroot="" autoesp="" autoxboot="" autohome="" autoswap="" rootprt="" espprt="" xbootprt="" homeprt="" swapprt="" partok="" instl_drive="" sgdsk_nmbr="" part_mode="" preset="" capacity="" cap_gib="" rootsize="" sgdrive="" cgdrive="" smartpart="" presetpart="" prcnt="" roottype="" stage_prompt="" zram="" xbootloader="" multibooting="" hypervisor="" mkinitcpio_mods="" mkinitcpio_bins="" uki="" ukify="" cng_espmnt="" sep_home="" encr_swap_bootopts="" encr_home_bootopts="" uefimode="" luks_encrypt="" nrg_plc="" multilib="" nvname="" nogsp="" luks_root="" luks_swap="" luks_home="" installation="" kill_watchdog="" oomd="" setrescue="" lowlat="" dev="" web="" web_pkg="" web_aur="" web_slct="" printer="" print_pkgs="" shellnmbr="" shell="" shellname="" shellname2="" shell_pkgs="" sys_optm="" set_ext_opt="" ask_param="" desk_setup="" irqbalance="" thermald="" rngd="" rtkit="" tlp="" CRYPTPASS="" CRYPTPASS2="" show_extopts="" gptslct="" gptok="" gptabort="" nvidiaprop="" nowarning="" efiname="" path="" hometype="" homeform="" LuksParts="" nvidia_aur="" web_aur_url="" session="" alt_session="" session_support="" alt_session_pack="" revision="" uki_use="" p="" k="")
export "${vars[@]}" export "${vars[@]}"
validpkgs=() validpkgs=()
clear clear