diff --git a/Amelia.sh b/Amelia.sh index 66a54fd..bb47500 100644 --- a/Amelia.sh +++ b/Amelia.sh @@ -2,7 +2,7 @@ # Amelia Installer # Source: https://gitlab.com/prism7/archery -# Version: 1.0.10 +# Version: 1.0.11 set -euo pipefail ################################################################################################### @@ -220,9 +220,13 @@ stage_ok() { stage_fail() { sleep 0.2 RED " + >> ${bwhite}${stage_prompt} ${nc}${red}FAILED${cyan} - >> ${nc}Check ${yellowl}Amelia.log ${nc}for errors " + + >> ${nc}Check ${yellowl}Amelia.log ${nc}for errors + + " failure } completion_err() { @@ -3993,12 +3997,6 @@ Enter a disk number: " ################################################################################################### sanity_check() { - sleep 0.2 - NC " - -${magenta}###${nc}--------------------------------------${magenta}[ ${bwhite}Sanity Check${nc} ${magenta}]${nc}--------------------------------------${magenta}### - - " 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)" @@ -4024,6 +4022,12 @@ ${magenta}###${nc}--------------------------------------${magenta}[ ${bwhite}San xbootprt="" homeprt="" swapprt="" + sleep 0.2 + NC " + +${magenta}###${nc}--------------------------------------${magenta}[ ${bwhite}Sanity Check${nc} ${magenta}]${nc}--------------------------------------${magenta}### + " + [[ "${rootcount}" == "1" || "${espcount}" == "1" || "${xbootcount}" == "1" || "${homecount}" == "1" || "${swapcount}" == "1" ]] && echo if [[ "${rootcount}" -gt "1" ]]; then local stage_prompt="Selecting Partition" @@ -4049,11 +4053,11 @@ ${multi_root} " YELLOW " - ### Only the 1st Linux x86-64 /Root partition on a selected disk can be auto-assigned as a valid /Root partition + ### Only the ${nc}1st Linux x86-64 /Root ${yellow}partition on a selected disk can be ${nc}auto-assigned ${yellow}as a valid /Root partition${cyan} - > Partition ${nc}${root_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!] - " + >> ${nc}Partition ${yellowl}${root_comply} ${nc}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!] + " BLUE " @@ -4100,15 +4104,15 @@ ${multi_esp} " YELLOW " - ### Only the 1st EFI partition on a selected disk can be auto-assigned as a valid EFI partition + ### Only the ${nc}1st EFI partition${yellow} on a selected disk can be ${nc}auto-assigned ${yellow}as a valid EFI partition " if [[ "${multibooting}" == "n" ]]; then - YELLOW " - > Partition ${nc}${esp_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!] + CYAN " + >> ${nc}Partition ${yellowl}${esp_comply} ${nc}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 + CYAN " + >> ${nc}Partition ${yellowl}${esp_comply} ${nc}is auto-assigned as such and will be used in the installation " fi BLUE " @@ -4156,11 +4160,11 @@ ${multi_xboot} " YELLOW " - ### Only the 1st Linux Extended Boot partition on a selected disk can be auto-assigned as a valid XBOOTLDR partition + ### Only the ${nc}1st Linux Extended Boot ${yellow}partition on a selected disk can be ${nc}auto-assigned ${yellow}as a valid /XBOOTLDR partition${cyan} - > Partition ${nc}${xboot_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!] - " + >> ${nc}Partition ${yellowl}${xboot_comply} ${nc}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!] + " BLUE " @@ -4206,10 +4210,10 @@ ${multi_home} " YELLOW " - ### Only the 1st Linux /Home partition on a selected disk can be auto-assigned as a valid /Home partition + ### Only the ${nc}1st Linux /Home ${yellow}partition on a selected disk can be ${nc}auto-assigned ${yellow}as a valid /Home partition${cyan} - > Partition ${nc}${home_comply} ${yellow}is auto-assigned as such and will be used + >> ${nc}Partition ${yellowl}${home_comply} ${nc}is auto-assigned as such and will be used in the installation " BLUE " @@ -4248,19 +4252,19 @@ ${multi_home} ###${nc}-----------------------------------------------------------------------------------------------------------------${cyan}### " NC " - ${yellowl}Linux /Swap Partitions:${nc} + ${yellowl}Linux /Swap Partitions:${nc} - ------------------------ + ----------------------- ${multi_swap} - ------------------------ + ----------------------- " YELLOW " - ### Only the 1st Linux /Swap partition on a selected disk can be auto-assigned as a valid /Swap partition + ### Only the ${nc}1st Linux /Swap ${yellow}partition on a selected disk can be ${nc}auto-assigned ${yellow}as a valid /Swap partition${cyan} - > Partition ${nc}${swap_comply} ${yellow}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!] - " + >> ${nc}Partition ${yellowl}${swap_comply} ${nc}is auto-assigned as such and will be ${red}[!] ${nc}FORMATTED ${red}[!] + " BLUE " @@ -4891,6 +4895,9 @@ instl() { ################################################################################################### swappart() { + if [[ "${encrypt}" == "yes" ]]; then + line2 + fi local prompt="Swap Partition Creation" local stage_prompt="Swap Partition Creation" sleep 0.2 @@ -5923,20 +5930,21 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}LUKS BLUE " - > Encrypting your ${yellowl}${LuksParts}: + > Encrypting your ${yellowl}${LuksParts}${blue}: + " if echo -n "${CRYPTPASS}" | cryptsetup luksFormat --label CRYPTROOT "${root_dev}" > "${void}"; then if [[ "${rota}" == "0" ]]; then - echo -n "${CRYPTPASS}" | cryptsetup --perf-no_read_workqueue --perf-no_write_workqueue --persistent luksOpen "${root_dev}" CryptArch || err_abort + echo -n "${CRYPTPASS}" | cryptsetup --perf-no_read_workqueue --perf-no_write_workqueue --persistent luksOpen "${root_dev}" CryptRoot || err_abort else - echo -n "${CRYPTPASS}" | cryptsetup luksOpen "${root_dev}" CryptArch || err_abort + echo -n "${CRYPTPASS}" | cryptsetup luksOpen "${root_dev}" CryptRoot || err_abort fi #------------------------------------------------------------------------------------------ if [[ "${fs}" == "1" ]]; then - mkfs.ext4 -F -L Root /dev/mapper/CryptArch > "${void}" 2> "${log}" || err_abort - tune2fs -O fast_commit /dev/mapper/CryptArch > "${void}" 2> "${log}" || err_abort - mount /dev/mapper/CryptArch /mnt > "${void}" 2> "${log}" || err_abort + mkfs.ext4 -F -L CryptRoot /dev/mapper/CryptRoot > "${void}" 2> "${log}" || err_abort + tune2fs -O fast_commit /dev/mapper/CryptRoot > "${void}" 2> "${log}" || err_abort + mount /dev/mapper/CryptRoot /mnt > "${void}" 2> "${log}" || err_abort sleep 0.2 NC " ==> [${green}Encrypted /Root OK${nc}] @@ -5944,8 +5952,8 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}LUKS luks_root="ok" #------------------------------------------------------------------------------------------ elif [[ "${fs}" == "2" ]]; then - mkfs.btrfs -f -L Root /dev/mapper/CryptArch > "${void}" 2> "${log}" || err_abort - mount /dev/mapper/CryptArch /mnt > "${void}" 2> "${log}" || err_abort + mkfs.btrfs -f -L CryptRoot /dev/mapper/CryptRoot > "${void}" 2> "${log}" || err_abort + mount /dev/mapper/CryptRoot /mnt > "${void}" 2> "${log}" || err_abort btrfs subvolume create /mnt/@ > "${void}" 2> "${log}" || err_abort btrfs subvolume create /mnt/@home > "${void}" 2> "${log}" || err_abort btrfs subvolume create /mnt/@cache > "${void}" 2> "${log}" || err_abort @@ -5956,14 +5964,14 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}LUKS btrfs subvolume create /mnt/@swap > "${void}" 2> "${log}" || err_abort fi umount /mnt > "${void}" 2> "${log}" || err_abort - mount -o "${sbvl_mnt_opts}",subvol=@ /dev/mapper/CryptArch /mnt > "${void}" 2> "${log}" || err_abort - mount --mkdir -o "${sbvl_mnt_opts}",subvol=@home /dev/mapper/CryptArch /mnt/home > "${void}" 2> "${log}" || err_abort - mount --mkdir -o "${sbvl_mnt_opts}",subvol=@cache /dev/mapper/CryptArch /mnt/var/cache > "${void}" 2> "${log}" || err_abort - mount --mkdir -o "${sbvl_mnt_opts}",subvol=@log /dev/mapper/CryptArch /mnt/var/log > "${void}" 2> "${log}" || err_abort - mount --mkdir -o "${sbvl_mnt_opts}",subvol=@tmp /dev/mapper/CryptArch /mnt/var/tmp > "${void}" 2> "${log}" || err_abort - mount --mkdir -o "${sbvl_mnt_opts}",subvol=@snapshots /dev/mapper/CryptArch /mnt/"${snapname}" > "${void}" 2> "${log}" || err_abort + mount -o "${sbvl_mnt_opts}",subvol=@ /dev/mapper/CryptRoot /mnt > "${void}" 2> "${log}" || err_abort + mount --mkdir -o "${sbvl_mnt_opts}",subvol=@home /dev/mapper/CryptRoot /mnt/home > "${void}" 2> "${log}" || err_abort + mount --mkdir -o "${sbvl_mnt_opts}",subvol=@cache /dev/mapper/CryptRoot /mnt/var/cache > "${void}" 2> "${log}" || err_abort + mount --mkdir -o "${sbvl_mnt_opts}",subvol=@log /dev/mapper/CryptRoot /mnt/var/log > "${void}" 2> "${log}" || err_abort + mount --mkdir -o "${sbvl_mnt_opts}",subvol=@tmp /dev/mapper/CryptRoot /mnt/var/tmp > "${void}" 2> "${log}" || err_abort + mount --mkdir -o "${sbvl_mnt_opts}",subvol=@snapshots /dev/mapper/CryptRoot /mnt/"${snapname}" > "${void}" 2> "${log}" || err_abort if [[ "${swapmode}" == "2" ]]; then - mount --mkdir -o "${sbvl_mnt_opts}",subvol=@swap /dev/mapper/CryptArch /mnt/swap > "${void}" 2> "${log}" || err_abort + mount --mkdir -o "${sbvl_mnt_opts}",subvol=@swap /dev/mapper/CryptRoot /mnt/swap > "${void}" 2> "${log}" || err_abort fi sleep 0.2 NC " @@ -5982,11 +5990,11 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}LUKS line2 if echo -n "${CRYPTPASS}" | cryptsetup luksFormat --label CRYPTSWAP "${swap_dev}" > "${void}"; then if [[ "${rota}" == "0" ]]; then - echo -n "${CRYPTPASS}" | cryptsetup --perf-no_read_workqueue --perf-no_write_workqueue --persistent luksOpen "${swap_dev}" swap || err_abort + echo -n "${CRYPTPASS}" | cryptsetup --perf-no_read_workqueue --perf-no_write_workqueue --persistent luksOpen "${swap_dev}" CryptSwap || err_abort else - echo -n "${CRYPTPASS}" | cryptsetup luksOpen "${swap_dev}" swap || err_abort + echo -n "${CRYPTPASS}" | cryptsetup luksOpen "${swap_dev}" CryptSwap || err_abort fi - mkswap /dev/mapper/swap > "${void}" 2> "${log}" || err_abort + mkswap /dev/mapper/CryptSwap > "${void}" 2> "${log}" || err_abort sleep 0.2 NC " ==> [${green}Encrypted /Swap OK${nc}] @@ -7183,9 +7191,9 @@ set_vars() { if [[ "${encrypt}" == "yes" ]]; then # Encrypted Root Device - encr_root_dev="/dev/mapper/CryptArch" + encr_root_dev="/dev/mapper/CryptRoot" # Encrypted Root Options - encr_root_opts="rd.luks.name=$(blkid -s UUID -o value "${root_dev}")=CryptArch" + encr_root_opts="rd.luks.name=$(blkid -s UUID -o value "${root_dev}")=CryptRoot" # ATTENTION LUKS ROOT KERNEL CMDLINE @@ -7197,10 +7205,10 @@ set_vars() { # Encrypted Swap Partition if [[ "${swapmode}" == "1" ]]; then # Encrypted Swap Partition Options - encr_swap_opts="rd.luks.name=$(blkid -s UUID -o value "${swap_dev}")=swap" + encr_swap_opts="rd.luks.name=$(blkid -s UUID -o value "${swap_dev}")=CryptSwap" # ATTENTION LUKS SWAP PARTITION KERNEL CMDLINE - encr_swap_bootopts="resume=/dev/mapper/swap ${encr_swap_opts}" + encr_swap_bootopts="resume=/dev/mapper/CryptSwap ${encr_swap_opts}" # Encrypted Swapfile elif [[ "${swapmode}" == "2" ]]; then