Skip to content

Commit

Permalink
Add zreport function
Browse files Browse the repository at this point in the history
Move the zpool list / zfs list commands in -init to the function
zreport(). This function prints the zfs/spl versions, the list of pools,
and a report of filesystems + properties we care about.

zreport can be called from a recovery shell for an easy to record
debugging picture/report.
  • Loading branch information
zdykstra committed Oct 16, 2021
1 parent d55b113 commit 8922f87
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
10 changes: 1 addition & 9 deletions 90zfsbootmenu/zfsbootmenu-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,7 @@ while IFS=$'\t' read -r _pool _health; do
fi
done <<<"$( zpool list -H -o name,health )"

zdebug "$(
echo "zpool list" ; \
zpool list
)"

zdebug "$(
echo "zfs list -o name,mountpoint,encroot,keystatus,keylocation,org.zfsbootmenu:keysource" ;\
zfs list -o name,mountpoint,encroot,keystatus,keylocation,org.zfsbootmenu:keysource
)"
zdebug "$( zreport )"

unsupported=0
while IFS=$'\t' read -r _pool _property; do
Expand Down
13 changes: 13 additions & 0 deletions 90zfsbootmenu/zfsbootmenu-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2433,6 +2433,19 @@ zbmcmdline() {
[ -f "${BASE}/zbm.cmdline" ] && echo | cat "${BASE}/zbm.cmdline" -
}

# prints: zpool list and zfs property list
# returns: nothing

zreport() {
cat <<-EOF
ZFS Version: $( modinfo -F version zfs ) / SPL Version: $( modinfo -F version spl )
$( zpool list )
$( zfs list -o name,mountpoint,encroot,keystatus,keylocation,org.zfsbootmenu:keysource )
EOF
}

# arg1: pid
# prints: child pid
# returns: 0 if a child pid was found, 1 if there are no children
Expand Down

0 comments on commit 8922f87

Please sign in to comment.