updated btrfs

This commit is contained in:
mfgbhatti 2022-01-28 13:51:10 +00:00
parent 2a446bfd44
commit 22fe1c653d
1 changed files with 30 additions and 21 deletions

View File

@ -76,6 +76,27 @@ efi_check () {
fi fi
} }
# if btrfs is selected
set_btrfs () {
# Used -a to get more than one argument
echo -ne "Please enter your btrfs subvolumes separated by space\n"
echo -ne "usualy they start with @ for root or @home, @temp etc.\n"
echo -ne "Defaults are @, @home, @var, @tmp, @.snapshots \n"
read -r -p "press enter to use default: " -a ARR
if [[ -z "${ARR[*]}" ]]; then
set_option "SUBVOLUMES" "(@ @home @var @tmp @.snapshots)"
else
# An array is a list of values.
NAMES=()
for i in "${ARR[@]}"; do
# push values to array
NAMES+=("$i")
done
# Set to config file
set_option "SUBVOLUMES" "(${NAMES[*]})"
fi
}
# Check if an element exists # Check if an element exists
elements_present() { elements_present() {
for e in "${@:2}"; do [[ "$e" == "$1" ]] && break; done for e in "${@:2}"; do [[ "$e" == "$1" ]] && break; done
@ -227,6 +248,8 @@ set_partion_layout() {
done done
} }
# This function will handle file systems. # This function will handle file systems.
set_filesystem () { set_filesystem () {
title "Setup File System" title "Setup File System"
@ -235,25 +258,8 @@ set_filesystem () {
select OPT in "${FILESYS[@]}"; do select OPT in "${FILESYS[@]}"; do
if elements_present "$OPT" "${FILESYS[@]}"; then if elements_present "$OPT" "${FILESYS[@]}"; then
if [ "$OPT" == "btrfs" ]; then if [ "$OPT" == "btrfs" ]; then
# Used -a to get more than one argument set_btrfs
echo -ne "Please enter your btrfs subvolumes separated by space\n" break
echo -ne "usualy they start with @ for root or @home, @temp etc.\n"
echo -ne "Defaults are @, @home, @var, @tmp, @.snapshots \n"
read -r -p "press enter to use default: " -a ARR
if [[ -z "${ARR[*]}" ]]; then
set_option "SUBVOLUMES" "(@ @home @var @tmp @.snapshots)"
break
else
# An array is a list of values.
NAMES=()
for i in "${ARR[@]}"; do
# push values to array
NAMES+=("$i")
done
# Set to config file
set_option "SUBVOLUMES" "(${NAMES[*]})"
break
fi
fi fi
set_option "FS" "$OPT" set_option "FS" "$OPT"
break break
@ -465,12 +471,13 @@ make_choice () {
1) 1)
clear clear
logo logo
title "Please select presetup \n\t\t\tsettings for your system" # title "Please select presetup \n\t\t\tsettings for your system"
user_info user_info
disk_selection disk_selection
set_locale set_locale
ssd_drive ssd_drive
set_keymap set_keymap
set_btrfs
set_option "FS" "btrfs" set_option "FS" "btrfs"
set_option "DE" "('plasma')" set_option "DE" "('plasma')"
set_option "DM" "sddm" set_option "DM" "sddm"
@ -479,7 +486,8 @@ make_choice () {
break break
;; ;;
2) 2)
user_info logo
# more option needed
break break
;; ;;
*) echo "Wrong option. Try again" *) echo "Wrong option. Try again"
@ -495,4 +503,5 @@ make_choice () {
background_check background_check
clear clear
logo logo
title "Automated Arch Linux Installer"
make_choice make_choice