From ed5bc28ec5862aa7db84b5820a0af184c42c2159 Mon Sep 17 00:00:00 2001 From: teldra Date: Mon, 7 Feb 2022 06:15:46 +0100 Subject: [PATCH] progress --- main.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/main.sh b/main.sh index 701be99..d35331c 100644 --- a/main.sh +++ b/main.sh @@ -58,7 +58,6 @@ use_efi() { encryption_style() { header "Choose encryption style" - echo "implemented:" echo "a)keyfile in initramfs" #bios: 1 uefi: 2 echo "b)no encryption" #bios: 2 uefi: 2 #echo "not implemented:" @@ -118,10 +117,14 @@ do_partition() { 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 - - #echo -n $pass | sudo cryptsetup luksOpen /dev/sdc1 sdc1 -d - - echo -n $pass | cryptsetup luksOpen ${TARGET_PHY_WWN}-part${TARGET_PART} "luks_${TARGETNAME_UNDERSCORE}" -d - - vgcreate vg_${TARGETNAME_UNDERSCORE} /dev/mapper/luks_${TARGETNAME_UNDERSCORE} + T=/dev/disk/by-id/${TARGET_PHY_WWN}-part${TARGET_PART} + if [ "$ENCRYPTION_STYLE" == "a" ]; then + T=/dev/mapper/luks_${TARGETNAME_UNDERSCORE} + echo -n $pass | cryptsetup luksFormat ${TARGET_PHY_WWN}-part${TARGET_PART} -d - + #echo -n $pass | sudo cryptsetup luksOpen /dev/sdc1 sdc1 -d - + echo -n $pass | cryptsetup luksOpen ${TARGET_PHY_WWN}-part${TARGET_PART} "luks_${TARGETNAME_UNDERSCORE}" -d - + fi + vgcreate vg_${TARGETNAME_UNDERSCORE} $T lvcreate --name swap -L ${SWAPSIZE}G vg_${TARGETNAME_UNDERSCORE} lvcreate --name root -l 100%FREE vg_${TARGETNAME_UNDERSCORE} mkswap -f /dev/mapper/vg_${TARGETNAME_UNDERSCORE}-swap