Partition Manager stage: Added extended info about the supported partition types and mountpoints that the installer expects, for the installation to proceed.

Add: During 'Installation Disk Selection' stage, the installer scans the installation disk and if the ESP is found to be less than 300M,
the installer returns to the 'Partition Manager' stage, so the user can remedy this.

Add: For extended clarity reasons, A 'pseudo-graphical' partition/filesystem presentation has been added at the 'Sanity Check' stage
when multiple partitions of the same type {root/EFI/home/swap} have been detected and the user needs to confirm the Automated Selection made by the installer, to comply with the 'Discoverable Partition Specifications'
This commit is contained in:
Jane Doe 2024-06-13 21:14:56 +00:00
parent 891e052ec0
commit a109cffd1f

142
Amelia.sh
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Amelia Installer # Amelia Installer
# Version: 5.3 # Version: 5.4
set -euo pipefail set -euo pipefail
trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
@ -143,7 +143,6 @@ unmount (){
sleep 0.3 sleep 0.3
RED " RED "
[!] Unmounting and Retrying.. " [!] Unmounting and Retrying.. "
reload reload
sleep 0.3 sleep 0.3
@ -162,7 +161,8 @@ ${magenta}###${nc}-----------------------------------${magenta}[ ${bwhite}Unmoun
RED " RED "
[!] Unmounting failed " [!] Unmounting failed
"
failure failure
fi fi
} }
@ -2428,6 +2428,15 @@ ${magenta}###${nc}--------------------------------------${magenta}[ ${bwhite}San
[!] WARNING: Multiple Linux x86-64 /Root Partitions have been detected [!] WARNING: Multiple Linux x86-64 /Root Partitions have been detected
" "
sleep 0.3
YELLOW "
###---------------------------------------------[ FILESYSTEM OVERVIEW ]---------------------------------------------###
"
lsblk -f "${instl_drive}"|GREP_COLORS='mt=01;36' grep -E --color=always 'vfat|$'|GREP_COLORS='mt=01;32' grep -E --color=always 'ext4|$'|GREP_COLORS='mt=01;35' grep -E --color=always 'btrfs|$'|GREP_COLORS='mt=01;31' grep -E --color=always 'ntfs|$'|GREP_COLORS='mt=01;33' grep -E --color=always 'swap|$'
YELLOW "
###-----------------------------------------------------------------------------------------------------------------###"
NC " NC "
Linux x86-64 /Root Partitions: Linux x86-64 /Root Partitions:
@ -2472,6 +2481,15 @@ ${multi_root}
[!] WARNING: Multiple EFI Partitions have been detected [!] WARNING: Multiple EFI Partitions have been detected
" "
sleep 0.3
YELLOW "
###---------------------------------------------[ FILESYSTEM OVERVIEW ]---------------------------------------------###
"
lsblk -f "${instl_drive}"|GREP_COLORS='mt=01;36' grep -E --color=always 'vfat|$'|GREP_COLORS='mt=01;32' grep -E --color=always 'ext4|$'|GREP_COLORS='mt=01;35' grep -E --color=always 'btrfs|$'|GREP_COLORS='mt=01;31' grep -E --color=always 'ntfs|$'|GREP_COLORS='mt=01;33' grep -E --color=always 'swap|$'
YELLOW "
###-----------------------------------------------------------------------------------------------------------------###"
NC " NC "
Linux EFI System Partitions: Linux EFI System Partitions:
@ -2495,8 +2513,26 @@ ${multi_boot}
if [[ "${autoboot}" == "y" ]]; then if [[ "${autoboot}" == "y" ]]; then
boot_dev="${boot_comply}" boot_dev="${boot_comply}"
ok bootsize="$(lsblk -b "${boot_dev}" --noheadings --output=size)"
line2 if [[ "${bootsize}" -lt "314572800" ]]; then
sanity="no"
sleep 0.3
RED "
[!] WARNING: EFI Partition's size is not adequate. Create a ${nc}300 M ${red}EFI Partition at minimum "
sleep 3
RED "
[!] Sanity Check Failed [!] "
sleep 4
reload
until disk_mngr; do : ; done
retry_boot="yes"
return 0
else
ok
line2
fi
elif [[ "${autoboot}" == "n" ]]; then elif [[ "${autoboot}" == "n" ]]; then
stage_fail stage_fail
else else
@ -2515,6 +2551,15 @@ ${multi_boot}
[!] WARNING: Multiple Linux /Home Partitions have been detected [!] WARNING: Multiple Linux /Home Partitions have been detected
" "
sleep 0.3
YELLOW "
###---------------------------------------------[ FILESYSTEM OVERVIEW ]---------------------------------------------###
"
lsblk -f "${instl_drive}"|GREP_COLORS='mt=01;36' grep -E --color=always 'vfat|$'|GREP_COLORS='mt=01;32' grep -E --color=always 'ext4|$'|GREP_COLORS='mt=01;35' grep -E --color=always 'btrfs|$'|GREP_COLORS='mt=01;31' grep -E --color=always 'ntfs|$'|GREP_COLORS='mt=01;33' grep -E --color=always 'swap|$'
YELLOW "
###-----------------------------------------------------------------------------------------------------------------###"
NC " NC "
Linux /Home Partitions: Linux /Home Partitions:
@ -2558,9 +2603,18 @@ ${multi_home}
[!] WARNING: Multiple Linux /Swap Partitions have been detected [!] WARNING: Multiple Linux /Swap Partitions have been detected
" "
sleep 0.3
YELLOW "
###---------------------------------------------[ FILESYSTEM OVERVIEW ]---------------------------------------------###
"
lsblk -f "${instl_drive}"|GREP_COLORS='mt=01;36' grep -E --color=always 'vfat|$'|GREP_COLORS='mt=01;32' grep -E --color=always 'ext4|$'|GREP_COLORS='mt=01;35' grep -E --color=always 'btrfs|$'|GREP_COLORS='mt=01;31' grep -E --color=always 'ntfs|$'|GREP_COLORS='mt=01;33' grep -E --color=always 'swap|$'
YELLOW "
###-----------------------------------------------------------------------------------------------------------------###"
NC " NC "
Linux /Swap Partitions: Linux /Swap Partitions:
------------------------ ------------------------
${multi_swap} ${multi_swap}
------------------------ ------------------------
@ -2592,7 +2646,10 @@ ${multi_swap}
return 1 return 1
fi fi
fi fi
local prompt="Installation Disk" local prompt="Installation Disk"
bootsize="$(lsblk -b "${boot_dev}" --noheadings --output=size)"
if [[ ! -e "${root_dev}" && ! -e "${boot_dev}" ]]; then if [[ ! -e "${root_dev}" && ! -e "${boot_dev}" ]]; then
sanity="no" sanity="no"
sleep 0.3 sleep 0.3
@ -2613,34 +2670,50 @@ ${multi_swap}
RED " RED "
[!] Sanity Check Failed [!] " [!] Sanity Check Failed [!] "
sleep 2 sleep 4
reload reload
until disk_mngr; do : ; done until disk_mngr; do : ; done
return 0 return 0
elif [[ ! -e "${root_dev}" && -e "${boot_dev}" ]]; then elif [[ ! -e "${root_dev}" && -e "${boot_dev}" ]]; then
sanity="no" if [[ "${bootsize}" -lt "314572800" ]]; then
sleep 0.3 sanity="no"
NC " sleep 0.3
==> [EFI System Partition ${green}OK${nc}] "
sleep 0.3
RED " RED "
[!] WARNING: EFI Partition's size is not adequate. Create a ${nc}300 M ${red}EFI Partition at minimum "
sleep 3
RED "
[!] Sanity Check Failed [!] "
sleep 4
reload
until disk_mngr; do : ; done
return 0
else
sanity="no"
sleep 0.3
NC "
==> [EFI System Partition ${green}OK${nc}] "
sleep 0.3
RED "
[!] Linux x86-64 /Root Partition not detected " [!] Linux x86-64 /Root Partition not detected "
sleep 0.3 sleep 0.3
YELLOW " YELLOW "
--> Please comply with the Discoverable Partitions Specification to continue.. --> Please comply with the Discoverable Partitions Specification to continue..
### Ensure that a Linux x86-64 /Root Partition with a valid GUID code ${nc}(8304)${yellow} is present on disk " ### Ensure that a Linux x86-64 /Root Partition with a valid GUID code ${nc}(8304)${yellow} is present on disk "
sleep 0.3 sleep 0.3
RED " RED "
[!] Sanity Check Failed [!] " [!] Sanity Check Failed [!] "
sleep 2 sleep 4
reload reload
until disk_mngr; do : ; done until disk_mngr; do : ; done
return 0 return 0
fi
elif [[ -e "${root_dev}" && ! -e "${boot_dev}" ]]; then elif [[ -e "${root_dev}" && ! -e "${boot_dev}" ]]; then
sanity="no" sanity="no"
sleep 0.3 sleep 0.3
@ -2661,11 +2734,26 @@ ${multi_swap}
RED " RED "
[!] Sanity Check Failed [!] " [!] Sanity Check Failed [!] "
sleep 2 sleep 4
reload reload
until disk_mngr; do : ; done until disk_mngr; do : ; done
return 0 return 0
elif [[ -e "${root_dev}" && -e "${boot_dev}" ]]; then elif [[ -e "${root_dev}" && -e "${boot_dev}" ]]; then
if [[ "${bootsize}" -lt "314572800" ]]; then
sanity="no"
sleep 0.3
RED "
[!] WARNING: EFI Partition's size is not adequate. Create a ${nc}300 M ${red}EFI Partition at minimum "
sleep 3
RED "
[!] Sanity Check Failed [!] "
sleep 4
reload
until disk_mngr; do : ; done
return 0
fi
sanity="ok" sanity="ok"
if [[ "${autoroot}" != "y" ]]; then if [[ "${autoroot}" != "y" ]]; then
sleep 0.3 sleep 0.3
@ -2678,8 +2766,12 @@ ${multi_swap}
NC " NC "
==> [EFI System Partition ${green}OK${nc}] " ==> [EFI System Partition ${green}OK${nc}] "
fi elif [[ "${autoboot}" == "y" && "${retry_boot}" == "yes" ]]; then
sleep 0.3
NC "
==> [EFI System Partition ${green}OK${nc}] "
fi
if [[ -e "${home_dev}" ]]; then if [[ -e "${home_dev}" ]]; then
if [[ "${autohome}" != "y" ]]; then if [[ "${autohome}" != "y" ]]; then
sleep 0.3 sleep 0.3
@ -2714,7 +2806,7 @@ ${multi_swap}
RED " RED "
[!] Sanity Check Failed [!] " [!] Sanity Check Failed [!] "
sleep 2 sleep 4
reload reload
until disk_mngr; do : ; done until disk_mngr; do : ; done
return 0 return 0
@ -5086,6 +5178,8 @@ NVIDIA_HOOK
autoboot="" autoboot=""
autohome="" autohome=""
autoswap="" autoswap=""
bootsize=""
retry_boot=""
clear clear
first_check first_check