Add: Now, a mandatory reboot will take place automatically after a successful LUKS encrypted installation, to prevent re-running the installer in an environment where the kernel has not been/cannot be informed about the recent changes.

Change: A few warning prompts have been edited/added for enhanced clarity.
Add: Now, an 'error_log.txt' file will be created if an error occurs that forces the installation to abort.
This file will be placed at the same directory that 'Amelia.sh' resides, to be used for troubleshooting.
This commit is contained in:
Jane Doe 2024-12-28 00:37:19 +00:00
parent f60955831c
commit 8e6c6402cd

136
Amelia.sh
View file

@ -2,7 +2,7 @@
# Amelia Installer # Amelia Installer
# https://gitlab.com/prism7/archery # https://gitlab.com/prism7/archery
# Version: 8.2.0 # Version: 8.2.1
set -euo pipefail set -euo pipefail
################################################################################################### ###################################################################################################
@ -130,6 +130,20 @@ err_abort() {
------------------------" ------------------------"
failure failure
} }
reboot() {
if [[ "${luks_encrypt}" == "ok" ]]; then
sleep 0.2
RED "
-------------------------------------------------------------------
### ${yellow}The system will now ${nc}reboot ${yellow}for all changes to take effect ${red}###
-------------------------------------------------------------------
"
sleep 5
systemctl reboot
fi
}
line2() { line2() {
printf '\n\n' printf '\n\n'
} }
@ -970,6 +984,9 @@ Enter a number: "
kernel="linux-lts" kernel="linux-lts"
kernelname="Linux LTS" ;; kernelname="Linux LTS" ;;
3) 3)
CYAN "
(*) ${nc}System Hibernation is ${yellowl}NOT SUPPORTED ${nc}by kernel
"
kernel="linux-hardened" kernel="linux-hardened"
kernelname="Linux Hardened" ;; kernelname="Linux Hardened" ;;
4) 4)
@ -993,12 +1010,6 @@ Enter a number: "
### The ${kernelname} kernel has been selected ### The ${kernelname} kernel has been selected
" "
if [[ "${kernelnmbr}" == "3" ]]; then
CYAN "
(*) ${nc}System Hibernation is ${yellowl}NOT SUPPORTED ${nc}by kernel
"
fi
ok ok
if [[ "${vga_slct}" == "yes" ]]; then if [[ "${vga_slct}" == "yes" ]]; then
local stage_prompt="Graphics Setup" local stage_prompt="Graphics Setup"
@ -1333,6 +1344,9 @@ Enter a number: "
" "
until set_swapsize; do : ; done ;; until set_swapsize; do : ; done ;;
3) 3)
CYAN "
(*) ${nc}Hibernating to Swap on Zram is ${yellowl}NOT SUPPORTED
"
zram="zram-generator" zram="zram-generator"
YELLOW " YELLOW "
@ -2684,7 +2698,7 @@ Enter a Custom Percentage number ${nc}e.g. 30 ${bwhite}(empty to skip)${blue}: "
sleep 0.2 sleep 0.2
RED " RED "
----------------------------------------------------- -----------------------------------------------------
### ${yellow}WARNING: No space left for other partitions ${red}### ### ${yellowl}WARNING: ${nc}${yellow}No space left for other partitions ${red}###
-----------------------------------------------------" -----------------------------------------------------"
reload reload
return 1 return 1
@ -2986,7 +3000,7 @@ ${magenta}###${nc}--------------------------------------${magenta}[ ${bwhite}San
sleep 0.2 sleep 0.2
RED " RED "
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
### ${yellow}WARNING: Multiple Linux x86-64 /Root Partitions have been detected ${red}### ### ${yellowl}WARNING: ${nc}${yellow}Multiple Linux x86-64 /Root Partitions have been detected ${red}###
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
" "
sleep 0.2 sleep 0.2
@ -3038,7 +3052,7 @@ ${multi_root}
sleep 0.2 sleep 0.2
RED " RED "
-------------------------------------------------------------------- --------------------------------------------------------------------
### ${yellow}WARNING: Multiple EFI System Partitions have been detected ${red}### ### ${yellowl}WARNING: ${nc}${yellow}Multiple EFI System Partitions have been detected ${red}###
-------------------------------------------------------------------- --------------------------------------------------------------------
" "
sleep 0.2 sleep 0.2
@ -3095,7 +3109,7 @@ ${multi_esp}
sleep 0.2 sleep 0.2
RED " RED "
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
### ${yellow}WARNING: Multiple Linux Extended Boot Partitions have been detected ${red}### ### ${yellowl}WARNING: ${nc}${yellow}Multiple Linux Extended Boot Partitions have been detected ${red}###
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
" "
sleep 0.2 sleep 0.2
@ -3146,7 +3160,7 @@ ${multi_xboot}
sleep 0.2 sleep 0.2
RED " RED "
--------------------------------------------------------------------- ---------------------------------------------------------------------
### ${yellow}WARNING: Multiple Linux /Home Partitions have been detected ${red}### ### ${yellowl}WARNING: ${nc}${yellow}Multiple Linux /Home Partitions have been detected ${red}###
--------------------------------------------------------------------- ---------------------------------------------------------------------
" "
sleep 0.2 sleep 0.2
@ -3197,7 +3211,7 @@ ${multi_home}
sleep 0.2 sleep 0.2
RED " RED "
--------------------------------------------------------------------- ---------------------------------------------------------------------
### ${yellow}WARNING: Multiple Linux /Swap Partitions have been detected ${red}### ### ${yellowl}WARNING: ${nc}${yellow}Multiple Linux /Swap Partitions have been detected ${red}###
--------------------------------------------------------------------- ---------------------------------------------------------------------
" "
sleep 0.2 sleep 0.2
@ -3252,9 +3266,9 @@ ${multi_swap}
rootprt="ok" rootprt="ok"
sleep 0.2 sleep 0.2
RED " RED "
----------------------------------------------- -----------------------------------------------------
### ${yellow}WARNING: /Root's size is not adequate ${red}### ### ${yellowl}WARNING: ${nc}${yellow}/Root's size might not be adequate ${red}###
-----------------------------------------------" -----------------------------------------------------"
sleep 0.2 sleep 0.2
RED " RED "
------------------------------------------------------------------------ ------------------------------------------------------------------------
@ -3375,7 +3389,7 @@ ${multi_swap}
sleep 0.2 sleep 0.2
RED " RED "
--------------------------------------------- ---------------------------------------------
### ${yellow}WARNING: ESP's size is not adequate ${red}### ### ${yellowl}WARNING: ${nc}${yellow}ESP's size is not adequate ${red}###
---------------------------------------------" ---------------------------------------------"
sleep 0.2 sleep 0.2
RED " RED "
@ -3389,7 +3403,7 @@ ${multi_swap}
sleep 0.2 sleep 0.2
RED " RED "
--------------------------------------------- ---------------------------------------------
### ${yellow}WARNING: ESP's size is not adequate ${red}### ### ${yellowl}WARNING: ${nc}${yellow}ESP's size is not adequate ${red}###
---------------------------------------------" ---------------------------------------------"
fi fi
elif [[ "${bootloader}" == "2" ]]; then elif [[ "${bootloader}" == "2" ]]; then
@ -3399,7 +3413,7 @@ ${multi_swap}
sleep 0.2 sleep 0.2
RED " RED "
--------------------------------------------- ---------------------------------------------
### ${yellow}WARNING: ESP's size is not adequate ${red}### ### ${yellowl}WARNING: ${nc}${yellow}ESP's size is not adequate ${red}###
---------------------------------------------" ---------------------------------------------"
elif [[ "${espmnt}" == "1" ]]; then elif [[ "${espmnt}" == "1" ]]; then
espprt="ok" espprt="ok"
@ -3661,6 +3675,7 @@ ${magenta}###${nc}------------------------------------${magenta}[ ${bwhite}Encry
if [[ "${encrypt}" == "no" ]]; then if [[ "${encrypt}" == "no" ]]; then
skip skip
ok ok
line2
return 0 return 0
elif [[ "${encrypt}" == "yes" ]]; then elif [[ "${encrypt}" == "yes" ]]; then
if [[ "${bootloader}" == "2" && "${espmnt}" == "1" ]]; then if [[ "${bootloader}" == "2" && "${espmnt}" == "1" ]]; then
@ -3929,7 +3944,6 @@ ${magenta}###${nc}----------------------------------${magenta}[ ${bwhite}Swap P
set_mode() { set_mode() {
if [[ "${rootcount}" -gt "1" || "${espcount}" -gt "1" || "${xbootcount}" -gt "1" || "${homecount}" -gt "1" || "${swapcount}" -gt "1" ]]; then if [[ "${rootcount}" -gt "1" || "${espcount}" -gt "1" || "${xbootcount}" -gt "1" || "${homecount}" -gt "1" || "${swapcount}" -gt "1" ]]; then
line2
until auto_mode; do : ; done until auto_mode; do : ; done
sleep 0.2 sleep 0.2
NC " NC "
@ -4264,7 +4278,7 @@ Enter a partition number ${bwhite}(empty to skip and proceed)${blue}: "
fi fi
RED " RED "
--------------------------------------------------- ---------------------------------------------------
### ${yellow}WARNING: PARTITION HAS NOT BEEN FORMATTED ${red}### ### ${yellowl}WARNING: ${nc}${yellow}PARTITION HAS NOT BEEN FORMATTED ${red}###
---------------------------------------------------" ---------------------------------------------------"
sleep 2 sleep 2
skip skip
@ -4317,7 +4331,7 @@ Enter a partition number ${bwhite}(empty to skip and proceed)${blue}: "
fi fi
RED " RED "
--------------------------------------------------- ---------------------------------------------------
### ${yellow}WARNING: PARTITION HAS NOT BEEN FORMATTED ${red}### ### ${yellowl}WARNING: ${nc}${yellow}PARTITION HAS NOT BEEN FORMATTED ${red}###
---------------------------------------------------" ---------------------------------------------------"
sleep 2 sleep 2
skip skip
@ -4435,7 +4449,7 @@ Enter a name ${bwhite}(empty to skip and proceed)${blue}: "
else else
RED " RED "
--------------------------------------------------- ---------------------------------------------------
### ${yellow}WARNING: PARTITION HAS NOT BEEN FORMATTED ${red}### ### ${yellowl}WARNING: ${nc}${yellow}PARTITION HAS NOT BEEN FORMATTED ${red}###
---------------------------------------------------" ---------------------------------------------------"
sleep 2 sleep 2
skip skip
@ -4566,7 +4580,7 @@ Enter a name ${bwhite}(empty to skip and proceed)${blue}: "
else else
RED " RED "
--------------------------------------------------- ---------------------------------------------------
### ${yellow}WARNING: PARTITION HAS NOT BEEN FORMATTED ${red}### ### ${yellowl}WARNING: ${nc}${yellow}PARTITION HAS NOT BEEN FORMATTED ${red}###
---------------------------------------------------" ---------------------------------------------------"
skip skip
return 0 return 0
@ -5118,6 +5132,7 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}LUKS
sleep 0.2 sleep 0.2
NC " NC "
==> [${green}Encryption OK${nc}]" ==> [${green}Encryption OK${nc}]"
luks_encrypt="ok"
sleep 0.2 sleep 0.2
NC " NC "
@ -5410,8 +5425,8 @@ swapfile() {
${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}Swapfile Setup${nc} ${magenta}]${nc}-------------------------------------${magenta}### ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}Swapfile Setup${nc} ${magenta}]${nc}-------------------------------------${magenta}###
" "
if arch-chroot /mnt <<-SWAPFILE > /dev/null 2>&1 ; then if arch-chroot /mnt <<-SWAPFILE > /dev/null 2>&1 2> error_log.txt ; then
mkswap -U clear --size ${swapsize}G --file /swapfile > /dev/null 2>&1 || exit mkswap -U clear --size ${swapsize}G --file /swapfile || exit
SWAPFILE SWAPFILE
cat >> /mnt/etc/fstab <<-FSTAB || err_abort cat >> /mnt/etc/fstab <<-FSTAB || err_abort
/swapfile none swap defaults 0 0 /swapfile none swap defaults 0 0
@ -5431,8 +5446,8 @@ swapfile_btrfs() {
${magenta}###${nc}----------------------------------${magenta}[ ${bwhite}Btrfs Swapfile Setup${nc} ${magenta}]${nc}----------------------------------${magenta}### ${magenta}###${nc}----------------------------------${magenta}[ ${bwhite}Btrfs Swapfile Setup${nc} ${magenta}]${nc}----------------------------------${magenta}###
" "
if arch-chroot /mnt <<-SWAPFILE > /dev/null 2>&1 ; then if arch-chroot /mnt <<-SWAPFILE > /dev/null 2>&1 2> error_log.txt ; then
btrfs filesystem mkswapfile --size ${swapsize}g --uuid clear /swap/swapfile > /dev/null 2>&1 || exit btrfs filesystem mkswapfile --size ${swapsize}g --uuid clear /swap/swapfile || exit
SWAPFILE SWAPFILE
cat >> /mnt/etc/fstab <<-FSTAB || err_abort cat >> /mnt/etc/fstab <<-FSTAB || err_abort
/swap/swapfile none swap defaults 0 0 /swap/swapfile none swap defaults 0 0
@ -5462,7 +5477,7 @@ ${magenta}###${nc}--------------------------${magenta}[ ${bwhite}Setting Up Wire
main_chroot() { main_chroot() {
stage_prompt="Base-System Configuration" stage_prompt="Base-System Configuration"
if arch-chroot /mnt <<-CONF > /dev/null 2>&1 ; then if arch-chroot /mnt <<-CONF > /dev/null 2>&1 2> error_log.txt ; then
sed -i "/^#${SETLOCALE}/s/^#//" /etc/locale.gen || exit sed -i "/^#${SETLOCALE}/s/^#//" /etc/locale.gen || exit
locale-gen || exit locale-gen || exit
echo LANG=${SETLOCALE} > /etc/locale.conf || exit echo LANG=${SETLOCALE} > /etc/locale.conf || exit
@ -5498,7 +5513,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 /mnt <<-BOOTCTL > /dev/null 2>&1 ; then if arch-chroot /mnt <<-BOOTCTL > /dev/null 2>&1 2> error_log.txt ; then
bootctl install || exit bootctl install || exit
systemctl enable systemd-boot-update || exit systemctl enable systemd-boot-update || exit
BOOTCTL BOOTCTL
@ -5507,7 +5522,7 @@ BOOTCTL
stage_fail stage_fail
fi fi
elif [[ "${xbootloader}" == "yes" ]]; then elif [[ "${xbootloader}" == "yes" ]]; then
if arch-chroot /mnt <<-XBOOTCTL > /dev/null 2>&1 ; then if arch-chroot /mnt <<-XBOOTCTL > /dev/null 2>&1 2> error_log.txt ; then
bootctl --esp-path=/efi --boot-path=/boot install || exit bootctl --esp-path=/efi --boot-path=/boot install || exit
systemctl enable systemd-boot-update || exit systemctl enable systemd-boot-update || exit
XBOOTCTL XBOOTCTL
@ -5518,8 +5533,8 @@ XBOOTCTL
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 > /dev/null 2>&1 ; then if arch-chroot /mnt <<-GRUB > /dev/null 2>&1 2> error_log.txt ; then
cp /etc/default/grub /etc/default/grub.bak cp /etc/default/grub /etc/default/grub.bak || exit
cat <<-CFG > /etc/default/grub || exit cat <<-CFG > /etc/default/grub || exit
GRUB_DEFAULT=0 GRUB_DEFAULT=0
GRUB_TIMEOUT=5 GRUB_TIMEOUT=5
@ -5543,7 +5558,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 2> error_log.txt ; then
grub-install --target=${uefimode} --efi-directory=${btldr_esp_mount} --bootloader-id=GRUB --modules="tpm" --disable-shim-lock --recheck || exit grub-install --target=${uefimode} --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
@ -5553,7 +5568,7 @@ SBGRUBINST
stage_fail stage_fail
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 2> error_log.txt ; then
grub-install --target=${uefimode} --efi-directory=${btldr_esp_mount} --bootloader-id=GRUB --recheck || exit grub-install --target=${uefimode} --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
@ -5565,7 +5580,7 @@ GRUBINST
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 > /dev/null 2>&1 ; then if arch-chroot /mnt <<-GRUB_BTRFSD > /dev/null 2>&1 2> error_log.txt ; then
systemctl enable grub-btrfsd || exit systemctl enable grub-btrfsd || exit
GRUB_BTRFSD GRUB_BTRFSD
stage_ok stage_ok
@ -5576,7 +5591,7 @@ GRUB_BTRFSD
if [[ "${vgaconf}" == "y" && "${vendor}" == "Nvidia" ]]; then if [[ "${vgaconf}" == "y" && "${vendor}" == "Nvidia" ]]; then
local stage_prompt="Grub/Nvidia Configuration" local stage_prompt="Grub/Nvidia Configuration"
if arch-chroot /mnt <<-NVGRUB > /dev/null 2>&1 ; then if arch-chroot /mnt <<-NVGRUB > /dev/null 2>&1 2> error_log.txt ; then
sed -i "/^#GRUB_TERMINAL_OUTPUT=console/s/^#//" /etc/default/grub || exit sed -i "/^#GRUB_TERMINAL_OUTPUT=console/s/^#//" /etc/default/grub || exit
grub-mkconfig -o /boot/grub/grub.cfg || exit grub-mkconfig -o /boot/grub/grub.cfg || exit
NVGRUB NVGRUB
@ -5592,7 +5607,7 @@ 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 > /dev/null 2>&1 ; then if arch-chroot /mnt <<-TRIM > /dev/null 2>&1 2> error_log.txt ; then
systemctl enable ${trim} || exit systemctl enable ${trim} || exit
TRIM TRIM
stage_ok stage_ok
@ -5606,7 +5621,7 @@ 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 > /dev/null 2>&1 ; then if arch-chroot /mnt <<-VM > /dev/null 2>&1 2> error_log.txt ; then
systemctl enable ${vm_services} || exit systemctl enable ${vm_services} || exit
VM VM
stage_ok stage_ok
@ -5621,8 +5636,8 @@ 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 <<-ZRAMCONF > /dev/null 2>&1 ; then if arch-chroot /mnt <<-ZRAMCONF > /dev/null 2>&1 2> error_log.txt ; then
mkdir -p /etc/systemd/zram-generator.conf.d mkdir -p /etc/systemd/zram-generator.conf.d || exit
cat <<-ZCONF > /etc/systemd/zram-generator.conf.d/zram.conf || exit cat <<-ZCONF > /etc/systemd/zram-generator.conf.d/zram.conf || exit
[zram0] [zram0]
zram-size = ram / 2 zram-size = ram / 2
@ -5649,7 +5664,7 @@ nvidia_hook() {
if [[ "${vgaconf}" == "y" && "${vendor}" == "Nvidia" ]]; then if [[ "${vgaconf}" == "y" && "${vendor}" == "Nvidia" ]]; then
if [[ "${nvname}" == "nvidia-open" ]] || [[ "${nvname}" == "nvidia" ]] || [[ "${nvname}" == "nvidia-lts" ]]; then if [[ "${nvname}" == "nvidia-open" ]] || [[ "${nvname}" == "nvidia" ]] || [[ "${nvname}" == "nvidia-lts" ]]; then
local stage_prompt="Nvidia Hook Creation" local stage_prompt="Nvidia Hook Creation"
if arch-chroot /mnt <<-NVIDIAHOOK > /dev/null 2>&1 ; then if arch-chroot /mnt <<-NVIDIAHOOK > /dev/null 2>&1 2> error_log.txt ; then
mkdir -p /etc/pacman.d/hooks/ || exit mkdir -p /etc/pacman.d/hooks/ || exit
cat <<-HOOK > /etc/pacman.d/hooks/nvidia.hook || exit cat <<-HOOK > /etc/pacman.d/hooks/nvidia.hook || exit
[Trigger] [Trigger]
@ -5684,10 +5699,10 @@ mkinitcpio_preset() {
if [[ ! -e "${esp_mount}"/EFI/Linux ]]; then if [[ ! -e "${esp_mount}"/EFI/Linux ]]; then
mkdir -p "${esp_mount}"/EFI/Linux || exit mkdir -p "${esp_mount}"/EFI/Linux || exit
fi fi
if arch-chroot /mnt <<-UKI > /dev/null 2>&1 ; then if arch-chroot /mnt <<-UKI > /dev/null 2>&1 2> error_log.txt ; then
mkdir /etc/cmdline.d || exit mkdir /etc/cmdline.d || exit
echo "rw ${boot_opts}" | tee /etc/cmdline.d/cmdlined.conf || exit echo "rw ${boot_opts}" | tee /etc/cmdline.d/cmdlined.conf || exit
cp /etc/mkinitcpio.d/${kernel}.preset /etc/mkinitcpio.d/${kernel}.preset.bak cp /etc/mkinitcpio.d/${kernel}.preset /etc/mkinitcpio.d/${kernel}.preset.bak || exit
cat <<-MKINITPRESET > /etc/mkinitcpio.d/${kernel}.preset || exit cat <<-MKINITPRESET > /etc/mkinitcpio.d/${kernel}.preset || exit
ALL_kver="/boot/vmlinuz-${kernel}" ALL_kver="/boot/vmlinuz-${kernel}"
PRESETS=('default') PRESETS=('default')
@ -5707,8 +5722,8 @@ UKI
rm /mnt/boot/initramfs-"${kernel}"-fallback.img || exit rm /mnt/boot/initramfs-"${kernel}"-fallback.img || exit
fi fi
elif [[ "${uki}" == "n" ]]; then elif [[ "${uki}" == "n" ]]; then
if arch-chroot /mnt <<-NOUKI > /dev/null 2>&1 ; then if arch-chroot /mnt <<-NOUKI > /dev/null 2>&1 2> error_log.txt ; 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 || exit
cat <<-MKINITPRESET > /etc/mkinitcpio.d/${kernel}.preset || exit cat <<-MKINITPRESET > /etc/mkinitcpio.d/${kernel}.preset || exit
ALL_kver="/boot/vmlinuz-${kernel}" ALL_kver="/boot/vmlinuz-${kernel}"
PRESETS=('default' 'fallback') PRESETS=('default' 'fallback')
@ -5731,7 +5746,7 @@ 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 [[ ${bootloader} == "1" ]]; then if [[ ${bootloader} == "1" ]]; then
if arch-chroot /mnt <<-SECSIGN > /dev/null 2>&1 ; then if arch-chroot /mnt <<-SECSIGN > /dev/null 2>&1 2> error_log.txt ; then
systemctl disable systemd-boot-update || exit systemctl disable systemd-boot-update || exit
pacman -S --noconfirm sbctl || exit pacman -S --noconfirm sbctl || exit
sbctl create-keys || exit sbctl create-keys || exit
@ -5747,7 +5762,7 @@ SECSIGN
stage_fail stage_fail
fi fi
elif [[ ${bootloader} == "2" ]]; then elif [[ ${bootloader} == "2" ]]; then
if arch-chroot /mnt <<-SECSIGN > /dev/null 2>&1 ; then if arch-chroot /mnt <<-SECSIGN > /dev/null 2>&1 2> error_log.txt ; then
pacman -S --noconfirm sbctl || exit pacman -S --noconfirm sbctl || exit
sbctl create-keys || exit sbctl create-keys || exit
sbctl enroll-keys -m || exit sbctl enroll-keys -m || exit
@ -5937,7 +5952,7 @@ ${magenta}###${nc}--------------------------------${magenta}[ ${bwhite}Chroot &
if [[ -f /mnt/etc/lightdm/lightdm.conf ]]; then if [[ -f /mnt/etc/lightdm/lightdm.conf ]]; then
if [[ "${packages}" == "7" ]]; then if [[ "${packages}" == "7" ]]; then
local stage_prompt="Deepin Greeter Configuration" local stage_prompt="Deepin Greeter Configuration"
if arch-chroot /mnt <<-DEEPIN > /dev/null 2>&1 ; then if arch-chroot /mnt <<-DEEPIN > /dev/null 2>&1 2> error_log.txt ; then
sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-deepin-greeter|g' /etc/lightdm/lightdm.conf || exit sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-deepin-greeter|g' /etc/lightdm/lightdm.conf || exit
DEEPIN DEEPIN
stage_ok stage_ok
@ -5946,7 +5961,7 @@ DEEPIN
fi fi
elif [[ "${packages}" == "5" || "${packages}" == "8" || "${packages}" == "10" ]]; then elif [[ "${packages}" == "5" || "${packages}" == "8" || "${packages}" == "10" ]]; then
local stage_prompt="GTK Greeter Configuration" local stage_prompt="GTK Greeter Configuration"
if arch-chroot /mnt <<-GTK > /dev/null 2>&1 ; then if arch-chroot /mnt <<-GTK > /dev/null 2>&1 2> error_log.txt ; then
sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-gtk-greeter|g' /etc/lightdm/lightdm.conf || exit sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-gtk-greeter|g' /etc/lightdm/lightdm.conf || exit
GTK GTK
stage_ok stage_ok
@ -5955,7 +5970,7 @@ GTK
fi fi
elif [[ "${packages}" == "6" ]]; then elif [[ "${packages}" == "6" ]]; then
local stage_prompt="Slick Greeter Configuration" local stage_prompt="Slick Greeter Configuration"
if arch-chroot /mnt <<-SLICK > /dev/null 2>&1 ; then if arch-chroot /mnt <<-SLICK > /dev/null 2>&1 2> error_log.txt ; then
sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-slick-greeter|g' /etc/lightdm/lightdm.conf || exit sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-slick-greeter|g' /etc/lightdm/lightdm.conf || exit
SLICK SLICK
stage_ok stage_ok
@ -5967,7 +5982,7 @@ SLICK
if [[ -n "${bluetooth}" ]]; then if [[ -n "${bluetooth}" ]]; then
local stage_prompt="Bluetooth Service Activation" local stage_prompt="Bluetooth Service Activation"
if arch-chroot /mnt <<-BLUETOOTH > /dev/null 2>&1 ; then if arch-chroot /mnt <<-BLUETOOTH > /dev/null 2>&1 2> error_log.txt ; then
systemctl enable ${bluetooth} || exit systemctl enable ${bluetooth} || exit
BLUETOOTH BLUETOOTH
stage_ok stage_ok
@ -5978,7 +5993,7 @@ BLUETOOTH
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 <<-DMSERVICE > /dev/null 2>&1 ; then if arch-chroot /mnt <<-DMSERVICE > /dev/null 2>&1 2> error_log.txt ; then
systemctl enable ${displaymanager} || exit systemctl enable ${displaymanager} || exit
DMSERVICE DMSERVICE
stage_ok stage_ok
@ -5989,7 +6004,7 @@ DMSERVICE
if [[ -n "${network}" ]]; then if [[ -n "${network}" ]]; then
local stage_prompt="Network Manager Service Activation" local stage_prompt="Network Manager Service Activation"
if arch-chroot /mnt <<-NETWORK > /dev/null 2>&1 ; then if arch-chroot /mnt <<-NETWORK > /dev/null 2>&1 2> error_log.txt ; then
systemctl enable ${network} || exit systemctl enable ${network} || exit
NETWORK NETWORK
stage_ok stage_ok
@ -6016,7 +6031,7 @@ NETWORK
if [[ -f /mnt/etc/lightdm/lightdm.conf ]]; then if [[ -f /mnt/etc/lightdm/lightdm.conf ]]; then
if [[ "${greeternmbr}" == "1" ]]; then if [[ "${greeternmbr}" == "1" ]]; then
local stage_prompt="GTK Greeter Configuration" local stage_prompt="GTK Greeter Configuration"
if arch-chroot /mnt <<-GTK > /dev/null 2>&1 ; then if arch-chroot /mnt <<-GTK > /dev/null 2>&1 2> error_log.txt ; then
sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-gtk-greeter|g' /etc/lightdm/lightdm.conf || exit sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-gtk-greeter|g' /etc/lightdm/lightdm.conf || exit
GTK GTK
stage_ok stage_ok
@ -6025,7 +6040,7 @@ GTK
fi fi
elif [[ "${greeternmbr}" == "2" ]]; then elif [[ "${greeternmbr}" == "2" ]]; then
local stage_prompt="Slick Greeter Configuration" local stage_prompt="Slick Greeter Configuration"
if arch-chroot /mnt <<-SLICK > /dev/null 2>&1 ; then if arch-chroot /mnt <<-SLICK > /dev/null 2>&1 2> error_log.txt ; then
sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-slick-greeter|g' /etc/lightdm/lightdm.conf || exit sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-slick-greeter|g' /etc/lightdm/lightdm.conf || exit
SLICK SLICK
stage_ok stage_ok
@ -6034,7 +6049,7 @@ SLICK
fi fi
elif [[ "${greeternmbr}" == "3" ]]; then elif [[ "${greeternmbr}" == "3" ]]; then
local stage_prompt="Deepin Greeter Configuration" local stage_prompt="Deepin Greeter Configuration"
if arch-chroot /mnt <<-DEEPIN > /dev/null 2>&1 ; then if arch-chroot /mnt <<-DEEPIN > /dev/null 2>&1 2> error_log.txt ; then
sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-deepin-greeter|g' /etc/lightdm/lightdm.conf || exit sed -i 's|^#greeter-session=example-gtk-gnome|greeter-session=lightdm-deepin-greeter|g' /etc/lightdm/lightdm.conf || exit
DEEPIN DEEPIN
stage_ok stage_ok
@ -6046,7 +6061,7 @@ DEEPIN
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 <<-CUSTOMSERV > /dev/null 2>&1 ; then if arch-chroot /mnt <<-CUSTOMSERV > /dev/null 2>&1 2> error_log.txt ; then
systemctl enable ${customservices} || exit systemctl enable ${customservices} || exit
CUSTOMSERV CUSTOMSERV
stage_ok stage_ok
@ -6082,7 +6097,7 @@ CUSTOMSERV
NRG NRG
fi fi
if arch-chroot /mnt <<-OPTIMIZED > /dev/null 2>&1 ; then if arch-chroot /mnt <<-OPTIMIZED > /dev/null 2>&1 2> error_log.txt ; then
sed -i "/^#${SETLOCALE}/s/^#//" /etc/locale.gen || exit sed -i "/^#${SETLOCALE}/s/^#//" /etc/locale.gen || exit
locale-gen || exit locale-gen || exit
echo LANG=${SETLOCALE} > /etc/locale.conf || exit echo LANG=${SETLOCALE} > /etc/locale.conf || exit
@ -6239,6 +6254,7 @@ OPTIMIZED
fi fi
umount -R /mnt umount -R /mnt
reboot
exit exit
} }
# END FUNCTIONS # END FUNCTIONS
@ -6248,7 +6264,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="" bitness="" 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="" uefimode="") 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="" bitness="" 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="" uefimode="" luks_encrypt="")
export "${vars[@]}" export "${vars[@]}"
clear clear
first_check first_check