diff --git a/Amelia.sh b/Amelia.sh index 2c480e7..8018e0e 100644 --- a/Amelia.sh +++ b/Amelia.sh @@ -1,7 +1,7 @@ #!/bin/bash # Amelia Installer -# Version: 5.3 +# Version: 5.4 set -euo pipefail trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR @@ -143,7 +143,6 @@ unmount (){ sleep 0.3 RED " - [!] Unmounting and Retrying.. " reload sleep 0.3 @@ -162,7 +161,8 @@ ${magenta}###${nc}-----------------------------------${magenta}[ ${bwhite}Unmoun RED " - [!] Unmounting failed " + [!] Unmounting failed + " failure fi } @@ -2428,6 +2428,15 @@ ${magenta}###${nc}--------------------------------------${magenta}[ ${bwhite}San [!] 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 " Linux x86-64 /Root Partitions: @@ -2472,6 +2481,15 @@ ${multi_root} [!] 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 " Linux EFI System Partitions: @@ -2495,8 +2513,26 @@ ${multi_boot} if [[ "${autoboot}" == "y" ]]; then boot_dev="${boot_comply}" - ok - line2 + bootsize="$(lsblk -b "${boot_dev}" --noheadings --output=size)" + 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 stage_fail else @@ -2515,6 +2551,15 @@ ${multi_boot} [!] 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 " Linux /Home Partitions: @@ -2558,9 +2603,18 @@ ${multi_home} [!] 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 " Linux /Swap Partitions: - + ------------------------ ${multi_swap} ------------------------ @@ -2592,7 +2646,10 @@ ${multi_swap} return 1 fi fi + local prompt="Installation Disk" + bootsize="$(lsblk -b "${boot_dev}" --noheadings --output=size)" + if [[ ! -e "${root_dev}" && ! -e "${boot_dev}" ]]; then sanity="no" sleep 0.3 @@ -2613,34 +2670,50 @@ ${multi_swap} RED " [!] Sanity Check Failed [!] " - sleep 2 + sleep 4 reload until disk_mngr; do : ; done return 0 elif [[ ! -e "${root_dev}" && -e "${boot_dev}" ]]; then - sanity="no" - sleep 0.3 - NC " - -==> [EFI System Partition ${green}OK${nc}] " - sleep 0.3 + 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 + else + sanity="no" + sleep 0.3 + NC " + +==> [EFI System Partition ${green}OK${nc}] " + sleep 0.3 + RED " + [!] Linux x86-64 /Root Partition not detected " - sleep 0.3 - YELLOW " + sleep 0.3 + YELLOW " --> 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 " - sleep 0.3 - RED " + sleep 0.3 + RED " [!] Sanity Check Failed [!] " - sleep 2 - reload - until disk_mngr; do : ; done - return 0 + sleep 4 + reload + until disk_mngr; do : ; done + return 0 + fi elif [[ -e "${root_dev}" && ! -e "${boot_dev}" ]]; then sanity="no" sleep 0.3 @@ -2661,11 +2734,26 @@ ${multi_swap} RED " [!] Sanity Check Failed [!] " - sleep 2 + sleep 4 reload until disk_mngr; do : ; done return 0 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" if [[ "${autoroot}" != "y" ]]; then sleep 0.3 @@ -2678,8 +2766,12 @@ ${multi_swap} 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 [[ "${autohome}" != "y" ]]; then sleep 0.3 @@ -2714,7 +2806,7 @@ ${multi_swap} RED " [!] Sanity Check Failed [!] " - sleep 2 + sleep 4 reload until disk_mngr; do : ; done return 0 @@ -5086,6 +5178,8 @@ NVIDIA_HOOK autoboot="" autohome="" autoswap="" + bootsize="" + retry_boot="" clear first_check