Change: The 'Sanity Check' stage has been revamped

Change: A few prompts have been edited for better aesthetics.
This commit is contained in:
Jane Doe
2025-11-17 21:57:56 +02:00
parent 439fef644e
commit c2c81412b4
+73 -96
View File
@@ -2,7 +2,7 @@
# Amelia Installer # Amelia Installer
# Source: https://gitlab.com/prism7/archery # Source: https://gitlab.com/prism7/archery
# Version: 1.0.6 # Version: 1.0.7
set -euo pipefail set -euo pipefail
################################################################################################### ###################################################################################################
@@ -4017,6 +4017,11 @@ ${magenta}###${nc}--------------------------------------${magenta}[ ${bwhite}San
swap_dev="$(fdisk -l "${instl_drive}" | grep -E 'swap' | awk "{print \$1}")" swap_dev="$(fdisk -l "${instl_drive}" | grep -E 'swap' | awk "{print \$1}")"
multi_swap="$(fdisk -l "${instl_drive}" | grep -E 'swap' | awk "{print \$1}" | cat --number)" multi_swap="$(fdisk -l "${instl_drive}" | grep -E 'swap' | awk "{print \$1}" | cat --number)"
swap_comply="$(fdisk -l "${instl_drive}" | grep -E 'swap' | awk "{print \$1}" | cat --number | grep -E '1[[:blank:]]' | awk "{print \$2}")" swap_comply="$(fdisk -l "${instl_drive}" | grep -E 'swap' | awk "{print \$1}" | cat --number | grep -E '1[[:blank:]]' | awk "{print \$2}")"
rootprt=""
espprt=""
xbootprt=""
homeprt=""
swapprt=""
if [[ "${rootcount}" -gt "1" ]]; then if [[ "${rootcount}" -gt "1" ]]; then
local stage_prompt="Selecting Partition" local stage_prompt="Selecting Partition"
@@ -4045,7 +4050,7 @@ ${multi_root}
### Only the 1st Linux x86-64 /Root partition on a selected disk can be auto-assigned as a valid /Root partition ### Only the 1st Linux x86-64 /Root partition on a selected disk can be auto-assigned as a valid /Root partition
### Partition ${nc}${root_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!] > Partition ${nc}${root_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!]
" "
BLUE " BLUE "
@@ -4097,11 +4102,11 @@ ${multi_esp}
" "
if [[ "${multibooting}" == "n" ]]; then if [[ "${multibooting}" == "n" ]]; then
YELLOW " YELLOW "
### Partition ${nc}${esp_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!] > Partition ${nc}${esp_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!]
" "
elif [[ "${multibooting}" == "y" ]]; then elif [[ "${multibooting}" == "y" ]]; then
YELLOW " YELLOW "
### Partition ${nc}${esp_comply} ${yellow}is auto-assigned as such and will be used > Partition ${nc}${esp_comply} ${yellow}is auto-assigned as such and will be used
" "
fi fi
BLUE " BLUE "
@@ -4152,7 +4157,7 @@ ${multi_xboot}
### Only the 1st Linux Extended Boot partition on a selected disk can be auto-assigned as a valid XBOOTLDR partition ### Only the 1st Linux Extended Boot partition on a selected disk can be auto-assigned as a valid XBOOTLDR partition
### Partition ${nc}${xboot_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!] > Partition ${nc}${xboot_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!]
" "
BLUE " BLUE "
@@ -4202,7 +4207,7 @@ ${multi_home}
### Only the 1st Linux /Home partition on a selected disk can be auto-assigned as a valid /Home partition ### Only the 1st Linux /Home partition on a selected disk can be auto-assigned as a valid /Home partition
### Partition ${nc}${home_comply} ${yellow}is auto-assigned as such and will be used > Partition ${nc}${home_comply} ${yellow}is auto-assigned as such and will be used
" "
BLUE " BLUE "
@@ -4252,7 +4257,7 @@ ${multi_swap}
### Only the 1st Linux /Swap partition on a selected disk can be auto-assigned as a valid /Swap partition ### Only the 1st Linux /Swap partition on a selected disk can be auto-assigned as a valid /Swap partition
### Partition ${nc}${swap_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!] > Partition ${nc}${swap_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!]
" "
BLUE " BLUE "
@@ -4282,15 +4287,11 @@ ${multi_swap}
else else
rootprt="ok" rootprt="ok"
sleep 0.2 sleep 0.2
RED " CYAN "
----------------------------------------------------- >> ${yellowl}WARNING: ${nc}/Root's size might not be adequate " #ATTENTION
### ${yellow}WARNING: ${nc}/Root's size might not be adequate ${red}###
-----------------------------------------------------"
sleep 0.2 sleep 0.2
RED " CYAN "
------------------------------------------------------------------------ >> ${nc}Depending on the ${yellowl}size ${nc}of your setup, installation might ${yellowl}fail " #ATTENTION
### ${nc}Depending on the size of your setup, installation might fail ! ${red}###
------------------------------------------------------------------------"
NC " NC "
@@ -4303,27 +4304,26 @@ ${multi_swap}
fi fi
if [[ "${autoroot}" == "y" ]]; then if [[ "${autoroot}" == "y" ]]; then
if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then
rootprt="ok"
sleep 0.2 sleep 0.2
NC " GREEN "
>> ${nc}Linux x86-64 /Root partition ${green}OK " #ATTENTION
==> [Linux x86-64 /Root ${green}OK${nc}] "
else else
rootprt="ok"
local prompt="Confirmed /Root Partition" local prompt="Confirmed /Root Partition"
ok ok
fi fi
else else
sleep 0.2 sleep 0.2
NC " rootprt="ok"
GREEN "
==> [Linux x86-64 /Root ${green}OK${nc}] " >> ${nc}Linux x86-64 /Root partition ${green}OK " #ATTENTION
fi fi
else else
rootprt="fail" rootprt="fail"
sleep 0.2 sleep 0.2
RED " RED "
--------------------------------------------------- >> ${yellowl}Linux x86-64 /Root ${nc}partition not detected " #ATTENTION
### ${yellowl}Linux x86-64 /Root ${nc}Partition not detected ${red}###
---------------------------------------------------"
fi fi
#.................................................................................................. #..................................................................................................
@@ -4331,33 +4331,32 @@ ${multi_swap}
espprt="fail" espprt="fail"
sleep 0.2 sleep 0.2
RED " RED "
------------------------------------------- >> ${yellowl}EFI System ${nc}partition not detected " #ATTENTION
### ${yellowl}EFI System ${nc}Partition not detected ${red}###
-------------------------------------------"
fi fi
if [[ -e "${esp_dev}" ]]; then if [[ -e "${esp_dev}" ]]; then
espsize="$(lsblk -dno SIZE --bytes "${esp_dev}")" espsize="$(lsblk -dno SIZE --bytes "${esp_dev}")"
fi fi
if [[ "${espsize}" -ge "209715200" ]]; then if [[ -e "${esp_dev}" && "${espsize}" -ge "209715200" ]]; then
espprt="ok" espprt="ok"
xbootloader="no" xbootloader="no"
if [[ "${autoesp}" == "y" ]]; then if [[ "${autoesp}" == "y" ]]; then
if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then
espprt="ok"
sleep 0.2 sleep 0.2
NC " GREEN "
>> ${nc}EFI System partition ${green}OK " #ATTENTION
==> [EFI System Partition ${green}OK${nc}] "
else else
espprt="ok"
local prompt="Confirmed /EFI System Partition" local prompt="Confirmed /EFI System Partition"
ok ok
fi fi
else else
espprt="ok"
sleep 0.2 sleep 0.2
NC " GREEN "
>> ${nc}EFI System partition ${green}OK " #ATTENTION
==> [EFI System Partition ${green}OK${nc}] "
fi fi
fi fi
@@ -4370,86 +4369,75 @@ ${multi_swap}
espprt="ok" espprt="ok"
if [[ "${autoesp}" == "y" ]]; then if [[ "${autoesp}" == "y" ]]; then
if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then
espprt="ok"
sleep 0.2 sleep 0.2
NC " GREEN "
>> ${nc}EFI System partition ${green}OK " #ATTENTION
==> [EFI System Partition ${green}OK${nc}] "
else else
espprt="ok"
local prompt="Confirmed /EFI System Partition" local prompt="Confirmed /EFI System Partition"
ok ok
fi fi
else else
espprt="ok"
sleep 0.2 sleep 0.2
NC " GREEN "
>> ${nc}EFI System partition ${green}OK " #ATTENTION
==> [EFI System Partition ${green}OK${nc}] "
fi fi
if [[ "${autoxboot}" == "y" ]]; then if [[ "${autoxboot}" == "y" ]]; then
if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then
sleep 0.2 sleep 0.2
NC " GREEN "
>> ${nc}Linux Extended Boot partition ${green}OK " #ATTENTION
==> [Linux Extended Boot Partition ${green}OK${nc}] "
else else
local prompt="Confirmed /XBOOTLDR Partition" local prompt="Confirmed /XBOOTLDR Partition"
ok ok
fi fi
else else
sleep 0.2 sleep 0.2
NC " GREEN "
>> ${nc}Linux Extended Boot partition ${green}OK " #ATTENTION
==> [Linux Extended Boot Partition ${green}OK${nc}] "
fi fi
else else
xbootprt="fail" xbootprt="fail"
espprt="fail" espprt="fail"
sleep 0.2 sleep 0.2
RED " CYAN "
--------------------------------------------- >> ${yellowl}WARNING: ${nc}ESP's size is not ${bwhite}adequate " #ATTENTION
### ${yellow}WARNING: ${nc}ESP's size is not adequate ${red}###
---------------------------------------------"
sleep 0.2 sleep 0.2
RED " RED "
---------------------------------------------------- >> ${yellowl}Linux Extended Boot ${nc}partition not detected " #ATTENTION
### ${yellowl}Linux Extended Boot ${nc}Partition not detected ${red}###
----------------------------------------------------"
fi fi
elif [[ "${multibooting}" == "n" ]]; then elif [[ "${multibooting}" == "n" ]]; then
espprt="fail" espprt="fail"
xbootloader="no" xbootloader="no"
sleep 0.2 sleep 0.2
RED " CYAN "
--------------------------------------------- >> ${yellowl}WARNING: ${nc}ESP's size is not ${bwhite}adequate " #ATTENTION
### ${yellow}WARNING: ${nc}ESP's size is not adequate ${red}###
---------------------------------------------"
fi fi
elif [[ "${bootloader}" == "2" ]]; then elif [[ "${bootloader}" == "2" ]]; then
if [[ "${espmnt}" == "2" ]]; then if [[ "${espmnt}" == "2" ]]; then
espprt="fail" espprt="fail"
xbootloader="no" xbootloader="no"
sleep 0.2 sleep 0.2
RED " CYAN "
--------------------------------------------- >> ${yellowl}WARNING: ${nc}ESP's size is not ${bwhite}adequate " #ATTENTION
### ${yellow}WARNING: ${nc}ESP's size is not adequate ${red}###
---------------------------------------------"
elif [[ "${espmnt}" == "1" ]]; then elif [[ "${espmnt}" == "1" ]]; then
espprt="ok" espprt="ok"
xbootloader="no" xbootloader="no"
if [[ "${autoesp}" == "y" ]]; then if [[ "${autoesp}" == "y" ]]; then
if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then
sleep 0.2 sleep 0.2
NC " GREEN "
>> ${nc}EFI System partition ${green}OK " #ATTENTION
==> [EFI System Partition ${green}OK${nc}] "
else else
local prompt="Confirmed /EFI System Partition" local prompt="Confirmed /EFI System Partition"
ok ok
fi fi
else else
sleep 0.2 sleep 0.2
NC " GREEN "
>> ${nc}EFI System partition ${green}OK " #ATTENTION
==> [EFI System Partition ${green}OK${nc}] "
fi fi
fi fi
fi fi
@@ -4462,26 +4450,21 @@ ${multi_swap}
if [[ "${autohome}" == "y" ]]; then if [[ "${autohome}" == "y" ]]; then
if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then
sleep 0.2 sleep 0.2
NC " GREEN "
>> ${nc}Linux /Home partition ${green}OK " #ATTENTION
==> [Linux /Home ${green}OK${nc}] "
else else
local prompt="Confirmed /Home Partition" local prompt="Confirmed /Home Partition"
ok ok
fi fi
else else
sleep 0.2 GREEN "
NC " >> ${nc}Linux /Home partition ${green}OK " #ATTENTION
==> [Linux /Home ${green}OK${nc}] "
fi fi
else else
homeprt="fail" homeprt="fail"
sleep 0.2 sleep 0.2
RED " RED "
-------------------------------------------- >> ${yellowl}Linux /Home ${nc}partition not detected " #ATTENTION
### ${yellowl}Linux /Home ${nc}Partition not detected ${red}###
--------------------------------------------"
fi fi
fi fi
fi fi
@@ -4492,26 +4475,22 @@ ${multi_swap}
if [[ "${autoswap}" == "y" ]]; then if [[ "${autoswap}" == "y" ]]; then
if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then
sleep 0.2 sleep 0.2
NC " GREEN "
>> ${nc}Linux /Swap partition ${green}OK " #ATTENTION
==> [Linux /Swap ${green}OK${nc}] "
else else
local prompt="Confirmed /Swap Partition" local prompt="Confirmed /Swap Partition"
ok ok
fi fi
else else
sleep 0.2 sleep 0.2
NC " GREEN "
>> ${nc}Linux /Swap partition ${green}OK " #ATTENTION
==> [Linux /Swap ${green}OK${nc}] "
fi fi
else else
swapprt="fail" swapprt="fail"
sleep 0.2 sleep 0.2
RED " RED "
-------------------------------------------- >> ${yellowl}Linux /Swap ${nc}partition not detected " #ATTENTION
### ${yellowl}Linux /Swap ${nc}Partition not detected ${red}###
--------------------------------------------"
fi fi
fi fi
#.................................................................................................. #..................................................................................................
@@ -4534,10 +4513,10 @@ ${multi_swap}
==> [${green}Disk ${sgdrive} Preset-Partitioned OK${nc}] " ==> [${green}Disk ${sgdrive} Preset-Partitioned OK${nc}] "
fi fi
sleep 0.2 sleep 0.2
NC " GREEN "
----------------------- -----------------------
### ${green}SANITY CHECK OK${nc} ### ### ${bwhite}SANITY CHECK OK${nc}${green} ###
-----------------------" -----------------------"
sleep 0.2 sleep 0.2
CYAN " CYAN "
@@ -4589,10 +4568,10 @@ ${multi_swap}
#-------------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------------
elif [[ "${sanity}" == "no" ]]; then elif [[ "${sanity}" == "no" ]]; then
sleep 0.2 sleep 0.2
NC " RED "
----------------------------- -----------------------------
### ${red}SANITY CHECK FAILED ${nc}### ### ${bwhite}SANITY CHECK FAILED ${nc}${red}###
-----------------------------" -----------------------------"
NC " NC "
@@ -4608,14 +4587,12 @@ ${multi_swap}
if [[ "${espprt}" == "fail" && -e "${esp_dev}" ]]; then if [[ "${espprt}" == "fail" && -e "${esp_dev}" ]]; then
sleep 0.2 sleep 0.2
CYAN " CYAN "
-------------------------------------------------- >> ${yellowl}ESP: ${nc}Not all prerequisites are satisfied " #ATTENTION
### ${yellowl}ESP: ${nc}Not all prerequisites are satisfied ${cyan}###
--------------------------------------------------"
if [[ "${espmnt}" == "2" ]]; then if [[ "${espmnt}" == "2" ]]; then
sleep 0.2 sleep 0.2
CYAN " CYAN "
>> ${nc}Select ${yellowl}/mnt/efi ${nc}as the mountpoint for your ${yellowl}ESP " >> ${nc}Select ${yellowl}/mnt/efi ${nc}as the mountpoint for your ${yellowl}ESP " #ATTENTION
fi fi
if [[ "${xbootprt}" == "fail" ]]; then if [[ "${xbootprt}" == "fail" ]]; then
sleep 0.2 sleep 0.2
@@ -4624,7 +4601,7 @@ ${multi_swap}
>> ${yellowl}Systemd-boot:${nc}${cyan} >> ${yellowl}Systemd-boot:${nc}${cyan}
>> ${nc}Create a ${yellowl}300M ${nc}(at minimum) Linux Extended Boot Partition ${bwhite}(XBOOTLDR) ${yellowl}[GUID CODE: ea00] >> ${nc}Create a ${yellowl}300M ${nc}(at minimum) Linux Extended Boot Partition ${bwhite}(XBOOTLDR) ${yellowl}[GUID CODE: ea00]
" " #ATTENTION
fi fi
NC " NC "
@@ -5808,7 +5785,7 @@ ${magenta}###${nc}-------------------------------${magenta}[ ${bwhite}Confirm In
################################################################################################### ###################################################################################################
revise() { revise() {
reset=(xbootloader="" desktop="" terminal="" custompkgs="" customservices="" cust_bootopts="" REGDOM="" autoroot="" autoxboot="" autohome="" autoswap="" lowlat="" nogsp="" sanity="" partok="" preset="" set_optm="" ask_param="" kill_watchdog="" genoptm="" desk_setup="" devel="" web="" web_pkg="" web_aur="" web_slct="" set_optm_slct="" oomd="" irqbalance="" thermald="" rngd="" rtkit="" tlp="" CRYPTPASS="" CRYPTPASS2="" askoptm="" gptslct="" gptok="" gptabort="" nvdprop="" nowarning="" hometype="" homeform="") reset=(xbootloader="" desktop="" terminal="" custompkgs="" customservices="" cust_bootopts="" REGDOM="" autoroot="" autoxboot="" autohome="" autoswap="" lowlat="" nogsp="" sanity="" partok="" preset="" set_optm="" ask_param="" kill_watchdog="" genoptm="" desk_setup="" devel="" web="" web_pkg="" web_aur="" web_slct="" set_optm_slct="" oomd="" irqbalance="" thermald="" rngd="" rtkit="" tlp="" CRYPTPASS="" CRYPTPASS2="" askoptm="" gptslct="" gptok="" gptabort="" nvdprop="" nowarning="" hometype="" homeform="" smartpart="")
export "${reset[@]}" export "${reset[@]}"
gfxpkgs=() gfxpkgs=()