Add filesystem formatting

This commit is contained in:
Eric Renfro 2024-06-23 19:43:08 -04:00
parent b3646ce2b3
commit 95e09bcb32
Signed by: psi-jack
SSH key fingerprint: SHA256:1TKB8Z257L8EHK8GWNxKgMhD8a+FAR+f+j3nnlcuNVM

View file

@ -51,6 +51,32 @@ function create_luks() {
${cmd} cryptsetup luksOpen "$RootPart" luksvol ${cmd} cryptsetup luksOpen "$RootPart" luksvol
} }
function prepare_format() {
if [[ "$DEBUG" ]]; then
local cmd="echo"
else
local cmd=""
echo "WARNING: Not in Debug mode, exiting now"
exit 254
fi
echo "Formatting EFI: $EFIPart"
${cmd} mkfs.fat -F32 -n "EFI" "$EFIPart"
if [[ "$BootPart" != "@boot" ]]; then
echo "Formatting Boot: $BootPart"
${cmd} mkfs.ext4 -FF -L boot "$BootPart"
fi
if [[ "$ENCRYPTION" ]]; then
echo "Formatting Root: /dev/mapper/luksvol"
${cmd} mkfs.btrfs -L root /dev/mapper/luksvol
else
echo "Formatting Root: $RootPart"
${cmd} mkfs.btrfs -L root "$RootPart"
fi
}
function create_subvolumes() { function create_subvolumes() {
local -a subvols=("@") local -a subvols=("@")
@ -205,6 +231,10 @@ function install_normal() {
create_luks create_luks
fi fi
echo
echo "Formatting Filesystems..."
prepare_format
echo echo
echo "Preparing Subvolumes..." echo "Preparing Subvolumes..."
create_subvolumes create_subvolumes