From 9cc471af811533888344abacab2cf23bc0086fe3 Mon Sep 17 00:00:00 2001 From: Jane Doe Date: Tue, 25 Jun 2024 18:11:31 +0000 Subject: [PATCH] Change: 'Filesystem Selection' > 'Ext4' > Now the installer offers to create/use a separate '/Home' partition if desired Change: 'Sanity Check' stage : Now the installer asks for action if more than 1 partitions of type 'Linux /Home' are found ONLY if the user has previously selected 'Ext4' as filesystem and use of a separate /Home partition Change: 'Sanity Check' stage : Now the installer asks for action if more than 1 partitions of type 'Linux /Swap' are found ONLY if the user has previously selected use of a /Swap partition Change: 'Encryption Setup' stage : Now if a partition of type 'Linux /Home' is detected, the installer offers to encrypt it ONLY if the user has previously selected 'Ext4' as filesystem and use of a separate /Home partition Change: 'Confirm Installation Status' > 'Revise Installation' > The 'Partition Manager' stage has been removed, as the installer can now automatically deal with the partitions layout it is presented with. Change: The '--graceful' flag has been removed from the options, when installing 'systemd-boot' Minor indentation --- Amelia.sh | 159 ++++++++++++++++++++++++++---------------------------- 1 file changed, 75 insertions(+), 84 deletions(-) diff --git a/Amelia.sh b/Amelia.sh index f5e1d00..ebb2f76 100644 --- a/Amelia.sh +++ b/Amelia.sh @@ -1,7 +1,7 @@ #!/bin/bash # Amelia Installer -# Version: 5.9 +# Version: 6.0 set -euo pipefail trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR @@ -967,8 +967,42 @@ Enter a number: " roottype="/Root" sleep 0.3 YELLOW " - ### ${fsname} has been selected - " ;; + ### NOTE: Keeping User Data on a separate /Home Partition is supported + + + > Make use of a dedicated /Home Partition ? [y/n] " + BLUE " + + +Enter [y/n]: " + read -r -p " +==> " sep_home + + case "${sep_home}" in + y) + sleep 0.3 + YELLOW " + + ### A /Home Partition will be created + ";; + n) + echo + skip + echo;; + "") + sleep 0.3 + echo + RED " + [!] Please type 'y' or 'n' to continue.. " + reload + return 1 ;; + *) + invalid + return 1 ;; + esac + sleep 0.3 + YELLOW " + ### ${fsname} has been selected " ;; 2) fsname="Btrfs" fs_mod="btrfs" @@ -977,8 +1011,7 @@ Enter a number: " btrfs_bootopts="rootflags=subvol=@ " sleep 0.3 YELLOW " - ### ${fsname} has been selected - " + ### ${fsname} has been selected " sleep 0.3 YELLOW " @@ -2317,51 +2350,15 @@ Enter a disk number ${bwhite}(empty to skip)${blue}: " elif [[ "${fs}" == "2" && "${swapmode}" == "2" ]] ; then preset="1" elif [[ "${fs}" == "1" ]] ; then - sleep 0.3 - YELLOW " - - ### NOTE: Creation of a separate /Home Partition is supported - - - > Create a separate /Home Partition ? [y/n] " - BLUE " - - -Enter [y/n]: " - read -r -p " -==> " sep_home - - case "${sep_home}" in - y) - sleep 0.3 - YELLOW " - - - ### A separate /Home Partition will be created - ";; - n) - echo - skip ;; - "") - sleep 0.3 - echo - RED " - [!] Please type 'y' or 'n' to continue.. " - reload - return 1 ;; - *) - invalid - return 1 ;; - esac - if [[ "${sep_home}" == "y" && "${swapmode}" == "1" ]] ; then - preset="4" - elif [[ "${sep_home}" == "y" && "${swapmode}" == "2" ]] ; then - preset="3" - elif [[ "${sep_home}" == "n" && "${swapmode}" == "1" ]] ; then - preset="2" - elif [[ "${sep_home}" == "n" && "${swapmode}" == "2" ]] ; then - preset="1" - fi + if [[ "${sep_home}" == "y" && "${swapmode}" == "1" ]] ; then + preset="4" + elif [[ "${sep_home}" == "y" && "${swapmode}" == "2" ]] ; then + preset="3" + elif [[ "${sep_home}" == "n" && "${swapmode}" == "1" ]] ; then + preset="2" + elif [[ "${sep_home}" == "n" && "${swapmode}" == "2" ]] ; then + preset="1" + fi else YELLOW " @@ -2673,7 +2670,6 @@ ${multi_root} root_dev="${root_comply}" multiroot_opts="root=PARTUUID=$(blkid -s PARTUUID -o value "${root_dev}") " ok - line2 elif [[ "${autoroot}" == "n" ]]; then stage_fail else @@ -2698,7 +2694,7 @@ ${multi_root} " 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 " + YELLOW " ###-----------------------------------------------------------------------------------------------------------------###" NC " @@ -2728,7 +2724,7 @@ ${multi_boot} if [[ "${bootsize}" -lt "209715200" ]]; then sanity="no" sleep 0.3 - RED " + RED " [!] WARNING: EFI Partition's size is not adequate. Create a ${nc}200M ${red}EFI Partition at minimum " sleep 3 @@ -2742,7 +2738,6 @@ ${multi_boot} return 0 else ok - line2 fi elif [[ "${autoboot}" == "n" ]]; then stage_fail @@ -2753,7 +2748,7 @@ ${multi_boot} fi fi - if [[ ${fs} == "1" && "${homecount}" -gt "1" ]]; then + if [[ ${fs} == "1" && ${sep_home} == "y" && "${homecount}" -gt "1" ]]; then local prompt="Confirm /Home Partition" local stage_prompt="Partition" sleep 0.3 @@ -2795,7 +2790,6 @@ ${multi_home} if [[ "${autohome}" == "y" ]]; then home_dev="${home_comply}" ok - line2 elif [[ "${autohome}" == "n" ]]; then stage_fail else @@ -2820,7 +2814,7 @@ ${multi_home} " 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 " + YELLOW " ###-----------------------------------------------------------------------------------------------------------------###" NC " @@ -2847,8 +2841,6 @@ ${multi_swap} if [[ "${autoswap}" == "y" ]]; then swap_dev="${swap_comply}" ok - line2 - echo elif [[ "${autoswap}" == "n" ]]; then stage_fail else @@ -2891,7 +2883,7 @@ ${multi_swap} if [[ "${bootsize}" -lt "209715200" ]]; then sanity="no" sleep 0.3 - RED " + RED " [!] WARNING: EFI Partition's size is not adequate. Create a ${nc}200M ${red}EFI Partition at minimum " sleep 3 @@ -2955,7 +2947,7 @@ ${multi_swap} if [[ "${bootsize}" -lt "209715200" ]]; then sanity="no" sleep 0.3 - RED " + RED " [!] WARNING: EFI Partition's size is not adequate. Create a ${nc}200M ${red}EFI Partition at minimum " sleep 3 @@ -3089,7 +3081,7 @@ Enter a name: " fi if [[ -e "${home_dev}" ]]; then - if [[ "${fs}" == "1" ]]; then + if [[ "${sep_home}" == "y" ]]; then sleep 0.3 YELLOW " @@ -3265,27 +3257,27 @@ ${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 " + 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 " + " + 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 " + YELLOW " ###-----------------------------------------------------------------------------------------------------------------###" - echo - sleep 1 - return 0 - fi + echo + sleep 1 + return 0 + fi sleep 0.3 NC " @@ -3423,7 +3415,7 @@ ${magenta}###${nc}----------------------------------------${magenta}[ ${bwhite}A fi sleep 0.3 #-------------------------------------------------------------------------------------------------- - if [[ -e "${home_dev}" && "${fs}" == "1" ]]; then + if [[ -e "${home_dev}" && "${sep_home}" == "y" ]]; then BLUE " > A${nc} ${cyan}/Home ${blue}partition has been detected. Format as${nc} ${cyan}${fsname}${blue}? [y/n] @@ -3460,7 +3452,7 @@ ${magenta}###${nc}----------------------------------------${magenta}[ ${bwhite}A ################################################################################################### manual_mode (){ - if [[ -e "${home_dev}" ]]; then + if [[ -e "${home_dev}" && "${sep_home}" == "y" ]]; then if [[ "${fs}" == "1" ]]; then until form_efi; do : ; done until form_root; do : ; done @@ -3498,7 +3490,7 @@ ${magenta}###${nc}----------------------------------${magenta}[ ${bwhite}Format while [[ -n "${form_boot_nmbr}" ]]; do YELLOW " - > Select a partition to format as EFI [/Boot] " + > Select a partition to format as ESP [/Boot] " NC " ${volumes}" @@ -3659,7 +3651,7 @@ Enter a name ${bwhite}(empty to skip and proceed)${blue}: " ################################################################################################### ask_homepart_form (){ - if [[ -e "${home_dev}" && "${fs}" == "1" ]]; then + if [[ -e "${home_dev}" && "${sep_home}" == "y" ]]; then BLUE " @@ -3991,7 +3983,6 @@ revise (){ until slct_dsktp; do : ; done until boot_entr; do : ; done until wireless_rgd; do : ; done - until disk_mngr; do : ; done until instl_dsk; do : ; done until ask_crypt; do : ; done if [[ "${swapmode}" == "1" ]]; then @@ -4771,7 +4762,7 @@ SLICK cnfg stage_prompt="Systemd-boot" if arch-chroot /mnt <<-BOOTCTL > /dev/null 2>&1 ; then - bootctl install --graceful || exit + bootctl install || exit echo "default arch.conf" > /boot/loader/loader.conf || exit echo " title ${entrname} @@ -5061,7 +5052,7 @@ NRG country=${REGDOM} wps_cred_add_sae=1 pmf=2" | tee /etc/wpa_supplicant/wpa_supplicant.conf || exit - bootctl install --graceful || exit + bootctl install || exit echo "default arch.conf" > /boot/loader/loader.conf || exit echo " title ${entrname} @@ -5175,7 +5166,7 @@ SLICK cnfg stage_prompt="Systemd-boot" if arch-chroot /mnt <<-BOOTCTL > /dev/null 2>&1 ; then - bootctl install --graceful || exit + bootctl install || exit echo "default arch.conf" > /boot/loader/loader.conf || exit echo " title ${entrname}