From 6a7c4a3da809ade762afacb3b9fd743a7b723f27 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Tue, 13 Sep 2022 20:32:47 +0200 Subject: [PATCH] - verify if keyscript has successfully unlocked luks volume --- crypttab-keyscript.patch | 3 ++- dracut.spec | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crypttab-keyscript.patch b/crypttab-keyscript.patch index 2d27b91..a857794 100644 --- a/crypttab-keyscript.patch +++ b/crypttab-keyscript.patch @@ -11,13 +11,14 @@ diff -urpa dracut-056.orig/modules.d/90crypt/cryptroot-ask.sh dracut-056/modules esac shift done -@@ -174,6 +177,14 @@ else +@@ -174,6 +177,15 @@ else done fi +if [ ! -z "$keyscript" -a -x "$keyscript" ]; then + info "Executing keyscript $keyscript" + eval $keyscript "$luksfile" | cryptsetup -d - $cryptsetupopts luksOpen "$device" "$luksname" ++ cryptsetup status "$luksname" > /dev/null 2>&1 + if [ $? -eq 0 ]; then + ask_passphrase=0 + fi diff --git a/dracut.spec b/dracut.spec index 9fc6a08..1339f8c 100644 --- a/dracut.spec +++ b/dracut.spec @@ -2,7 +2,7 @@ Summary: Initramfs generator using udev Summary(pl.UTF-8): Generator initramfs wykorzystujący udev Name: dracut Version: 056 -Release: 2 +Release: 3 License: GPL v2+ Group: Base Source0: https://www.kernel.org/pub/linux/utils/boot/dracut/%{name}-%{version}.tar.xz -- 2.44.0