This commit is contained in:
teldra 2021-05-09 21:13:48 +02:00
parent 9789877fe0
commit 96ac75c223
2 changed files with 10 additions and 11 deletions

View File

@ -159,4 +159,4 @@ setconf "add" "wipe" "${cfg[wipe]}"
setconf "add" "diskname" "${disk[name]}"
setconf "add" "bootsize" "4"
setconf "add" "target_part" "2"
module end

View File

@ -8,7 +8,6 @@ module start "disk" "Partition disk . BIOS"
diskid="${cfg[diskid]//-/_}"
if [[ -n "${cfg[wipe]}" ]]; then
echo "Formatting disk"
echo fdisk -w always "${cfg[diskname]}"
echo "o
w
q" | fdisk -w always "${cfg[diskname]}" > /dev/null
@ -24,7 +23,7 @@ p
a
w
q" | fdisk "${cfg[diskname]}" > /dev/null
sleep 2
sleep 3
if [[ "${cfg[rootfssize]}" == "rest" ]]; then
target_partition_tmp="${cfg[diskname]}2"
@ -47,28 +46,28 @@ elif [[ ! "${cfg[rootfssize]}" == "rest" ]]; then
w
q" | fdisk "${cfg[diskname]}" > /dev/null
fi
sleep 2
sleep 3
target_partition="${target_partition_tmp}"
if [[ ! "${cfg[fde_key_store]}" == "none" ]]; then
echo -n "${cfg[diskpw]}" | cryptsetup luksFormat --type luks1 "${target_partition}" -d -
sleep 1
sleep 2
echo -n "${cfg[diskpw]}" | cryptsetup luksOpen "${target_partition}" "voidluks-${diskid}" -d -
sleep 1
sleep 2
#echo -n "oem" | cryptsetup luksFormat --type luks1 "${target_partition}" -d -
#echo -n "oem" | cryptsetup luksOpen "${target_partition}" "voidluks-${diskid}" -d -
target_partition="/dev/mapper/voidluks-${diskid}"
fi
mkswap "${target_partition}"
sleep 1
sleep 2
vgcreate -q -f "voidvg.${diskid}" "${target_partition}" || exit 1
sleep 1
sleep 2
lvcreate -q -y --name swap -L "${cfg[swapsize]}"G "voidvg.${diskid}"
sleep 1
sleep 2
lvcreate -q -y --name root -l 100%FREE "voidvg.${diskid}"
sleep 1
sleep 2
mkfs.btrfs -q -f "/dev/mapper/voidvg.${diskid}-root"
mkswap "/dev/mapper/voidvg.${diskid}-swap"
mount "/dev/mapper/voidvg.${diskid}-root" "${dest}"