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

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