summaryrefslogtreecommitdiff
path: root/sys-boot/myinitramfs/files/init.enc
diff options
context:
space:
mode:
Diffstat (limited to 'sys-boot/myinitramfs/files/init.enc')
-rwxr-xr-xsys-boot/myinitramfs/files/init.enc6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys-boot/myinitramfs/files/init.enc b/sys-boot/myinitramfs/files/init.enc
index b1cd3a2..0514508 100755
--- a/sys-boot/myinitramfs/files/init.enc
+++ b/sys-boot/myinitramfs/files/init.enc
@@ -83,7 +83,11 @@ root="$(blkid | awk -v uuid="UUID=\"$uuid\"" '$2 == uuid { gsub(/:$/,"",$1); pri
[ -e "$root" ] || fail "Root not located!"
echo -e "${C_GREEN}Unlocking root...${C_NO}"
-cryptsetup open "$root" encroot || fail "Unlocking root failed! /proc/cmdline=$(cat /proc/cmdline)"
+if command -v initramfs_password >/dev/null; then
+ initramfs_password | cryptsetup open --key-file=- "$root" encroot
+else
+ cryptsetup open "$root" encroot
+fi || fail "Unlocking root failed! /proc/cmdline=$(cat /proc/cmdline)"
echo -e "${C_GREEN}Mounting root...${C_NO}"
mount -t btrfs -o "$rootflags" /dev/mapper/encroot /mnt/root \