From c56ab04eba990c791d711a5bd0f898bfd42c4e24 Mon Sep 17 00:00:00 2001 From: Zach Dykstra Date: Fri, 11 Oct 2024 22:57:14 -0500 Subject: [PATCH] lib/zfsbootmenu-core.sh: add initramfs generator to zreport --- zfsbootmenu/lib/zfsbootmenu-core.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/zfsbootmenu/lib/zfsbootmenu-core.sh b/zfsbootmenu/lib/zfsbootmenu-core.sh index c2350e1f2..edf5fda66 100644 --- a/zfsbootmenu/lib/zfsbootmenu-core.sh +++ b/zfsbootmenu/lib/zfsbootmenu-core.sh @@ -1993,24 +1993,33 @@ zreport() { colorize white "System Report\n\n" ( - VERSION="unknown" - PRETTY_NAME="ZFSBootMenu" + ZBM_VERSION="unknown" + ZBM_PRETTY_NAME="ZFSBootMenu" + INITRD_VERSION="unknown initramfs" UNAME="$( uname -srm )" # shellcheck disable=SC1091 [ -f /etc/zbm-release ] && source /etc/zbm-release if [[ "${VERSION}" =~ dev$ ]]; then - VERSION="$( colorize red "${VERSION}" )" + ZBM_VERSION="$( colorize red "${VERSION}" )" else - VERSION="$( colorize green "${VERSION}" )" + ZBM_VERSION="$( colorize green "${VERSION}" )" fi if [[ "${PRETTY_NAME}" == "ZFSBootMenu" ]]; then - PRETTY_NAME="$( colorize orange ZFS )$( colorize lightgray BootMenu )" + ZBM_PRETTY_NAME="$( colorize orange ZFS )$( colorize lightgray BootMenu )" fi - echo -e "${PRETTY_NAME} ${VERSION} (${UNAME})" + if [ -f "/VERSION" ] ; then + read -r INITRD_VERSION < /VERSION + INITRD_VERSION="mkinitcpio ${INITRD_VERSION}" + elif [ -f /etc/initrd-release ] ; then + source /etc/initrd-release + [ -n "${DRACUT_VERSION}" ] && INITRD_VERSION="Dracut ${DRACUT_VERSION}" + fi + + echo -e "${ZBM_PRETTY_NAME} ${ZBM_VERSION} with ${INITRD_VERSION} and ${UNAME}" ) colorize orange "\n>> ZFSBootMenu commandline\n"