mirror of
https://gitlab.com/prism7/archery.git
synced 2025-02-15 08:29:17 +01:00
Change: Reset involved variables when 'Revise' installation has been selected
Change: Refined the circumstances under which the installer is asking to format a detected '/Home' partition
This commit is contained in:
parent
b62037d9cc
commit
9abcec6f38
1 changed files with 106 additions and 49 deletions
155
Amelia.sh
155
Amelia.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Amelia Installer
|
# Amelia Installer
|
||||||
# Version: 6.6
|
# Version: 6.7
|
||||||
|
|
||||||
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
|
||||||
|
@ -827,6 +827,10 @@ Enter a number: "
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
slct_krnl (){
|
slct_krnl (){
|
||||||
|
|
||||||
|
if [[ "${revision}" == "yes" ]]; then
|
||||||
|
kernelnmbr=""
|
||||||
|
fi
|
||||||
|
|
||||||
local prompt="Kernel"
|
local prompt="Kernel"
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
NC "
|
NC "
|
||||||
|
@ -904,6 +908,9 @@ Enter a number: "
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
ask_bootldr (){
|
ask_bootldr (){
|
||||||
|
|
||||||
|
if [[ "${revision}" == "yes" ]]; then
|
||||||
|
bootloader=""
|
||||||
|
fi
|
||||||
local prompt="Bootloader"
|
local prompt="Bootloader"
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
NC "
|
NC "
|
||||||
|
@ -956,6 +963,10 @@ Enter a number: "
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
ask_fs (){
|
ask_fs (){
|
||||||
|
|
||||||
|
if [[ "${revision}" == "yes" ]]; then
|
||||||
|
fs=""
|
||||||
|
sep_home=""
|
||||||
|
fi
|
||||||
local prompt="Filesystem Setup"
|
local prompt="Filesystem Setup"
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
NC "
|
NC "
|
||||||
|
@ -1068,6 +1079,9 @@ Enter a name: "
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
ask_swap (){
|
ask_swap (){
|
||||||
|
|
||||||
|
if [[ "${revision}" == "yes" ]]; then
|
||||||
|
swapmode=""
|
||||||
|
fi
|
||||||
local prompt="Swap Setup"
|
local prompt="Swap Setup"
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
NC "
|
NC "
|
||||||
|
@ -1693,6 +1707,9 @@ Enter [y/n]: "
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
slct_dsktp (){
|
slct_dsktp (){
|
||||||
|
|
||||||
|
if [[ "${revision}" == "yes" ]]; then
|
||||||
|
packages=""
|
||||||
|
fi
|
||||||
local prompt="Desktop Setup"
|
local prompt="Desktop Setup"
|
||||||
custompkgs=""
|
custompkgs=""
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
|
@ -1937,6 +1954,9 @@ cust_sys (){
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
add_pkgs (){
|
add_pkgs (){
|
||||||
|
|
||||||
|
if [[ "${revision}" == "yes" ]]; then
|
||||||
|
custompkgs=""
|
||||||
|
fi
|
||||||
local prompt="Add Packages"
|
local prompt="Add Packages"
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
NC "
|
NC "
|
||||||
|
@ -2016,6 +2036,9 @@ Enter a number: "
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
add_services (){
|
add_services (){
|
||||||
|
|
||||||
|
if [[ "${revision}" == "yes" ]]; then
|
||||||
|
customservices=""
|
||||||
|
fi
|
||||||
local prompt="Add Services"
|
local prompt="Add Services"
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
NC "
|
NC "
|
||||||
|
@ -2044,6 +2067,9 @@ Enter services to be enabled ${bwhite}(space-seperated)${blue}: "
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
add_prmtrs (){
|
add_prmtrs (){
|
||||||
|
|
||||||
|
if [[ "${revision}" == "yes" ]]; then
|
||||||
|
cust_bootopts=""
|
||||||
|
fi
|
||||||
local prompt="Kernel Parameters"
|
local prompt="Kernel Parameters"
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
NC "
|
NC "
|
||||||
|
@ -2131,6 +2157,9 @@ Enter a${nc} ${cyan}BootOrder${blue} number for Deletion ${bwhite}(empty to skip
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
wireless_rgd (){
|
wireless_rgd (){
|
||||||
|
|
||||||
|
if [[ "${revision}" == "yes" ]]; then
|
||||||
|
REGDOM=""
|
||||||
|
fi
|
||||||
local prompt="Wireless Regdom Setup"
|
local prompt="Wireless Regdom Setup"
|
||||||
hypervisor="$(systemd-detect-virt)"
|
hypervisor="$(systemd-detect-virt)"
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
|
@ -2332,6 +2361,10 @@ Enter a number: "
|
||||||
}
|
}
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
man_preset (){
|
man_preset (){
|
||||||
|
|
||||||
|
if [[ "${revision}" == "yes" ]]; then
|
||||||
|
preset=""
|
||||||
|
fi
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
NC "
|
NC "
|
||||||
|
|
||||||
|
@ -2366,6 +2399,9 @@ Enter a Preset number ${bwhite}(empty to skip)${blue}: "
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
auto_part (){
|
auto_part (){
|
||||||
|
|
||||||
|
if [[ "${revision}" == "yes" ]]; then
|
||||||
|
smartpart=""
|
||||||
|
fi
|
||||||
local prompt="Disk Partitions"
|
local prompt="Disk Partitions"
|
||||||
local stage_prompt="Auto-Partitioning"
|
local stage_prompt="Auto-Partitioning"
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
|
@ -3582,35 +3618,49 @@ ${magenta}###${nc}----------------------------------------${magenta}[ ${bwhite}A
|
||||||
fi
|
fi
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
#--------------------------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------------------------
|
||||||
if [[ ${fs} == "1" && -e "${home_dev}" && "${sep_home}" == "y" ]]; then
|
if [[ ${fs} == "1" ]]; then
|
||||||
|
if [[ -e "${home_dev}" ]]; then
|
||||||
|
if [[ "${sep_home}" == "y" ]]; then
|
||||||
|
if [[ "${smartpart}" == "y" ]]; then
|
||||||
|
homeform="y"
|
||||||
|
elif [[ "${preset}" == "3" ]]; then
|
||||||
|
homeform="y"
|
||||||
|
elif [[ "${preset}" == "4" ]]; then
|
||||||
|
homeform="y"
|
||||||
|
elif [[ -z "${smartpart}" ]] || [[ -z "${preset}" ]]; 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}${fsname}${blue} ? [y/n]
|
||||||
|
|
||||||
"
|
"
|
||||||
read -r -p "
|
read -r -p "
|
||||||
==> " homeform
|
==> " homeform
|
||||||
|
echo
|
||||||
if [[ "${homeform}" == "y" ]]; then
|
fi
|
||||||
if mkfs.ext4 -F -L Home "${home_dev}" > /dev/null 2>&1 ; then
|
|
||||||
mount --mkdir "${home_dev}" /mnt/home > /dev/null 2>&1 || err_abort
|
if [[ "${homeform}" == "y" ]]; then
|
||||||
sleep 0.3
|
if mkfs.ext4 -F -L Home "${home_dev}" > /dev/null 2>&1 ; then
|
||||||
NC "
|
mount --mkdir "${home_dev}" /mnt/home > /dev/null 2>&1 || err_abort
|
||||||
|
sleep 0.3
|
||||||
|
NC "
|
||||||
==> [${green}/Home OK${nc}]
|
==> [${green}/Home OK${nc}]
|
||||||
"
|
"
|
||||||
else
|
else
|
||||||
umount_manual
|
umount_manual
|
||||||
until disk_mngr; do : ; done
|
until disk_mngr; do : ; done
|
||||||
until form_home; do : ; done
|
until form_home; do : ; done
|
||||||
until mount_mnt; do : ; done
|
until mount_mnt; do : ; done
|
||||||
until mount_boot; do : ; done
|
until mount_boot; do : ; done
|
||||||
until mount_home; do : ; done
|
until mount_home; do : ; done
|
||||||
|
fi
|
||||||
|
elif [[ "${homeform}" == "n" ]]; then
|
||||||
|
skip
|
||||||
|
else
|
||||||
|
invalid
|
||||||
|
until ask_homepart_form; do : ; done
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
elif [[ "${homeform}" == "n" ]]; then
|
|
||||||
skip
|
|
||||||
else
|
|
||||||
invalid
|
|
||||||
until ask_homepart_form; do : ; done
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -3814,42 +3864,49 @@ Enter a name ${bwhite}(empty to skip and proceed)${blue}: "
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
ask_homepart_form (){
|
ask_homepart_form (){
|
||||||
|
|
||||||
if [[ -e "${home_dev}" && "${sep_home}" == "y" ]]; then
|
if [[ ${fs} == "1" ]]; then
|
||||||
|
if [[ -e "${home_dev}" ]]; then
|
||||||
|
if [[ "${sep_home}" == "y" ]]; then
|
||||||
|
if [[ "${smartpart}" == "y" ]]; then
|
||||||
|
homeform="y"
|
||||||
|
elif [[ "${preset}" == "3" ]]; then
|
||||||
|
homeform="y"
|
||||||
|
elif [[ "${preset}" == "4" ]]; then
|
||||||
|
homeform="y"
|
||||||
|
elif [[ -z "${smartpart}" ]] || [[ -z "${preset}" ]]; then
|
||||||
BLUE "
|
BLUE "
|
||||||
|
|
||||||
|
|
||||||
|
> A${nc} ${cyan}/Home ${blue}partition has been detected. Format as ${nc}${fsname}${blue} ? [y/n]
|
||||||
> A${nc} ${cyan}/Home ${blue}Partition has been detected. Format as${nc} ${cyan}${fsname}${blue}? [y/n]
|
|
||||||
|
|
||||||
|
|
||||||
"
|
"
|
||||||
read -r -p "
|
read -r -p "
|
||||||
==> " homeform
|
==> " homeform
|
||||||
echo
|
echo
|
||||||
|
fi
|
||||||
if [[ "${homeform}" == "y" ]]; then
|
|
||||||
if mkfs.ext4 -F -L Home "${home_dev}" > /dev/null 2>&1 ; then
|
if [[ "${homeform}" == "y" ]]; then
|
||||||
mount --mkdir "${home_dev}" /mnt/home > /dev/null 2>&1 || err_abort
|
if mkfs.ext4 -F -L Home "${home_dev}" > /dev/null 2>&1 ; then
|
||||||
sleep 0.3
|
mount --mkdir "${home_dev}" /mnt/home > /dev/null 2>&1 || err_abort
|
||||||
NC "
|
sleep 0.3
|
||||||
|
NC "
|
||||||
==> [${green}/Home OK${nc}]
|
==> [${green}/Home OK${nc}]
|
||||||
|
"
|
||||||
"
|
else
|
||||||
else
|
umount_manual
|
||||||
umount_manual
|
until disk_mngr; do : ; done
|
||||||
until disk_mngr; do : ; done
|
until form_home; do : ; done
|
||||||
until form_home; do : ; done
|
until mount_mnt; do : ; done
|
||||||
until mount_mnt; do : ; done
|
until mount_boot; do : ; done
|
||||||
until mount_boot; do : ; done
|
until mount_home; do : ; done
|
||||||
until mount_home; do : ; done
|
fi
|
||||||
|
elif [[ "${homeform}" == "n" ]]; then
|
||||||
|
skip
|
||||||
|
else
|
||||||
|
invalid
|
||||||
|
until ask_homepart_form; do : ; done
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
elif [[ "${homeform}" == "n" ]]; then
|
|
||||||
skip
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
invalid
|
|
||||||
until ask_homepart_form; do : ; done
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -4321,7 +4378,7 @@ ${magenta}###${nc}-------------------------------------${magenta}[ ${bwhite}LUKS
|
||||||
elif [[ "${homecrypt}" == "no" ]]; then
|
elif [[ "${homecrypt}" == "no" ]]; 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} ${fsname}${blue}? [y/n]
|
||||||
|
|
||||||
"
|
"
|
||||||
read -r -p "
|
read -r -p "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue