This commit is contained in:
teldra 2022-02-07 01:36:01 +01:00
parent d40d50f397
commit caebb2c1d6

View File

@ -96,6 +96,7 @@ do_partition() {
parted -a optimal $TARGET_PHY_WWN -s -- mklabel gpt
size=500
parted -a optimal $TARGET_PHY_WWN unit mib -s -- mkpart EFI fat32 $start $(( start + size ))
sleep 2
start=$(( start + size ))
parted -a optimal $TARGET_PHY_WWN unit mib -s -- mkpart root $start -1s
mkfs.vfat -F32 ${TARGET_PHY_WWN}-part1
@ -107,15 +108,14 @@ do_partition() {
if [ "$ENCRYPTION_STYLE" == "b" ] || [ "$ENCRYPTION_STYLE" == "e" ]; then
size=2048
parted -a optimal $TARGET_PHY_WWN unit mib -s -- mkpart primary ext4 $start $(( start + size ))
sleep 2
start=$(( start + size ))
mkfs.btrfs -f "${TARGET_PHY_WWN}-part1"
TARGET_PART="2"
fi
parted -a optimal $TARGET_PHY_WWN unit mib -s -- mkpart primary ext4 $start -1s
fi
sync
sleep 3
sleep 2
TARGETNAME=$(basename ${TARGET_PHY_WWN}-part${TARGET_PART})
TARGETNAME_UNDERSCORE=${TARGETNAME//-/_}
echo -n $pass | cryptsetup luksFormat ${TARGET_PHY_WWN}-part${TARGET_PART} -d -