From cb8dfaa20d8268821239b1d17e72b30a1ec92fa6 Mon Sep 17 00:00:00 2001 From: Zach Dykstra Date: Tue, 5 Dec 2023 22:12:45 -0600 Subject: [PATCH] zfsbootmenu-core: show enabled/disabled hooks in zreport --- zfsbootmenu/lib/zfsbootmenu-core.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/zfsbootmenu/lib/zfsbootmenu-core.sh b/zfsbootmenu/lib/zfsbootmenu-core.sh index e265e5624..a73a408a2 100755 --- a/zfsbootmenu/lib/zfsbootmenu-core.sh +++ b/zfsbootmenu/lib/zfsbootmenu-core.sh @@ -1924,6 +1924,8 @@ emergency_shell() { # returns: nothing zreport() { + local hook + colorize white "System Report\n\n" ( @@ -1948,9 +1950,21 @@ zreport() { ) colorize orange "\n>> ZFSBootMenu commandline\n" - get_zbm_kcl | kcl_assemble + get_zbm_kcl | kcl_assemble ; echo + + colorize orange "\n>> Enabled hooks\n" + for hook in /libexec/hooks/*.d/*; do + [ -x "${hook}" ] && echo "* $( colorize green "${hook}")" + done + + colorize orange "\n>> Disabled hooks\n" + for hook in /libexec/hooks/*.d/*; do + [ -f "${hook}" ] || continue + [ -x "${hook}" ] && continue + echo "* $( colorize red "${hook}")" + done - colorize orange "\n\n>> ZFS/SPL module information\n" + colorize orange "\n>> ZFS/SPL module information\n" echo "$( modinfo -F filename spl ): $( modinfo -F version spl )" echo "$( modinfo -F filename zfs ): $( modinfo -F version zfs )"