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
# Source: https://gitlab.com/prism7/archery
# Version: 1.0.6
# Version: 1.0.7
set -euo pipefail
###################################################################################################
@@ -4017,6 +4017,11 @@ ${magenta}###${nc}--------------------------------------${magenta}[ ${bwhite}San
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)"
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
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
### 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 "
@@ -4097,11 +4102,11 @@ ${multi_esp}
"
if [[ "${multibooting}" == "n" ]]; then
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
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
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
### 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 "
@@ -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
### 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 "
@@ -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
### 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 "
@@ -4282,15 +4287,11 @@ ${multi_swap}
else
rootprt="ok"
sleep 0.2
RED "
-----------------------------------------------------
### ${yellow}WARNING: ${nc}/Root's size might not be adequate ${red}###
-----------------------------------------------------"
CYAN "
>> ${yellowl}WARNING: ${nc}/Root's size might not be adequate " #ATTENTION
sleep 0.2
RED "
------------------------------------------------------------------------
### ${nc}Depending on the size of your setup, installation might fail ! ${red}###
------------------------------------------------------------------------"
CYAN "
>> ${nc}Depending on the ${yellowl}size ${nc}of your setup, installation might ${yellowl}fail " #ATTENTION
NC "
@@ -4303,27 +4304,26 @@ ${multi_swap}
fi
if [[ "${autoroot}" == "y" ]]; then
if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then
rootprt="ok"
sleep 0.2
NC "
==> [Linux x86-64 /Root ${green}OK${nc}] "
GREEN "
>> ${nc}Linux x86-64 /Root partition ${green}OK " #ATTENTION
else
rootprt="ok"
local prompt="Confirmed /Root Partition"
ok
fi
else
sleep 0.2
NC "
==> [Linux x86-64 /Root ${green}OK${nc}] "
rootprt="ok"
GREEN "
>> ${nc}Linux x86-64 /Root partition ${green}OK " #ATTENTION
fi
else
rootprt="fail"
sleep 0.2
RED "
---------------------------------------------------
### ${yellowl}Linux x86-64 /Root ${nc}Partition not detected ${red}###
---------------------------------------------------"
>> ${yellowl}Linux x86-64 /Root ${nc}partition not detected " #ATTENTION
fi
#..................................................................................................
@@ -4331,33 +4331,32 @@ ${multi_swap}
espprt="fail"
sleep 0.2
RED "
-------------------------------------------
### ${yellowl}EFI System ${nc}Partition not detected ${red}###
-------------------------------------------"
>> ${yellowl}EFI System ${nc}partition not detected " #ATTENTION
fi
if [[ -e "${esp_dev}" ]]; then
espsize="$(lsblk -dno SIZE --bytes "${esp_dev}")"
fi
if [[ "${espsize}" -ge "209715200" ]]; then
if [[ -e "${esp_dev}" && "${espsize}" -ge "209715200" ]]; then
espprt="ok"
xbootloader="no"
if [[ "${autoesp}" == "y" ]]; then
if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then
espprt="ok"
sleep 0.2
NC "
==> [EFI System Partition ${green}OK${nc}] "
GREEN "
>> ${nc}EFI System partition ${green}OK " #ATTENTION
else
espprt="ok"
local prompt="Confirmed /EFI System Partition"
ok
fi
else
espprt="ok"
sleep 0.2
NC "
==> [EFI System Partition ${green}OK${nc}] "
GREEN "
>> ${nc}EFI System partition ${green}OK " #ATTENTION
fi
fi
@@ -4370,86 +4369,75 @@ ${multi_swap}
espprt="ok"
if [[ "${autoesp}" == "y" ]]; then
if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then
espprt="ok"
sleep 0.2
NC "
==> [EFI System Partition ${green}OK${nc}] "
GREEN "
>> ${nc}EFI System partition ${green}OK " #ATTENTION
else
espprt="ok"
local prompt="Confirmed /EFI System Partition"
ok
fi
else
espprt="ok"
sleep 0.2
NC "
==> [EFI System Partition ${green}OK${nc}] "
GREEN "
>> ${nc}EFI System partition ${green}OK " #ATTENTION
fi
if [[ "${autoxboot}" == "y" ]]; then
if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then
sleep 0.2
NC "
==> [Linux Extended Boot Partition ${green}OK${nc}] "
GREEN "
>> ${nc}Linux Extended Boot partition ${green}OK " #ATTENTION
else
local prompt="Confirmed /XBOOTLDR Partition"
ok
fi
else
sleep 0.2
NC "
==> [Linux Extended Boot Partition ${green}OK${nc}] "
GREEN "
>> ${nc}Linux Extended Boot partition ${green}OK " #ATTENTION
fi
else
xbootprt="fail"
espprt="fail"
sleep 0.2
RED "
---------------------------------------------
### ${yellow}WARNING: ${nc}ESP's size is not adequate ${red}###
---------------------------------------------"
CYAN "
>> ${yellowl}WARNING: ${nc}ESP's size is not ${bwhite}adequate " #ATTENTION
sleep 0.2
RED "
----------------------------------------------------
### ${yellowl}Linux Extended Boot ${nc}Partition not detected ${red}###
----------------------------------------------------"
>> ${yellowl}Linux Extended Boot ${nc}partition not detected " #ATTENTION
fi
elif [[ "${multibooting}" == "n" ]]; then
espprt="fail"
xbootloader="no"
sleep 0.2
RED "
---------------------------------------------
### ${yellow}WARNING: ${nc}ESP's size is not adequate ${red}###
---------------------------------------------"
CYAN "
>> ${yellowl}WARNING: ${nc}ESP's size is not ${bwhite}adequate " #ATTENTION
fi
elif [[ "${bootloader}" == "2" ]]; then
if [[ "${espmnt}" == "2" ]]; then
espprt="fail"
xbootloader="no"
sleep 0.2
RED "
---------------------------------------------
### ${yellow}WARNING: ${nc}ESP's size is not adequate ${red}###
---------------------------------------------"
CYAN "
>> ${yellowl}WARNING: ${nc}ESP's size is not ${bwhite}adequate " #ATTENTION
elif [[ "${espmnt}" == "1" ]]; then
espprt="ok"
xbootloader="no"
if [[ "${autoesp}" == "y" ]]; then
if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then
sleep 0.2
NC "
==> [EFI System Partition ${green}OK${nc}] "
GREEN "
>> ${nc}EFI System partition ${green}OK " #ATTENTION
else
local prompt="Confirmed /EFI System Partition"
ok
fi
else
sleep 0.2
NC "
==> [EFI System Partition ${green}OK${nc}] "
GREEN "
>> ${nc}EFI System partition ${green}OK " #ATTENTION
fi
fi
fi
@@ -4462,26 +4450,21 @@ ${multi_swap}
if [[ "${autohome}" == "y" ]]; then
if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then
sleep 0.2
NC "
==> [Linux /Home ${green}OK${nc}] "
GREEN "
>> ${nc}Linux /Home partition ${green}OK " #ATTENTION
else
local prompt="Confirmed /Home Partition"
ok
fi
else
sleep 0.2
NC "
==> [Linux /Home ${green}OK${nc}] "
GREEN "
>> ${nc}Linux /Home partition ${green}OK " #ATTENTION
fi
else
homeprt="fail"
sleep 0.2
RED "
--------------------------------------------
### ${yellowl}Linux /Home ${nc}Partition not detected ${red}###
--------------------------------------------"
>> ${yellowl}Linux /Home ${nc}partition not detected " #ATTENTION
fi
fi
fi
@@ -4492,26 +4475,22 @@ ${multi_swap}
if [[ "${autoswap}" == "y" ]]; then
if [[ "${presetpart}" == "y" || "${smartpart}" == "y" ]]; then
sleep 0.2
NC "
==> [Linux /Swap ${green}OK${nc}] "
GREEN "
>> ${nc}Linux /Swap partition ${green}OK " #ATTENTION
else
local prompt="Confirmed /Swap Partition"
ok
fi
else
sleep 0.2
NC "
==> [Linux /Swap ${green}OK${nc}] "
GREEN "
>> ${nc}Linux /Swap partition ${green}OK " #ATTENTION
fi
else
swapprt="fail"
sleep 0.2
RED "
--------------------------------------------
### ${yellowl}Linux /Swap ${nc}Partition not detected ${red}###
--------------------------------------------"
>> ${yellowl}Linux /Swap ${nc}partition not detected " #ATTENTION
fi
fi
#..................................................................................................
@@ -4534,10 +4513,10 @@ ${multi_swap}
==> [${green}Disk ${sgdrive} Preset-Partitioned OK${nc}] "
fi
sleep 0.2
NC "
GREEN "
-----------------------
### ${green}SANITY CHECK OK${nc} ###
### ${bwhite}SANITY CHECK OK${nc}${green} ###
-----------------------"
sleep 0.2
CYAN "
@@ -4589,10 +4568,10 @@ ${multi_swap}
#--------------------------------------------------------------------------------------------------
elif [[ "${sanity}" == "no" ]]; then
sleep 0.2
NC "
RED "
-----------------------------
### ${red}SANITY CHECK FAILED ${nc}###
### ${bwhite}SANITY CHECK FAILED ${nc}${red}###
-----------------------------"
NC "
@@ -4608,14 +4587,12 @@ ${multi_swap}
if [[ "${espprt}" == "fail" && -e "${esp_dev}" ]]; then
sleep 0.2
CYAN "
--------------------------------------------------
### ${yellowl}ESP: ${nc}Not all prerequisites are satisfied ${cyan}###
--------------------------------------------------"
>> ${yellowl}ESP: ${nc}Not all prerequisites are satisfied " #ATTENTION
if [[ "${espmnt}" == "2" ]]; then
sleep 0.2
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
if [[ "${xbootprt}" == "fail" ]]; then
sleep 0.2
@@ -4624,7 +4601,7 @@ ${multi_swap}
>> ${yellowl}Systemd-boot:${nc}${cyan}
>> ${nc}Create a ${yellowl}300M ${nc}(at minimum) Linux Extended Boot Partition ${bwhite}(XBOOTLDR) ${yellowl}[GUID CODE: ea00]
"
" #ATTENTION
fi
NC "
@@ -5808,7 +5785,7 @@ ${magenta}###${nc}-------------------------------${magenta}[ ${bwhite}Confirm In
###################################################################################################
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[@]}"
gfxpkgs=()