install stage 1: make device mapper name match with the one after boot

master
BodgeMaster 2026-04-05 21:43:23 +02:00
parent e89138b2b7
commit 4b2749b2a5
1 changed files with 3 additions and 2 deletions

View File

@ -189,7 +189,8 @@ if yesno; then
mkfs.f2fs -f -l "container" "$TARGET_PART_BOOT" >> $LOGFILE 2>&1
echo "Setting up encryption. You will be asked for the same password twice."
cryptsetup luksFormat --batch-mode --type luks2 --force-password "$TARGET_PART_BIG"
cryptsetup luksOpen --batch-mode --type luks2 "$TARGET_PART_BIG" voidusb-container
DEV_MAPPER_NAME="luks-$(blkid --output value --match-tag UUID "$TARGET_PART_BIG")"
cryptsetup luksOpen --batch-mode --type luks2 "$TARGET_PART_BIG" "$DEV_MAPPER_NAME"
if [ "$?" -gt 0 ]; then
echo "Failed to open encrypted container. The entered passwords probably didn't match."
exit 1
@ -214,7 +215,7 @@ if yesno; then
# actual storage
mkdir -p /mnt/target/run/void-usb/container >> $LOGFILE 2>&1
mount /dev/mapper/voidusb-container /mnt/target/run/void-usb/container >> $LOGFILE 2>&1
mount /dev/mapper/"$DEV_MAPPER_NAME" /mnt/target/run/void-usb/container >> $LOGFILE 2>&1
mkdir /mnt/target/boot >> $LOGFILE 2>&1
mount "$TARGET_PART_BOOT" /mnt/target/boot
mkdir /mnt/target/boot/efi >> $LOGFILE 2>&1