-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use an early-setup hook to force console init in release images
Setting rd.hostonly=0 in the release and recovery images causes dracut to throw out the initqueue hooks that ZBM installs to force the event loop to fire at least once. As a result, the console is often not initialized before ZBM takes control. ZFSBootMenu early-setup hooks provide a convenient place to force the console initialization, allowing things like fonts and keymaps to be set before password prompts might appear.
- Loading branch information
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
## This early-setup hook forces the dracut console initialization hook to run. | ||
## | ||
## ZFSBootMenu release builds embed rd.hostonly=0 in the kernel command line, | ||
## which causes the normal dracut initqueue to be thrown out; the ZFSBootMenu | ||
## initqueue hooks that force the dracut event loop to run at least once are | ||
## purged, so dracut terminates the event loop before console initialization. | ||
|
||
# There is nothing to do if the console initializer is not executable | ||
[ -x /lib/udev/console_init ] || exit 0 | ||
|
||
if [ -z "${control_term}" ] && [ -f /etc/zfsbootmenu.conf ]; then | ||
# If control_term isn't defined, check the runtime config for it | ||
# shellcheck disable=SC1091 | ||
source /etc/zfsbootmenu.conf | ||
fi | ||
|
||
# There is nothing to do without a valid control_term device | ||
[ -c "${control_term}" ] || exit 0 | ||
|
||
# Try to initialize the console | ||
/lib/udev/console_init "${control_term##*/}" >/dev/null 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters