From 89602ddb34c3bbb1e3fe2118e2f2bd0ffd00c585 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 )"