This commit is contained in:
mfgbhatti 2022-01-29 23:17:01 +00:00
parent 8d4ca4d637
commit 31870e51d9
1 changed files with 5 additions and 5 deletions

View File

@ -43,8 +43,10 @@ do_lvm() {
while [[ "$i" -le "$LVM_PART_NUM" ]]; do while [[ "$i" -le "$LVM_PART_NUM" ]]; do
if [[ "$i" -eq "$LVM_PART_NUM" ]]; then if [[ "$i" -eq "$LVM_PART_NUM" ]]; then
lvcreate -l 100%FREE "$LVM_VG" -n "${LVM_NAMES[$i]}" lvcreate -l 100%FREE "$LVM_VG" -n "${LVM_NAMES[$i]}"
do_format "${LVM_NAMES[$i]}"
else else
lvcreate -L "${LVM_SIZES[$i]}" "$LVM_VG" -n "${LVM_NAMES[$i]}" lvcreate -L "${LVM_SIZES[$i]}" "$LVM_VG" -n "${LVM_NAMES[$i]}"
do_format "${LVM_NAMES[$i]}"
fi fi
i=$((i + 1)) i=$((i + 1))
done done
@ -63,12 +65,12 @@ do_partition() {
do_format() { do_format() {
if [[ $FS =~ "btrfs" ]]; then if [[ $FS =~ "btrfs" ]]; then
do_btrfs "$ROOT" "$PART3" do_btrfs "$ROOT" "$1"
else else
mkfs."$FS" "$PART3" \ mkfs."$FS" "$1" \
"$([[ $FS == xfs || $FS == reiserfs ]] && echo "-f")" \ "$([[ $FS == xfs || $FS == reiserfs ]] && echo "-f")" \
"$([[ $FS == vfat ]] && echo "-F32")" \ "$([[ $FS == vfat ]] && echo "-F32")" \
"$([[ $FS == ext4 ]] && echo "-E discard -F")" "$([[ $TRIM -eq 1 && ${filesystem} == ext4 ]] && echo "-E discard -F")"
fi fi
} }
@ -102,14 +104,12 @@ if [[ "$LAYOUT" -eq 1 ]]; then
elif [[ "$LVM" -eq 1 ]]; then elif [[ "$LVM" -eq 1 ]]; then
do_partition do_partition
do_format
pvcreate "$PART3" pvcreate "$PART3"
vgcreate "$LVM_VG" "$PART3" vgcreate "$LVM_VG" "$PART3"
do_lvm do_lvm
elif [[ "$LUKS" -eq 1 ]]; then elif [[ "$LUKS" -eq 1 ]]; then
do_partition do_partition
do_format
# enter luks password to cryptsetup and format root partition # enter luks password to cryptsetup and format root partition
echo -n "$LUKS_PASSWORD" | cryptsetup -y -v luksFormat "$PART3" - echo -n "$LUKS_PASSWORD" | cryptsetup -y -v luksFormat "$PART3" -
# open luks container and ROOT will be place holder # open luks container and ROOT will be place holder