Blame SOURCES/cryptsetup-2.0.4-dracut-reencrypt.patch

ac737d
From 1b9148f12f85f326cb8127665ecfc2136c9822d5 Mon Sep 17 00:00:00 2001
ac737d
From: Ondrej Kozina <okozina@redhat.com>
ac737d
Date: Wed, 18 Oct 2017 09:57:03 +0200
ac737d
Subject: [PATCH] dracut-reencrypt: add --progress-frequency parameter
ac737d
ac737d
---
ac737d
 misc/dracut_90reencrypt/reencrypt.sh | 2 +-
ac737d
 1 file changed, 1 insertion(+), 1 deletion(-)
ac737d
ac737d
diff --git a/misc/dracut_90reencrypt/reencrypt.sh b/misc/dracut_90reencrypt/reencrypt.sh
ac737d
index e6f87e0..b4960d7 100755
ac737d
--- a/misc/dracut_90reencrypt/reencrypt.sh
ac737d
+++ b/misc/dracut_90reencrypt/reencrypt.sh
ac737d
@@ -18,7 +18,7 @@ else
ac737d
     device="$1"
ac737d
 fi
ac737d
 
ac737d
-PARAMS="$device -T 1 --use-fsync -B 32"
ac737d
+PARAMS="$device -T 1 --use-fsync --progress-frequency 5 -B 32"
ac737d
 if [ "$3" != "any" ]; then
ac737d
     PARAMS="$PARAMS -S $3"
ac737d
 fi
ac737d
-- 
ac737d
1.8.3.1
ac737d
ac737d
From cda0a8ac7f30f120cdf5fadf16484715e8f9a040 Mon Sep 17 00:00:00 2001
ac737d
From: Ondrej Kozina <okozina@redhat.com>
ac737d
Date: Thu, 19 Jul 2018 17:33:58 +0200
ac737d
Subject: [PATCH 2/2] Indicate running in initrd phase.
ac737d
ac737d
---
ac737d
 misc/dracut_90reencrypt/reencrypt.sh | 2 ++
ac737d
 1 file changed, 2 insertions(+)
ac737d
ac737d
diff --git a/misc/dracut_90reencrypt/reencrypt.sh b/misc/dracut_90reencrypt/reencrypt.sh
ac737d
index e6f87e0..24c7716 100755
ac737d
--- a/misc/dracut_90reencrypt/reencrypt.sh
ac737d
+++ b/misc/dracut_90reencrypt/reencrypt.sh
ac737d
@@ -11,6 +11,8 @@
ac737d
 
ac737d
 . /lib/dracut-lib.sh
ac737d
 
ac737d
+export CRYPT_REENCRYPT_IN_INITRD=1
ac737d
+
ac737d
 # if device name is /dev/dm-X, convert to /dev/mapper/name
ac737d
 if [ "${1##/dev/dm-}" != "$1" ]; then
ac737d
     device="/dev/mapper/$(dmsetup info -c --noheadings -o name "$1")"
ac737d
-- 
ac737d
1.8.3.1
ac737d
ac737d
From 5da5e7f095e09c9501179864f6a20293dd9cada5 Mon Sep 17 00:00:00 2001
ac737d
From: Ondrej Kozina <okozina@redhat.com>
ac737d
Date: Mon, 16 Jul 2018 17:17:45 +0200
ac737d
Subject: [PATCH] Redirect stdout to stderr during reencryption in initrd.
ac737d
ac737d
Stdout is not printed in initrd unless user invokes debug mode.
ac737d
It's inconvenient to have users waiting for reencryption to
ac737d
finish with no input at all.
ac737d
---
ac737d
 misc/dracut_90reencrypt/module-setup.sh      | 1 +
ac737d
 misc/dracut_90reencrypt/reencrypt-verbose.sh | 5 +++++
ac737d
 misc/dracut_90reencrypt/reencrypt.sh         | 4 ++--
ac737d
 3 files changed, 8 insertions(+), 2 deletions(-)
ac737d
 create mode 100755 misc/dracut_90reencrypt/reencrypt-verbose.sh
ac737d
ac737d
diff --git a/misc/dracut_90reencrypt/module-setup.sh b/misc/dracut_90reencrypt/module-setup.sh
ac737d
index 2ec9953..fcd7c92 100755
ac737d
--- a/misc/dracut_90reencrypt/module-setup.sh
ac737d
+++ b/misc/dracut_90reencrypt/module-setup.sh
ac737d
@@ -28,4 +28,5 @@ install() {
ac737d
     # shellcheck disable=SC2154
ac737d
     inst_hook cmdline 30 "$moddir/parse-reencrypt.sh"
ac737d
     inst_simple "$moddir"/reencrypt.sh /sbin/reencrypt
ac737d
+    inst_simple "$moddir"/reencrypt-verbose.sh /sbin/cryptsetup-reencrypt-verbose
ac737d
 }
ac737d
diff --git a/misc/dracut_90reencrypt/reencrypt-verbose.sh b/misc/dracut_90reencrypt/reencrypt-verbose.sh
ac737d
new file mode 100755
ac737d
index 0000000..5db75d5
ac737d
--- /dev/null
ac737d
+++ b/misc/dracut_90reencrypt/reencrypt-verbose.sh
ac737d
@@ -0,0 +1,5 @@
ac737d
+#!/bin/sh
ac737d
+
ac737d
+# Route stdout to stderr in initrd. Otherwise output is invisible
ac737d
+# unless we run in debug mode.
ac737d
+/sbin/cryptsetup-reencrypt $@ 1>&2
ac737d
diff --git a/misc/dracut_90reencrypt/reencrypt.sh b/misc/dracut_90reencrypt/reencrypt.sh
ac737d
index b4960d7..4243773 100755
ac737d
--- a/misc/dracut_90reencrypt/reencrypt.sh
ac737d
+++ b/misc/dracut_90reencrypt/reencrypt.sh
ac737d
@@ -50,10 +50,10 @@ reenc_run() {
ac737d
 	fi
ac737d
         /bin/plymouth ask-for-password \
ac737d
         --prompt "$_prompt" \
ac737d
-        --command="/sbin/cryptsetup-reencrypt $PARAMS"
ac737d
+        --command="/sbin/cryptsetup-reencrypt-verbose $PARAMS"
ac737d
     else
ac737d
         info "REENCRYPT using key $1"
ac737d
-        reenc_readkey "$1" | /sbin/cryptsetup-reencrypt -d - $PARAMS
ac737d
+        reenc_readkey "$1" | /sbin/cryptsetup-reencrypt-verbose -d - $PARAMS
ac737d
     fi
ac737d
     _ret=$?
ac737d
     cd $cwd
ac737d
-- 
ac737d
1.8.3.1
ac737d