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:
Jane Doe 2024-06-25 18:11:31 +00:00
parent 1cf0a8af43
commit 9cc471af81

103
Amelia.sh
View file

@ -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,42 +2350,6 @@ 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
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 if [[ "${sep_home}" == "y" && "${swapmode}" == "1" ]] ; then
preset="4" preset="4"
elif [[ "${sep_home}" == "y" && "${swapmode}" == "2" ]] ; then elif [[ "${sep_home}" == "y" && "${swapmode}" == "2" ]] ; then
@ -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
@ -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
@ -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
@ -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 "
@ -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}