This commit is contained in:
teldra 2022-02-07 06:15:46 +01:00
parent 01197c190e
commit ed5bc28ec5

13
main.sh
View File

@ -58,7 +58,6 @@ use_efi() {
encryption_style() { encryption_style() {
header "Choose encryption style" header "Choose encryption style"
echo "implemented:"
echo "a)keyfile in initramfs" #bios: 1 uefi: 2 echo "a)keyfile in initramfs" #bios: 1 uefi: 2
echo "b)no encryption" #bios: 2 uefi: 2 echo "b)no encryption" #bios: 2 uefi: 2
#echo "not implemented:" #echo "not implemented:"
@ -118,10 +117,14 @@ do_partition() {
sleep 2 sleep 2
TARGETNAME=$(basename ${TARGET_PHY_WWN}-part${TARGET_PART}) TARGETNAME=$(basename ${TARGET_PHY_WWN}-part${TARGET_PART})
TARGETNAME_UNDERSCORE=${TARGETNAME//-/_} TARGETNAME_UNDERSCORE=${TARGETNAME//-/_}
echo -n $pass | cryptsetup luksFormat ${TARGET_PHY_WWN}-part${TARGET_PART} -d - T=/dev/disk/by-id/${TARGET_PHY_WWN}-part${TARGET_PART}
#echo -n $pass | sudo cryptsetup luksOpen /dev/sdc1 sdc1 -d - if [ "$ENCRYPTION_STYLE" == "a" ]; then
echo -n $pass | cryptsetup luksOpen ${TARGET_PHY_WWN}-part${TARGET_PART} "luks_${TARGETNAME_UNDERSCORE}" -d - T=/dev/mapper/luks_${TARGETNAME_UNDERSCORE}
vgcreate vg_${TARGETNAME_UNDERSCORE} /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 swap -L ${SWAPSIZE}G vg_${TARGETNAME_UNDERSCORE}
lvcreate --name root -l 100%FREE vg_${TARGETNAME_UNDERSCORE} lvcreate --name root -l 100%FREE vg_${TARGETNAME_UNDERSCORE}
mkswap -f /dev/mapper/vg_${TARGETNAME_UNDERSCORE}-swap mkswap -f /dev/mapper/vg_${TARGETNAME_UNDERSCORE}-swap