Fix intermitent loop device not available error when CRYPTROOT_ENABLE is enabled

This commit is contained in:
Gunjan Gupta
2023-07-21 01:55:05 +05:30
parent 909fa47b7e
commit 2bf0ddc034

View File

@@ -243,6 +243,7 @@ function prepare_partitions() {
local rootdevice="${LOOP}p${rootpart}"
if [[ $CRYPTROOT_ENABLE == yes ]]; then
check_loop_device "$rootdevice"
display_alert "Encrypting root partition with LUKS..." "cryptsetup luksFormat $rootdevice" ""
echo -n $CRYPTROOT_PASSPHRASE | cryptsetup luksFormat $CRYPTROOT_PARAMETERS $rootdevice -
echo -n $CRYPTROOT_PASSPHRASE | cryptsetup luksOpen $rootdevice $ROOT_MAPPER -