Change: Re-connect stdin to terminal after 'pacstrap'

Change: Refrain from warning about Multi 'XBOOTLDR' partitions being detected, if an 'XBOOTLDR' is not currently needed in the installation
Change: Identation fixes, prompt editing & some comments removal
This commit is contained in:
Jane Doe
2026-03-31 17:54:06 +03:00
parent c5902e605d
commit a7d31a7a96
+69 -67
View File
@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Amelia installer for Archlinux # Amelia installer for Archlinux
# Version: 1.4.0 # Version: 1.4.1
# Source: https://gitlab.com/prism7/archery # Source: https://gitlab.com/prism7/archery
set -euo pipefail set -euo pipefail
@@ -190,64 +190,64 @@ nvidia() {
NC "\n\n\n * ${gfxcard}\n\n" NC "\n\n\n * ${gfxcard}\n\n"
} }
delete() { delete() {
sleep 0.2 sleep 0.2
printf "\n\n" printf "\n\n"
REDBG " ------------------------------------------------------------ " REDBG " ------------------------------------------------------------ "
REDBG " [!] WARNING: All data on selected disk will be destroyed [!] " REDBG " [!] WARNING: All data on selected disk will be destroyed [!] "
REDBG " ------------------------------------------------------------ " REDBG " ------------------------------------------------------------ "
} }
amelia() { amelia() {
sleep 0.2 sleep 0.2
CYANBG "************************************************************************************************* " CYANBG "************************************************************************************************* "
CYANBG " " CYANBG " "
CYANBG " ### Amelia Installer ### " CYANBG " ### Amelia Installer ### "
CYANBG " " CYANBG " "
CYANBG "************************************************************************************************* " CYANBG "************************************************************************************************* "
} }
banner() { banner() {
sleep 0.2 sleep 0.2
echo echo
BLUEBG "************************************************************************************************* " BLUEBG "************************************************************************************************* "
BLUEBG " " BLUEBG " "
BLUEBG " ### Archlinux Installation ### " BLUEBG " ### Archlinux Installation ### "
BLUEBG " " BLUEBG " "
BLUEBG "************************************************************************************************* " BLUEBG "************************************************************************************************* "
printf "\n\n" printf "\n\n"
} }
installing() { installing() {
sleep 0.2 sleep 0.2
printf "\n\n\n" printf "\n\n\n"
MAGENTABG "------------------------------------------------------------------------------------------------- " MAGENTABG "------------------------------------------------------------------------------------------------- "
MAGENTABG " ### Installing System ### " MAGENTABG " ### Installing System ### "
MAGENTABG "------------------------------------------------------------------------------------------------- " MAGENTABG "------------------------------------------------------------------------------------------------- "
printf "\n" printf "\n"
} }
cnfg() { cnfg() {
sleep 0.2 sleep 0.2
printf "\n\n\n" printf "\n\n\n"
MAGENTABG "------------------------------------------------------------------------------------------------- " MAGENTABG "------------------------------------------------------------------------------------------------- "
MAGENTABG " ### Configuring System ### " MAGENTABG " ### Configuring System ### "
MAGENTABG "------------------------------------------------------------------------------------------------- " MAGENTABG "------------------------------------------------------------------------------------------------- "
NC "\n\n\n ... Please Wait ...\n\n\n" NC "\n\n\n ... Please Wait ...\n\n\n"
} }
completion() { completion() {
sleep 0.2 sleep 0.2
printf "\n\n\n\n\n" printf "\n\n\n\n\n"
GREENBG "************************************************************************************************* " GREENBG "************************************************************************************************* "
GREENBG " " GREENBG " "
GREENBG " ### Installation Completed ### " GREENBG " ### Installation Completed ### "
GREENBG " " GREENBG " "
GREENBG "************************************************************************************************* " GREENBG "************************************************************************************************* "
printf "\n\n\n" printf "\n\n\n"
} }
failure() { failure() {
sleep 0.2 sleep 0.2
printf "\n\n\n" printf "\n\n\n"
REDBG "************************************************************************************************* " REDBG "************************************************************************************************* "
REDBG " " REDBG " "
REDBG " ### Installation Aborted ### " REDBG " ### Installation Aborted ### "
REDBG " " REDBG " "
REDBG "************************************************************************************************* " REDBG "************************************************************************************************* "
printf "\n\n\n" printf "\n\n\n"
umount -R /mnt > "${void}" 2>&1 umount -R /mnt > "${void}" 2>&1
if [[ "${luks_root}" == "ok" || "${luks_swap}" == "ok" || "${luks_home}" == "ok" ]] && [[ "${installation}" != "ok" ]]; then if [[ "${luks_root}" == "ok" || "${luks_swap}" == "ok" || "${luks_home}" == "ok" ]] && [[ "${installation}" != "ok" ]]; then
@@ -264,18 +264,17 @@ filesystem_overview() {
} }
disk_overview() { disk_overview() {
sleep 0.2 sleep 0.2
CYAN "\n###${nc}------------------------------------------------${cyan}[ ${bwhite}DISK OVERVIEW ${nc}${cyan}]${nc}------------------------------------------------${cyan}###\n\n" CYAN "\n\n\n###${nc}------------------------------------------------${cyan}[ ${bwhite}DISK OVERVIEW ${nc}${cyan}]${nc}------------------------------------------------${cyan}###\n\n"
fdisk -l "${instl_drive}" | grep -E --color=no 'Dev|dev' |GREP_COLORS='mt=01;36' grep -E --color=always 'EFI System|$'|GREP_COLORS='mt=01;32' grep -E --color=always 'Linux root|$'|GREP_COLORS='mt=01;35' grep -E --color=always 'Linux home|$'|GREP_COLORS='mt=01;33' grep -E --color=always 'Linux swap|$'|GREP_COLORS='mt=01;31' grep -E --color=always 'Linux extended boot|$' fdisk -l "${instl_drive}" | grep -E --color=no 'Dev|dev' |GREP_COLORS='mt=01;36' grep -E --color=always 'EFI System|$'|GREP_COLORS='mt=01;32' grep -E --color=always 'Linux root|$'|GREP_COLORS='mt=01;35' grep -E --color=always 'Linux home|$'|GREP_COLORS='mt=01;33' grep -E --color=always 'Linux swap|$'|GREP_COLORS='mt=01;31' grep -E --color=always 'Linux extended boot|$'
CYAN "\n\n###${nc}-----------------------------------------------------------------------------------------------------------------${cyan}###" CYAN "\n\n###${nc}-----------------------------------------------------------------------------------------------------------------${cyan}###"
} }
multi_info() { multi_info() {
sleep 0.2 sleep 0.2
CYAN "\n >> ${nc}Multiple ${color}${type} ${nc}Partitions have been detected\n\n" CYAN "\n >> ${nc}Multiple ${color}${type} ${nc}Partitions have been detected"
disk_overview disk_overview
NC "\n ${color}${type} Partitions:${nc}\n\n ${dashline}\n${multi_type}\n ${dashline}\n" NC "\n ${color}${type} Partitions:${nc}\n\n ${dashline}\n${multi_type}\n ${dashline}\n"
YELLOW "\n ### Only the ${nc}1st ${type} ${yellow}partition on a selected disk can be ${nc}auto-assigned ${yellow}as a valid partition${cyan}\n\n\n >> ${nc}Partition ${yellowl}${type_comply} ${nc}is auto-assigned as such and will be ${action}\n" YELLOW "\n ### Only the ${nc}1st ${type} ${yellow}partition on a selected disk can be ${nc}auto-assigned ${yellow}as a valid partition${cyan}\n\n\n >> ${nc}Partition ${yellowl}${type_comply} ${nc}is auto-assigned as such and will be ${action}\n"
} }
# END TUI FUNCTIONS
# SYSTEM FUNCTIONS # SYSTEM FUNCTIONS
mode_check() { mode_check() {
if [[ "${run_as}" == "root" ]]; then if [[ "${run_as}" == "root" ]]; then
@@ -1679,7 +1678,7 @@ systemd_oomd() {
invalid invalid
return 1 return 1
fi fi
ok ok
} }
irqbalance() { irqbalance() {
local prompt="Irqbalance Setup" local prompt="Irqbalance Setup"
@@ -1699,7 +1698,7 @@ irqbalance() {
invalid invalid
return 1 return 1
fi fi
ok ok
} }
thermald() { thermald() {
local prompt="Thermald Setup" local prompt="Thermald Setup"
@@ -1719,7 +1718,7 @@ thermald() {
invalid invalid
return 1 return 1
fi fi
ok ok
} }
rngd() { rngd() {
local prompt="Rng-tools Setup" local prompt="Rng-tools Setup"
@@ -1739,7 +1738,7 @@ rngd() {
invalid invalid
return 1 return 1
fi fi
ok ok
} }
rtkit() { rtkit() {
local prompt="Rtkit Setup" local prompt="Rtkit Setup"
@@ -1760,7 +1759,7 @@ rtkit() {
invalid invalid
return 1 return 1
fi fi
ok ok
} }
tlp() { tlp() {
local prompt="Tlp Setup" local prompt="Tlp Setup"
@@ -1780,7 +1779,7 @@ tlp() {
invalid invalid
return 1 return 1
fi fi
ok ok
} }
dsks_submn() { dsks_submn() {
title "Disk Management" title "Disk Management"
@@ -2338,27 +2337,32 @@ sanity_check() {
fi fi
# ATTENTION: MULTI-XBOOTLDR # ATTENTION: MULTI-XBOOTLDR
if [[ "${xbootcount}" -gt "1" ]]; then if [[ "${xbootcount}" -gt "1" ]]; then
local color="${redl}" espsize="$(lsblk -dno SIZE --bytes "${esp_dev}")"
local type="Linux Extended Boot" if [[ -e "${esp_dev}" && "${espsize}" -lt "209715200" ]]; then
local multi_type="${multi_xboot}" if [[ "${bootloader}" == "1" && "${multibooting}" == "y" ]]; then
local type_comply="${xboot_comply}" local color="${redl}"
local length="${#xboot_dev}" local type="Linux Extended Boot"
dashes="$(printf '%*s' "$length" '' | tr ' ' '-')" local multi_type="${multi_xboot}"
local dashline="${nc}${dashes}" local type_comply="${xboot_comply}"
action="${red}[!] ${bwhite}FORMATTED ${nc}${red}[!]" local length="${#xboot_dev}"
multi_info dashes="$(printf '%*s' "$length" '' | tr ' ' '-')"
get "Proceed ? [Y/n]" local dashline="${nc}${dashes}"
read -r -p "==> " autoxboot action="${red}[!] ${bwhite}FORMATTED ${nc}${red}[!]"
autoxboot="${autoxboot:-y}" multi_info
autoxboot="${autoxboot,,}" get "Proceed ? [Y/n]"
if [[ "${autoxboot}" == "y" ]]; then read -r -p "==> " autoxboot
xboot_dev="${xboot_comply}" autoxboot="${autoxboot:-y}"
elif [[ "${autoxboot}" == "n" ]]; then autoxboot="${autoxboot,,}"
until auto_part; do : ; done if [[ "${autoxboot}" == "y" ]]; then
return 0 xboot_dev="${xboot_comply}"
else elif [[ "${autoxboot}" == "n" ]]; then
y_n until auto_part; do : ; done
return 1 return 0
else
y_n
return 1
fi
fi
fi fi
fi fi
# ATTENTION: MULTI-HOME # ATTENTION: MULTI-HOME
@@ -2421,8 +2425,7 @@ sanity_check() {
sleep 0.2 sleep 0.2
CYAN "\n >> ${yellowl}WARNING: ${nc}/Root's size might not be adequate" CYAN "\n >> ${yellowl}WARNING: ${nc}/Root's size might not be adequate"
sleep 0.2 sleep 0.2
CYAN "\n CYAN "\n >> ${nc}Depending on the ${yellowl}size ${nc}of your setup, installation might ${yellowl}fail\n"
>> ${nc}Depending on the ${yellowl}size ${nc}of your setup, installation might ${yellowl}fail\n"
keypress keypress
fi fi
if [[ "${autoroot}" == "y" ]]; then if [[ "${autoroot}" == "y" ]]; then
@@ -2595,7 +2598,7 @@ sanity_check() {
else else
sanity="ok" sanity="ok"
fi fi
# ATTENTION: SANITY CHECK OK # ATTENTION: SANITY CHECK OK
if [[ "${sanity}" == "ok" ]]; then if [[ "${sanity}" == "ok" ]]; then
if [[ "${smartpart}" == "y" ]]; then if [[ "${smartpart}" == "y" ]]; then
local prompt="Disk ${sgdrive} Smart-Partitioned" local prompt="Disk ${sgdrive} Smart-Partitioned"
@@ -2605,7 +2608,6 @@ sanity_check() {
ok ok
fi fi
msg "SANITY CHECK OK" msg "SANITY CHECK OK"
printf "\n\n"
disk_overview disk_overview
get "Proceed using the ${nc}${cyan}current ${blue}partitioning layout ? [Y/n]" get "Proceed using the ${nc}${cyan}current ${blue}partitioning layout ? [Y/n]"
read -r -p "==> " partok read -r -p "==> " partok
@@ -3803,6 +3805,7 @@ AUR_NVIDIA_PKGS
local stage_prompt="Pacstrap System" local stage_prompt="Pacstrap System"
stage_fail stage_fail
fi fi
exec </dev/console >/dev/console 2>&1
if [[ "${fs}" == "2" ]]; then if [[ "${fs}" == "2" ]]; then
local prompt="Fstab" local prompt="Fstab"
local stage_prompt="Fstab" local stage_prompt="Fstab"
@@ -4742,7 +4745,6 @@ CUSTOM_SRVC
optimizations optimizations
secboot_sign secboot_sign
} }
#END SYSTEM FUNCTIONS
nc="\e[0m" nc="\e[0m"
red="\e[31m" red="\e[31m"
cyan="\e[36m" cyan="\e[36m"