diff --git a/Amelia.sh b/Amelia.sh index fc317e3..f7d2270 100644 --- a/Amelia.sh +++ b/Amelia.sh @@ -1,7 +1,7 @@ #!/bin/bash # Amelia Installer -# Version: 5.2 +# Version: 5.1 set -euo pipefail trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR @@ -255,9 +255,9 @@ arch (){ } cnfg (){ line3 - YELLOWBGBL "--------------------------------------------------------------------------------------------------" + YELLOWBGBL "------------------------------------------------------------------------------------------------- " YELLOWBGBL " ### Configuring... ### " - YELLOWBGBL "--------------------------------------------------------------------------------------------------" + YELLOWBGBL "------------------------------------------------------------------------------------------------- " echo sleep 0.3 } @@ -2396,196 +2396,11 @@ sanity_check (){ ${magenta}###${nc}--------------------------------------${magenta}[ ${bwhite}Sanity Check${nc} ${magenta}]${nc}--------------------------------------${magenta}###${nc} " - rootcount="$(fdisk -l "${instl_drive}" | grep -E -c 'root' | awk "{print \$1}")" - root_dev="$(fdisk -l "${instl_drive}" | grep -E 'root' | awk "{print \$1}")" - multi_root="$(fdisk -l "${instl_drive}" | grep -E 'root' | awk "{print \$1}" | cat --number)" - root_comply="$(fdisk -l "${instl_drive}" | grep -E 'root' | awk "{print \$1}" | cat --number | grep -E '1[[:blank:]]' | awk "{print \$2}")" - bootcount="$(fdisk -l "${instl_drive}" | grep -E -c 'EFI' | awk "{print \$1}")" - boot_dev="$(fdisk -l "${instl_drive}" | grep -E 'EFI' | awk "{print \$1}")" - multi_boot="$(fdisk -l "${instl_drive}" | grep -E 'EFI' | awk "{print \$1}" | cat --number)" - boot_comply="$(fdisk -l "${instl_drive}" | grep -E 'EFI' | awk "{print \$1}" | cat --number | grep -E '1[[:blank:]]' | awk "{print \$2}")" - homecount="$(fdisk -l "${instl_drive}" | grep -E -c 'home' | awk "{print \$1}")" - home_dev="$(fdisk -l "${instl_drive}" | grep -E 'home' | awk "{print \$1}")" - multi_home="$(fdisk -l "${instl_drive}" | grep -E 'home' | awk "{print \$1}" | cat --number)" - home_comply="$(fdisk -l "${instl_drive}" | grep -E 'home' | awk "{print \$1}" | cat --number | grep -E '1[[:blank:]]' | awk "{print \$2}")" - swapcount="$(fdisk -l "${instl_drive}" | grep -E -c '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)" - swap_comply="$(fdisk -l "${instl_drive}" | grep -E 'swap' | awk "{print \$1}" | cat --number | grep -E '1[[:blank:]]' | awk "{print \$2}")" - - if [[ "${rootcount}" -gt "1" ]]; then - local prompt="Confirm /Root Partition" - local stage_prompt="Partition" - sleep 0.3 - RED " + root_dev="$(fdisk -l "${instl_drive}" | grep 'root' | awk "{print \$1}")" + boot_dev="$(fdisk -l "${instl_drive}" | grep 'EFI' | awk "{print \$1}")" + home_dev="$(fdisk -l "${instl_drive}" | grep 'home' | awk "{print \$1}")" + swap_dev="$(fdisk -l "${instl_drive}" | grep 'swap' | awk "{print \$1}")" - [!] WARNING: Multiple Linux x86-64 /Root Partitions have been detected - - " - NC " - Linux x86-64 /Root Partitions: - - ------------------------------ -${multi_root} - ------------------------------ - " - YELLOW " - - ### 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}[!] FORMATTED [!] - " - BLUE " - - - > Proceed ? [y/n]" - read -r -p " -==> " autoroot - - if [[ "${autoroot}" == "y" ]]; then - root_dev="${root_comply}" - ok - line2 - elif [[ "${autoroot}" == "n" ]]; then - stage_fail - else - invalid - echo - return 1 - fi - fi - - if [[ "${bootcount}" -gt "1" ]]; then - local prompt="Confirm /Boot Partition" - local stage_prompt="Partition" - sleep 0.3 - RED " - - [!] WARNING: Multiple EFI Partitions have been detected - - " - NC " - Linux EFI System Partitions: - - ---------------------------- -${multi_boot} - ---------------------------- - " - YELLOW " - - ### Only the 1st EFI partition on a selected disk can be auto-assigned as a valid EFI partition - - - ### Partition ${nc}${boot_comply} ${yellow}is auto-assigned as such and will be ${red}[!] FORMATTED [!] - " - BLUE " - - - > Proceed ? [y/n]" - read -r -p " -==> " autoboot - - if [[ "${autoboot}" == "y" ]]; then - boot_dev="${boot_comply}" - ok - line2 - elif [[ "${autoboot}" == "n" ]]; then - stage_fail - else - invalid - echo - return 1 - fi - fi - - if [[ "${homecount}" -gt "1" ]]; then - local prompt="Confirm /Home Partition" - local stage_prompt="Partition" - sleep 0.3 - RED " - - [!] WARNING: Multiple Linux /Home Partitions have been detected - - " - NC " - Linux /Home Partitions: - - ----------------------- -${multi_home} - ----------------------- - " - YELLOW " - - ### 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 ${red}[!] FORMATTED [!] - " - BLUE " - - - > Proceed ? [y/n]" - read -r -p " -==> " autohome - - if [[ "${autohome}" == "y" ]]; then - home_dev="${home_comply}" - ok - line2 - elif [[ "${autohome}" == "n" ]]; then - stage_fail - else - invalid - echo - return 1 - fi - fi - - if [[ "${swapcount}" -gt "1" ]]; then - local prompt="Confirm /Swap Partition" - local stage_prompt="Partition" - sleep 0.3 - RED " - - [!] WARNING: Multiple Linux /Swap Partitions have been detected - - " - NC " - Linux /Swap Partitions: - - ------------------------ -${multi_swap} - ------------------------ - " - YELLOW " - - ### 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}[!] FORMATTED [!] - " - BLUE " - - - > Proceed ? [y/n]" - read -r -p " -==> " autoswap - - if [[ "${autoswap}" == "y" ]]; then - swap_dev="${swap_comply}" - ok - line2 - echo - elif [[ "${autoswap}" == "n" ]]; then - stage_fail - else - invalid - echo - return 1 - fi - fi - local prompt="Installation Disk" if [[ ! -e "${root_dev}" && ! -e "${boot_dev}" ]]; then sanity="no" sleep 0.3 @@ -2660,37 +2475,29 @@ ${multi_swap} return 0 elif [[ -e "${root_dev}" && -e "${boot_dev}" ]]; then sanity="ok" - if [[ "${autoroot}" != "y" ]]; then - sleep 0.3 - NC " + sleep 0.3 + NC " ==> [Linux x86-64 /Root ${green}OK${nc}] " - fi - if [[ "${autoboot}" != "y" ]]; then + sleep 0.3 + NC " + +==> [EFI System Partition ${green}OK${nc}] " + + if [[ -e "${home_dev}" ]]; then sleep 0.3 NC " -==> [EFI System Partition ${green}OK${nc}] " - fi - - if [[ -e "${home_dev}" ]]; then - if [[ "${autohome}" != "y" ]]; then - sleep 0.3 - NC " - ==> [Linux /Home ${green}OK${nc}] " - fi fi if [[ "${swapmode}" == "1" ]]; then if [[ -e "${swap_dev}" ]]; then - if [[ "${autoswap}" != "y" ]]; then - sanity="ok" - sleep 0.3 - NC " + sanity="ok" + sleep 0.3 + NC " ==> [Linux /Swap ${green}OK${nc}] " - fi else sanity="no" sleep 0.3 @@ -2959,28 +2766,6 @@ ${magenta}###${nc}----------------------------------${magenta}[ ${bwhite}Swap P ################################################################################################### set_mode (){ - if [[ "${rootcount}" -gt "1" || "${bootcount}" -gt "1" || "${homecount}" -gt "1" || "${swapcount}" -gt "1" ]]; then - line2 - until auto_mode; do : ; done - sleep 0.3 - NC " - -==> [${green}Filesystems OK${nc}] - " - sleep 0.3 - YELLOW " -###---------------------------------------------[ FILESYSTEM OVERVIEW ]---------------------------------------------### - - " - lsblk -f|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 " - -###-----------------------------------------------------------------------------------------------------------------###" - echo - sleep 1 - return 0 - fi - sleep 0.3 NC " @@ -3038,10 +2823,6 @@ Enter a Mode number: " ################################################################################################### auto_mode (){ - sleep 0.3 - NC " -${magenta}###${nc}----------------------------------------${magenta}[ ${bwhite}Auto Mode${nc} ${magenta}]${nc}----------------------------------------${magenta}###${nc} - " sleep 0.3 YELLOW "