@ -54,6 +54,30 @@ _btrfsSVBody3="This process will be repeated until an asterisk (*) is entered as
_btrfsMntBody="Use [Space] to de/select the desired mount options and review carefully. Please do not select multiple versions of the same option."
_btrfsMntConfBody="Confirm the following mount options:"
#zfs
_PrepZFS="ZFS (optional)"
_zfsNotSupported="The kernel modules to support ZFS could not be found"
_zfsAutoComplete="Automatic zfs provisioning has been completed"
_zfsMainMenuBody="ZFS is a flexible and resilient file system that combines elements of logical volume management, RAID and traditional file systems. ZFS on Linux requires special handling and is not ideal for beginners.\n\nSelect automatic to select a partition and allow the system to automate the creation a new a zpool and datasets mounted to '/', '/home' and '/var/cache/pacman'. Manual configuration is available but requires specific knowledge of zfs."
_zfsManualMenuBody="Please select an option below"
_zfsManualMenuOptCreate="Create a new zpool"
_zfsManualMenuOptImport="Import an existing zpool"
_zfsManualMenuOptNewFile="Create and mount a ZFS filesystem"
_zfsManualMenuOptNewLegacy="Create a legacy ZFS filesystem"
_zfsManualMenuOptNewZvol="Create a new ZVOL"
_zfsManualMenuOptDestroy="Destroy a ZFS dataset"
_zfsZpoolPartMenuTitle="Select a partition"
_zfsZpoolPartMenuBody="Select a partition to hold the ZFS zpool"
_zfsZpoolCTitle="zpool Creation"
_zfsZpoolCBody="Enter the name for the new zpool"
_zfsZpoolCValidation1="zpool names must start with a letter and are limited to only alphanumeric characters and the special characters : . - _"
_zfsZpoolCValidation2="zpool names cannot start with the reserved words (log, mirror, raidz, raidz1, raidz2, raidz3, or spare)"
_zfsCancelled="Operation cancelled"
_zfsFoundRoot="Using ZFS root on '/'"
# Autopartition
_AutoPartBody1="Warning: ALL data on"
_AutoPartBody2="will be destroyed.\n\nA 512MB boot partition will first be created, followed by a second (root or '/') partition using all remaining space."
# Check if there are subvolumes already on the btrfs partition
if[[$(btrfs subvolume list /mnt | wc -l) -gt 1]]&& DIALOG " The volume has already subvolumes " --yesno "\nFound subvolumes $(btrfs subvolume list /mnt | cut -d" " -f9)\n\nWould you like to mount them? \n "0 0;then
# Pre-existing subvolumes and user wants to mount them
mount_existing_subvols
else
# No subvolumes present. Make some new ones
DIALOG " Your root volume is formatted in btrfs " --yesno "\nWould you like to create subvolumes in it? \n "00&& btrfs_subvolumes && touch /tmp/.btrfsroot
fi
else
[[ -e /tmp/.btrfsroot ]]&& rm /tmp/.btrfsroot
fi
# check to see if we already have a zfs root device mounted
# Check if there are subvolumes already on the btrfs partition
if[[$(btrfs subvolume list /mnt | wc -l) -gt 1]]&& DIALOG " The volume has already subvolumes " --yesno "\nFound subvolumes $(btrfs subvolume list /mnt | cut -d" " -f9)\n\nWould you like to mount them? \n "0 0;then
# Pre-existing subvolumes and user wants to mount them
mount_existing_subvols
else
# No subvolumes present. Make some new ones
DIALOG " Your root volume is formatted in btrfs " --yesno "\nWould you like to create subvolumes in it? \n "00&& btrfs_subvolumes && touch /tmp/.btrfsroot
fi
else
[[ -e /tmp/.btrfsroot ]]&& rm /tmp/.btrfsroot
fi
fi
# Identify and create swap, if applicable
make_swap
@ -1097,6 +1267,7 @@ get_cryptboot(){
fi
}
btrfs_subvolumes(){
#1) save mount options and name of the root partition