Skip to content

Commit

Permalink
Small quality of life improvements
Browse files Browse the repository at this point in the history
When console=ttyS0,1152800n8 is passed in to the kernel it does not
directly translate to a /dev entry. Simply strip the ,value off of the
console=x,y parameter and set that as our /dev entry.

When a pool import fails for some reason, log the text from the zpool
import process at the debug log level.
  • Loading branch information
zdykstra committed Jun 4, 2021
1 parent 72f6242 commit 40dd0e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions 90zfsbootmenu/zfsbootmenu-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ load_be_cmdline() {
# rewind_to_checkpoint=1: enable --rewind-to-checkpoint

import_pool() {
local pool import_args
local pool import_args import_output

pool="${1}"

Expand Down Expand Up @@ -1413,14 +1413,17 @@ import_pool() {

zdebug "zpool import arguments: ${import_args[*]} ${pool}"

zpool import "${import_args[@]}" "${pool}" >/dev/null 2>&1
import_output="$(
zpool import "${import_args[@]}" "${pool}" 2>&1
)"
ret=$?

if [ "$ret" -eq 0 ]; then
zdebug "successful pool import"
else
spl_hostid="$( get_spl_hostid )"
zdebug "import process failed with code ${ret}, apparent hostid ${spl_hostid:-unknown}"
zdebug "${import_output}"
fi

return ${ret}
Expand Down
2 changes: 1 addition & 1 deletion 90zfsbootmenu/zfsbootmenu-parse-commandline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ spl_hostid=$(getarg spl_hostid=)
# Use the last defined console= to control menu output
control_term=$( getarg console=)
if [ -n "${control_term}" ]; then
control_term="/dev/${control_term%,*}"
info "ZFSBootMenu: setting controlling terminal to: ${control_term}"
control_term="/dev/${control_term}"
else
control_term="/dev/tty1"
info "ZFSBootMenu: defaulting controlling terminal to: ${control_term}"
Expand Down

0 comments on commit 40dd0e3

Please sign in to comment.