diff --git a/0-preinstall.sh b/0-preinstall.sh index a0b3b38..ad275b7 100755 --- a/0-preinstall.sh +++ b/0-preinstall.sh @@ -41,12 +41,17 @@ if [[ "$LAYOUT" ]]; then mkfs.vfat -F32 -n "EFIBOOT" "$PART2" mkfs.btrfs -L "ROOT" "$PART3" -f mount -t btrfs "$PART3" /mnt - for x in "${SUBVOLUMES[@]}"; do + IFS=' ' read -r -a _LIST <<< "$SUBVOLUMES" + for x in "${_LIST[@]}"; do btrfs subvolume create /mnt/"${x}" done umount /mnt - for y in "${SUBVOLUMES[@]}"; do - mount -o "$MOUNTOPTION",subvol="${y}" "$PART3" /mnt + mount -o "$MOUNTOPTION",subvol=@ "$PART3" /mnt + for y in "${_LIST[@]:1}"; do + mkdir /mnt/"${y}" + done + for z in "${_LIST[@]:1}"; do + mount -o "$MOUNTOPTION",subvol="${z}" "$PART3" /mnt/"${z}" done else modprobe dm-mod diff --git a/startup.sh b/startup.sh index 3f542af..b09d6cc 100644 --- a/startup.sh +++ b/startup.sh @@ -80,7 +80,7 @@ efi_check () { set_btrfs () { # Used -a to get more than one argument echo "Please enter your btrfs subvolumes separated by space" - echo "usualy they start with @ for root or @home, @temp etc." + echo "usualy they start with @ like @home, @temp etc." echo "Defaults are @, @home, @var, @tmp, @.snapshots" echo " " read -r -p "press enter to use default: " -a ARR @@ -88,7 +88,7 @@ set_btrfs () { set_option "SUBVOLUMES" "(@ @home @var @tmp @.snapshots)" else # An array is a list of values. - NAMES=() + NAMES=(@) for i in "${ARR[@]}"; do # push values to array NAMES+=("$i")