Skip to content

Commit

Permalink
Force systems with kernel option "quiet" to display prompt for password
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Garrett Fields <[email protected]>
Closes openzfs#9731
  • Loading branch information
ghfields authored and tonyhutter committed Dec 27, 2019
1 parent 1420f55 commit d61ee3e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contrib/initramfs/scripts/zfs.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d61ee3e

Please sign in to comment.