diff --git a/Amelia.sh b/Amelia.sh index 501fc7d..6398a1c 100644 --- a/Amelia.sh +++ b/Amelia.sh @@ -1,7 +1,7 @@ #!/bin/bash # Amelia installer for Archlinux -# Version: 1.4.0 +# Version: 1.4.1 # Source: https://gitlab.com/prism7/archery set -euo pipefail @@ -190,64 +190,64 @@ nvidia() { NC "\n\n\n * ${gfxcard}\n\n" } delete() { - sleep 0.2 - printf "\n\n" - REDBG " ------------------------------------------------------------ " - REDBG " [!] WARNING: All data on selected disk will be destroyed [!] " - REDBG " ------------------------------------------------------------ " + sleep 0.2 + printf "\n\n" + REDBG " ------------------------------------------------------------ " + REDBG " [!] WARNING: All data on selected disk will be destroyed [!] " + REDBG " ------------------------------------------------------------ " } amelia() { sleep 0.2 - CYANBG "************************************************************************************************* " - CYANBG " " - CYANBG " ### Amelia Installer ### " - CYANBG " " - CYANBG "************************************************************************************************* " + CYANBG "************************************************************************************************* " + CYANBG " " + CYANBG " ### Amelia Installer ### " + CYANBG " " + CYANBG "************************************************************************************************* " } banner() { sleep 0.2 echo - BLUEBG "************************************************************************************************* " - BLUEBG " " - BLUEBG " ### Archlinux Installation ### " - BLUEBG " " - BLUEBG "************************************************************************************************* " + BLUEBG "************************************************************************************************* " + BLUEBG " " + BLUEBG " ### Archlinux Installation ### " + BLUEBG " " + BLUEBG "************************************************************************************************* " printf "\n\n" } installing() { sleep 0.2 printf "\n\n\n" - MAGENTABG "------------------------------------------------------------------------------------------------- " - MAGENTABG " ### Installing System ### " - MAGENTABG "------------------------------------------------------------------------------------------------- " + MAGENTABG "------------------------------------------------------------------------------------------------- " + MAGENTABG " ### Installing System ### " + MAGENTABG "------------------------------------------------------------------------------------------------- " printf "\n" } cnfg() { sleep 0.2 printf "\n\n\n" - MAGENTABG "------------------------------------------------------------------------------------------------- " - MAGENTABG " ### Configuring System ### " - MAGENTABG "------------------------------------------------------------------------------------------------- " + MAGENTABG "------------------------------------------------------------------------------------------------- " + MAGENTABG " ### Configuring System ### " + MAGENTABG "------------------------------------------------------------------------------------------------- " NC "\n\n\n ... Please Wait ...\n\n\n" } completion() { sleep 0.2 printf "\n\n\n\n\n" - GREENBG "************************************************************************************************* " - GREENBG " " - GREENBG " ### Installation Completed ### " - GREENBG " " - GREENBG "************************************************************************************************* " + GREENBG "************************************************************************************************* " + GREENBG " " + GREENBG " ### Installation Completed ### " + GREENBG " " + GREENBG "************************************************************************************************* " printf "\n\n\n" } failure() { sleep 0.2 printf "\n\n\n" - REDBG "************************************************************************************************* " - REDBG " " - REDBG " ### Installation Aborted ### " - REDBG " " - REDBG "************************************************************************************************* " + REDBG "************************************************************************************************* " + REDBG " " + REDBG " ### Installation Aborted ### " + REDBG " " + REDBG "************************************************************************************************* " printf "\n\n\n" umount -R /mnt > "${void}" 2>&1 if [[ "${luks_root}" == "ok" || "${luks_swap}" == "ok" || "${luks_home}" == "ok" ]] && [[ "${installation}" != "ok" ]]; then @@ -264,18 +264,17 @@ filesystem_overview() { } disk_overview() { sleep 0.2 - CYAN "\n###${nc}------------------------------------------------${cyan}[ ${bwhite}DISK OVERVIEW ${nc}${cyan}]${nc}------------------------------------------------${cyan}###\n\n" + CYAN "\n\n\n###${nc}------------------------------------------------${cyan}[ ${bwhite}DISK OVERVIEW ${nc}${cyan}]${nc}------------------------------------------------${cyan}###\n\n" fdisk -l "${instl_drive}" | grep -E --color=no 'Dev|dev' |GREP_COLORS='mt=01;36' grep -E --color=always 'EFI System|$'|GREP_COLORS='mt=01;32' grep -E --color=always 'Linux root|$'|GREP_COLORS='mt=01;35' grep -E --color=always 'Linux home|$'|GREP_COLORS='mt=01;33' grep -E --color=always 'Linux swap|$'|GREP_COLORS='mt=01;31' grep -E --color=always 'Linux extended boot|$' CYAN "\n\n###${nc}-----------------------------------------------------------------------------------------------------------------${cyan}###" } multi_info() { sleep 0.2 - CYAN "\n >> ${nc}Multiple ${color}${type} ${nc}Partitions have been detected\n\n" + CYAN "\n >> ${nc}Multiple ${color}${type} ${nc}Partitions have been detected" disk_overview NC "\n ${color}${type} Partitions:${nc}\n\n ${dashline}\n${multi_type}\n ${dashline}\n" YELLOW "\n ### Only the ${nc}1st ${type} ${yellow}partition on a selected disk can be ${nc}auto-assigned ${yellow}as a valid partition${cyan}\n\n\n >> ${nc}Partition ${yellowl}${type_comply} ${nc}is auto-assigned as such and will be ${action}\n" } -# END TUI FUNCTIONS # SYSTEM FUNCTIONS mode_check() { if [[ "${run_as}" == "root" ]]; then @@ -1679,7 +1678,7 @@ systemd_oomd() { invalid return 1 fi - ok + ok } irqbalance() { local prompt="Irqbalance Setup" @@ -1699,7 +1698,7 @@ irqbalance() { invalid return 1 fi - ok + ok } thermald() { local prompt="Thermald Setup" @@ -1719,7 +1718,7 @@ thermald() { invalid return 1 fi - ok + ok } rngd() { local prompt="Rng-tools Setup" @@ -1739,7 +1738,7 @@ rngd() { invalid return 1 fi - ok + ok } rtkit() { local prompt="Rtkit Setup" @@ -1760,7 +1759,7 @@ rtkit() { invalid return 1 fi - ok + ok } tlp() { local prompt="Tlp Setup" @@ -1780,7 +1779,7 @@ tlp() { invalid return 1 fi - ok + ok } dsks_submn() { title "Disk Management" @@ -2338,27 +2337,32 @@ sanity_check() { fi # ATTENTION: MULTI-XBOOTLDR if [[ "${xbootcount}" -gt "1" ]]; then - local color="${redl}" - local type="Linux Extended Boot" - local multi_type="${multi_xboot}" - local type_comply="${xboot_comply}" - local length="${#xboot_dev}" - dashes="$(printf '%*s' "$length" '' | tr ' ' '-')" - local dashline="${nc}${dashes}" - action="${red}[!] ${bwhite}FORMATTED ${nc}${red}[!]" - multi_info - get "Proceed ? [Y/n]" - read -r -p "==> " autoxboot - autoxboot="${autoxboot:-y}" - autoxboot="${autoxboot,,}" - if [[ "${autoxboot}" == "y" ]]; then - xboot_dev="${xboot_comply}" - elif [[ "${autoxboot}" == "n" ]]; then - until auto_part; do : ; done - return 0 - else - y_n - return 1 + espsize="$(lsblk -dno SIZE --bytes "${esp_dev}")" + if [[ -e "${esp_dev}" && "${espsize}" -lt "209715200" ]]; then + if [[ "${bootloader}" == "1" && "${multibooting}" == "y" ]]; then + local color="${redl}" + local type="Linux Extended Boot" + local multi_type="${multi_xboot}" + local type_comply="${xboot_comply}" + local length="${#xboot_dev}" + dashes="$(printf '%*s' "$length" '' | tr ' ' '-')" + local dashline="${nc}${dashes}" + action="${red}[!] ${bwhite}FORMATTED ${nc}${red}[!]" + multi_info + get "Proceed ? [Y/n]" + read -r -p "==> " autoxboot + autoxboot="${autoxboot:-y}" + autoxboot="${autoxboot,,}" + if [[ "${autoxboot}" == "y" ]]; then + xboot_dev="${xboot_comply}" + elif [[ "${autoxboot}" == "n" ]]; then + until auto_part; do : ; done + return 0 + else + y_n + return 1 + fi + fi fi fi # ATTENTION: MULTI-HOME @@ -2421,8 +2425,7 @@ sanity_check() { sleep 0.2 CYAN "\n >> ${yellowl}WARNING: ${nc}/Root's size might not be adequate" sleep 0.2 - CYAN "\n - >> ${nc}Depending on the ${yellowl}size ${nc}of your setup, installation might ${yellowl}fail\n" + CYAN "\n >> ${nc}Depending on the ${yellowl}size ${nc}of your setup, installation might ${yellowl}fail\n" keypress fi if [[ "${autoroot}" == "y" ]]; then @@ -2595,7 +2598,7 @@ sanity_check() { else sanity="ok" fi - # ATTENTION: SANITY CHECK OK + # ATTENTION: SANITY CHECK OK if [[ "${sanity}" == "ok" ]]; then if [[ "${smartpart}" == "y" ]]; then local prompt="Disk ${sgdrive} Smart-Partitioned" @@ -2605,7 +2608,6 @@ sanity_check() { ok fi msg "SANITY CHECK OK" - printf "\n\n" disk_overview get "Proceed using the ${nc}${cyan}current ${blue}partitioning layout ? [Y/n]" read -r -p "==> " partok @@ -3803,6 +3805,7 @@ AUR_NVIDIA_PKGS local stage_prompt="Pacstrap System" stage_fail fi + exec /dev/console 2>&1 if [[ "${fs}" == "2" ]]; then local prompt="Fstab" local stage_prompt="Fstab" @@ -4742,7 +4745,6 @@ CUSTOM_SRVC optimizations secboot_sign } -#END SYSTEM FUNCTIONS nc="\e[0m" red="\e[31m" cyan="\e[36m"