mirror of
				https://gitlab.com/prism7/archery.git
				synced 2025-02-15 08:29:17 +01:00 
			
		
		
		
	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
This commit is contained in:
		
							
								
								
									
										159
									
								
								Amelia.sh
									
									
									
									
									
								
							
							
						
						
									
										159
									
								
								Amelia.sh
									
									
									
									
									
								
							| @@ -1,7 +1,7 @@ | |||||||
| #!/bin/bash | #!/bin/bash | ||||||
|  |  | ||||||
| # Amelia Installer | # Amelia Installer | ||||||
| # Version: 5.9 | # Version: 6.0 | ||||||
|  |  | ||||||
| set -euo pipefail | set -euo pipefail | ||||||
| trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR | trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR | ||||||
| @@ -967,8 +967,42 @@ Enter a number: " | |||||||
|             roottype="/Root" |             roottype="/Root" | ||||||
|             sleep 0.3 |             sleep 0.3 | ||||||
|             YELLOW " |             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) |         2) | ||||||
|             fsname="Btrfs" |             fsname="Btrfs" | ||||||
|             fs_mod="btrfs" |             fs_mod="btrfs" | ||||||
| @@ -977,8 +1011,7 @@ Enter a number: " | |||||||
|             btrfs_bootopts="rootflags=subvol=@ " |             btrfs_bootopts="rootflags=subvol=@ " | ||||||
|             sleep 0.3 |             sleep 0.3 | ||||||
|             YELLOW " |             YELLOW " | ||||||
|         ###  ${fsname} has been selected |         ###  ${fsname} has been selected " | ||||||
|             " |  | ||||||
|             sleep 0.3 |             sleep 0.3 | ||||||
|             YELLOW " |             YELLOW " | ||||||
|  |  | ||||||
| @@ -2317,51 +2350,15 @@ Enter a disk number ${bwhite}(empty to skip)${blue}: " | |||||||
|                 elif [[ "${fs}" == "2" && "${swapmode}" == "2" ]] ; then |                 elif [[ "${fs}" == "2" && "${swapmode}" == "2" ]] ; then | ||||||
|                     preset="1" |                     preset="1" | ||||||
|                 elif [[ "${fs}" == "1" ]] ; then |                 elif [[ "${fs}" == "1" ]] ; then | ||||||
|                     sleep 0.3 |                     if [[ "${sep_home}" == "y" && "${swapmode}" == "1" ]] ; then | ||||||
|                     YELLOW " |                         preset="4" | ||||||
|  |                     elif [[ "${sep_home}" == "y" && "${swapmode}" == "2" ]] ; then | ||||||
|         ###  NOTE: Creation of a separate /Home Partition is supported |                         preset="3" | ||||||
|  |                     elif [[ "${sep_home}" == "n" && "${swapmode}" == "1" ]] ; then | ||||||
|  |                         preset="2" | ||||||
|         >  Create a separate /Home Partition ? [y/n] " |                     elif [[ "${sep_home}" == "n" && "${swapmode}" == "2" ]] ; then | ||||||
|                     BLUE " |                         preset="1" | ||||||
|  |                     fi | ||||||
|  |  | ||||||
| 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 |  | ||||||
|                 else |                 else | ||||||
|         YELLOW " |         YELLOW " | ||||||
|  |  | ||||||
| @@ -2673,7 +2670,6 @@ ${multi_root} | |||||||
|             root_dev="${root_comply}" |             root_dev="${root_comply}" | ||||||
|             multiroot_opts="root=PARTUUID=$(blkid -s PARTUUID -o value "${root_dev}") " |             multiroot_opts="root=PARTUUID=$(blkid -s PARTUUID -o value "${root_dev}") " | ||||||
|             ok |             ok | ||||||
|             line2 |  | ||||||
|         elif [[ "${autoroot}" == "n" ]]; then |         elif [[ "${autoroot}" == "n" ]]; then | ||||||
|             stage_fail |             stage_fail | ||||||
|         else |         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|$' |         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 " |         NC " | ||||||
| @@ -2728,7 +2724,7 @@ ${multi_boot} | |||||||
|             if [[ "${bootsize}" -lt "209715200" ]]; then |             if [[ "${bootsize}" -lt "209715200" ]]; then | ||||||
|                 sanity="no" |                 sanity="no" | ||||||
|                 sleep 0.3 |                 sleep 0.3 | ||||||
|         RED " |                 RED " | ||||||
|  |  | ||||||
|         [!] WARNING: EFI Partition's size is not adequate. Create a ${nc}200M ${red}EFI Partition at minimum " |         [!] WARNING: EFI Partition's size is not adequate. Create a ${nc}200M ${red}EFI Partition at minimum " | ||||||
|                 sleep 3 |                 sleep 3 | ||||||
| @@ -2742,7 +2738,6 @@ ${multi_boot} | |||||||
|                 return 0 |                 return 0 | ||||||
|             else |             else | ||||||
|                 ok |                 ok | ||||||
|                 line2 |  | ||||||
|             fi |             fi | ||||||
|         elif [[ "${autoboot}" == "n" ]]; then |         elif [[ "${autoboot}" == "n" ]]; then | ||||||
|             stage_fail |             stage_fail | ||||||
| @@ -2753,7 +2748,7 @@ ${multi_boot} | |||||||
|         fi |         fi | ||||||
|     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 prompt="Confirm /Home Partition" | ||||||
|         local stage_prompt="Partition" |         local stage_prompt="Partition" | ||||||
|         sleep 0.3 |         sleep 0.3 | ||||||
| @@ -2795,7 +2790,6 @@ ${multi_home} | |||||||
|         if [[ "${autohome}" == "y" ]]; then |         if [[ "${autohome}" == "y" ]]; then | ||||||
|             home_dev="${home_comply}" |             home_dev="${home_comply}" | ||||||
|             ok |             ok | ||||||
|             line2 |  | ||||||
|         elif [[ "${autohome}" == "n" ]]; then |         elif [[ "${autohome}" == "n" ]]; then | ||||||
|             stage_fail |             stage_fail | ||||||
|         else |         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|$' |         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 " |         NC " | ||||||
| @@ -2847,8 +2841,6 @@ ${multi_swap} | |||||||
|         if [[ "${autoswap}" == "y" ]]; then |         if [[ "${autoswap}" == "y" ]]; then | ||||||
|             swap_dev="${swap_comply}" |             swap_dev="${swap_comply}" | ||||||
|             ok |             ok | ||||||
|             line2 |  | ||||||
|             echo |  | ||||||
|         elif [[ "${autoswap}" == "n" ]]; then |         elif [[ "${autoswap}" == "n" ]]; then | ||||||
|             stage_fail |             stage_fail | ||||||
|         else |         else | ||||||
| @@ -2891,7 +2883,7 @@ ${multi_swap} | |||||||
|         if [[ "${bootsize}" -lt "209715200" ]]; then |         if [[ "${bootsize}" -lt "209715200" ]]; then | ||||||
|             sanity="no" |             sanity="no" | ||||||
|             sleep 0.3 |             sleep 0.3 | ||||||
|         RED " |             RED " | ||||||
|  |  | ||||||
|         [!] WARNING: EFI Partition's size is not adequate. Create a ${nc}200M ${red}EFI Partition at minimum " |         [!] WARNING: EFI Partition's size is not adequate. Create a ${nc}200M ${red}EFI Partition at minimum " | ||||||
|             sleep 3 |             sleep 3 | ||||||
| @@ -2955,7 +2947,7 @@ ${multi_swap} | |||||||
|         if [[ "${bootsize}" -lt "209715200" ]]; then |         if [[ "${bootsize}" -lt "209715200" ]]; then | ||||||
|             sanity="no" |             sanity="no" | ||||||
|             sleep 0.3 |             sleep 0.3 | ||||||
|         RED " |             RED " | ||||||
|  |  | ||||||
|         [!] WARNING: EFI Partition's size is not adequate. Create a ${nc}200M ${red}EFI Partition at minimum " |         [!] WARNING: EFI Partition's size is not adequate. Create a ${nc}200M ${red}EFI Partition at minimum " | ||||||
|             sleep 3 |             sleep 3 | ||||||
| @@ -3089,7 +3081,7 @@ Enter a name: " | |||||||
|         fi |         fi | ||||||
|  |  | ||||||
|         if [[ -e "${home_dev}" ]]; then |         if [[ -e "${home_dev}" ]]; then | ||||||
|             if [[ "${fs}" == "1" ]]; then |             if [[ "${sep_home}" == "y" ]]; then | ||||||
|                 sleep 0.3 |                 sleep 0.3 | ||||||
|                 YELLOW " |                 YELLOW " | ||||||
|  |  | ||||||
| @@ -3265,27 +3257,27 @@ ${magenta}###${nc}----------------------------------${magenta}[ ${bwhite}Swap  P | |||||||
| ################################################################################################### | ################################################################################################### | ||||||
| set_mode (){ | set_mode (){ | ||||||
|  |  | ||||||
|             if [[ "${rootcount}" -gt "1" || "${bootcount}" -gt "1" || "${homecount}" -gt "1" || "${swapcount}" -gt "1" ]]; then |     if [[ "${rootcount}" -gt "1" || "${bootcount}" -gt "1" || "${homecount}" -gt "1" || "${swapcount}" -gt "1" ]]; then | ||||||
|                 line2 |         line2 | ||||||
|                 until auto_mode; do : ; done |         until auto_mode; do : ; done | ||||||
|                 sleep 0.3 |         sleep 0.3 | ||||||
|                 NC " |         NC " | ||||||
|  |  | ||||||
| ==> [${green}Filesystems OK${nc}] | ==> [${green}Filesystems OK${nc}] | ||||||
|                 " |         " | ||||||
|                 sleep 0.3 |         sleep 0.3 | ||||||
|                 YELLOW " |         YELLOW " | ||||||
| ###---------------------------------------------[ FILESYSTEM OVERVIEW ]---------------------------------------------### | ###---------------------------------------------[ 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|$' |         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 |         echo | ||||||
|                 sleep 1 |         sleep 1 | ||||||
|                 return 0 |         return 0 | ||||||
|             fi |     fi | ||||||
|  |  | ||||||
|         sleep 0.3 |         sleep 0.3 | ||||||
|         NC " |         NC " | ||||||
| @@ -3423,7 +3415,7 @@ ${magenta}###${nc}----------------------------------------${magenta}[ ${bwhite}A | |||||||
|         fi |         fi | ||||||
|             sleep 0.3 |             sleep 0.3 | ||||||
| #-------------------------------------------------------------------------------------------------- | #-------------------------------------------------------------------------------------------------- | ||||||
|     if [[ -e "${home_dev}" && "${fs}" == "1" ]]; then |     if [[ -e "${home_dev}" && "${sep_home}" == "y" ]]; then | ||||||
|         BLUE " |         BLUE " | ||||||
|  |  | ||||||
|         >  A${nc} ${cyan}/Home ${blue}partition has been detected. Format as${nc} ${cyan}${fsname}${blue}? [y/n] |         >  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 (){ | manual_mode (){ | ||||||
|  |  | ||||||
|     if [[ -e "${home_dev}" ]]; then |     if [[ -e "${home_dev}" && "${sep_home}" == "y" ]]; then | ||||||
|         if [[ "${fs}" == "1" ]]; then |         if [[ "${fs}" == "1" ]]; then | ||||||
|             until form_efi; do : ; done |             until form_efi; do : ; done | ||||||
|             until form_root; do : ; done |             until form_root; do : ; done | ||||||
| @@ -3498,7 +3490,7 @@ ${magenta}###${nc}----------------------------------${magenta}[ ${bwhite}Format | |||||||
|     while [[ -n "${form_boot_nmbr}" ]]; do |     while [[ -n "${form_boot_nmbr}" ]]; do | ||||||
|         YELLOW " |         YELLOW " | ||||||
|  |  | ||||||
|         >  Select a partition to format as EFI [/Boot] " |         >  Select a partition to format as ESP [/Boot] " | ||||||
|         NC " |         NC " | ||||||
|  |  | ||||||
| ${volumes}" | ${volumes}" | ||||||
| @@ -3659,7 +3651,7 @@ Enter a name ${bwhite}(empty to skip and proceed)${blue}: " | |||||||
| ################################################################################################### | ################################################################################################### | ||||||
| ask_homepart_form (){ | ask_homepart_form (){ | ||||||
|  |  | ||||||
|     if [[ -e "${home_dev}" && "${fs}" == "1" ]]; then |     if [[ -e "${home_dev}" && "${sep_home}" == "y" ]]; then | ||||||
|         BLUE " |         BLUE " | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -3991,7 +3983,6 @@ revise (){ | |||||||
|         until slct_dsktp; do : ; done |         until slct_dsktp; do : ; done | ||||||
|         until boot_entr; do : ; done |         until boot_entr; do : ; done | ||||||
|         until wireless_rgd; do : ; done |         until wireless_rgd; do : ; done | ||||||
|         until disk_mngr; do : ; done |  | ||||||
|         until instl_dsk; do : ; done |         until instl_dsk; do : ; done | ||||||
|         until ask_crypt; do : ; done |         until ask_crypt; do : ; done | ||||||
|         if [[ "${swapmode}" == "1" ]]; then  |         if [[ "${swapmode}" == "1" ]]; then  | ||||||
| @@ -4771,7 +4762,7 @@ SLICK | |||||||
|             cnfg |             cnfg | ||||||
|             stage_prompt="Systemd-boot" |             stage_prompt="Systemd-boot" | ||||||
|             if arch-chroot /mnt <<-BOOTCTL > /dev/null 2>&1 ; then |             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 "default arch.conf" > /boot/loader/loader.conf || exit | ||||||
|                 echo " |                 echo " | ||||||
|                 title ${entrname} |                 title ${entrname} | ||||||
| @@ -5061,7 +5052,7 @@ NRG | |||||||
|             country=${REGDOM} |             country=${REGDOM} | ||||||
|             wps_cred_add_sae=1 |             wps_cred_add_sae=1 | ||||||
|             pmf=2" | tee /etc/wpa_supplicant/wpa_supplicant.conf || exit |             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 "default arch.conf" > /boot/loader/loader.conf || exit | ||||||
|             echo " |             echo " | ||||||
|             title ${entrname} |             title ${entrname} | ||||||
| @@ -5175,7 +5166,7 @@ SLICK | |||||||
|             cnfg |             cnfg | ||||||
|             stage_prompt="Systemd-boot" |             stage_prompt="Systemd-boot" | ||||||
|             if arch-chroot /mnt <<-BOOTCTL > /dev/null 2>&1 ; then |             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 "default arch.conf" > /boot/loader/loader.conf || exit | ||||||
|                 echo " |                 echo " | ||||||
|                 title ${entrname} |                 title ${entrname} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user