This commit is contained in:
teldra 2021-05-09 23:15:18 +02:00
parent eacb41b31b
commit 15a1ac3ef6

View File

@ -2,6 +2,7 @@ if ! yesno "nun gehts los, sicher?" y; then
exit
fi
module start "disk" "Partition disk"
diskid="${cfg[diskid]//-/_}"
@ -9,7 +10,7 @@ index=1
echo "Formatting disk"
if test -d /sys/firmware/efi; then
module start "disk" "Partition disk . UEFI"
echo "UEFI Partition"
echo "g
n
1
@ -18,11 +19,11 @@ if test -d /sys/firmware/efi; then
t
1
w
q" | fdisk "${cfg[diskname]}" > /dev/null
q" | fdisk -w always "${cfg[diskname]}" > /dev/null
efipart="${cfg[diskname]}${index}"
index=$(( index + 1 ))
else
module start "disk" "Partition disk . BIOS"
echo "BIOS Partition"
echo "o
w
q" | fdisk -w always "${cfg[diskname]}" > /dev/null
@ -78,17 +79,17 @@ if [[ ! "${cfg[fde_key_store]}" == "none" ]]; then
target_partition="/dev/mapper/voidluks-${diskid}"
fi
mkswap "${target_partition}"
mkswap "${target_partition}" || exit 1
sleep 2
vgcreate -q -f "voidvg.${diskid}" "${target_partition}" || exit 1
sleep 2
lvcreate -q -y --name swap -L "${cfg[swapsize]}"G "voidvg.${diskid}"
lvcreate -q -y --name swap -L "${cfg[swapsize]}"G "voidvg.${diskid}" || exit 1
sleep 2
lvcreate -q -y --name root -l 100%FREE "voidvg.${diskid}"
lvcreate -q -y --name root -l 100%FREE "voidvg.${diskid}" || exit 1
sleep 2
mkfs.btrfs -q -f "/dev/mapper/voidvg.${diskid}-root"
mkfs.btrfs -q -f "/dev/mapper/voidvg.${diskid}-root" || exit 1
mkswap "/dev/mapper/voidvg.${diskid}-swap"
mkswap "/dev/mapper/voidvg.${diskid}-swap" || exit 1
mount "/dev/mapper/voidvg.${diskid}-root" "${dest}"
btrfs subvol create "${dest}/rootfs"