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 <rlaager@wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Garrett Fields <ghfields@gmail.com>
Closes #9731
This commit is contained in:
Garrett Fields 2019-12-17 20:45:06 -05:00 committed by Brian Behlendorf
parent ad97643773
commit e8b199faec
1 changed files with 4 additions and 0 deletions

View File

@ -436,7 +436,11 @@ decrypt_fs()
# Prompt with ZFS tty, otherwise # Prompt with ZFS tty, otherwise
else 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}" $ZFS load-key "${ENCRYPTIONROOT}"
echo "$storeprintk" > /proc/sys/kernel/printk
fi fi
fi fi
fi fi