From e8b199faec442a2e831f715ce187acf4bce0e930 Mon Sep 17 00:00:00 2001 From: Garrett Fields Date: Tue, 17 Dec 2019 20:45:06 -0500 Subject: [PATCH] Force systems with kernel option "quiet" to display prompt for password On systems that utilize TTY for password entry, if the kernel option "quiet" is set, the system would appear to freeze on a blank screen, when in fact it is waiting for password entry from the user. Since TTY is the fallback method, this has no effect on systemd or plymouth password prompting. By temporarily setting "printk" to "7", running the command, then resuming with the original "printk" state, the user can see the password prompt. Reviewed-by: Richard Laager Reviewed-by: Brian Behlendorf Signed-off-by: Garrett Fields Closes #9731 --- contrib/initramfs/scripts/zfs.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/initramfs/scripts/zfs.in b/contrib/initramfs/scripts/zfs.in index 523694473a..5540160621 100644 --- a/contrib/initramfs/scripts/zfs.in +++ b/contrib/initramfs/scripts/zfs.in @@ -436,7 +436,11 @@ decrypt_fs() # Prompt with ZFS tty, otherwise else + # Setting "printk" temporarily to "7" will allow prompt even if kernel option "quiet" + storeprintk="$(awk '{print $1}' /proc/sys/kernel/printk)" + echo 7 > /proc/sys/kernel/printk $ZFS load-key "${ENCRYPTIONROOT}" + echo "$storeprintk" > /proc/sys/kernel/printk fi fi fi