From 63f31bf73e62a611a58ad057d3600599de877e2d Mon Sep 17 00:00:00 2001 From: Steffen Maier Date: Mon, 4 Sep 2023 18:27:51 +0200 Subject: [PATCH] zdev/dracut: add field debugging capabilities with logging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Additional debugging output can be generated with e.g. dracut option "--stdlog 5" (or short -L5). It shows the chzdev export result, the output of chzdev imports, and an overview of the resulting persistent config within the initrd. On systems, which default to using dracut option "--quiet", you might need an additional "--verbose" to counter "--quiet" so -L5 has effect. Typically combined with "--debug" to get a shell trace from building an initrd (Note: --debug does not increase the log levels). Github-ID: https://github.com/ibm-s390-linux/s390-tools/pull/158 Reviewed-by: Alexander Egorenkov Reviewed-by: Vineeth Vijayan Acked-by: Vineeth Vijayan Acked-by: Peter Oberparleiter Signed-off-by: Steffen Maier Signed-off-by: Jan Höppner --- zdev/dracut/95zdev-kdump/module-setup.sh | 13 +++++++++---- zdev/dracut/95zdev/module-setup.sh | 9 +++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/zdev/dracut/95zdev-kdump/module-setup.sh b/zdev/dracut/95zdev-kdump/module-setup.sh index 300b8e97..328732ef 100755 --- a/zdev/dracut/95zdev-kdump/module-setup.sh +++ b/zdev/dracut/95zdev-kdump/module-setup.sh @@ -25,7 +25,7 @@ check() { zdev_is_kdump || return 1 # Ensure that required tools are available - require_binaries chzdev || return 1 + require_binaries chzdev lszdev || return 1 return 0 } @@ -61,8 +61,8 @@ install() { # many zFCP LUNs inst_dir /etc/modprobe.d chzdev zfcp --type "allow_lun_scan=0" --persistent \ - --base "/etc=${initdir:?}/etc" --yes --quiet --no-root-update \ - --force >/dev/null + --base "/etc=${initdir:?}/etc" --yes --no-root-update \ + --force 2>&1 | ddebug # drop /etc/zfcp.conf from dracut module 95zfcp echo "rd.zfcp.conf=0" > "$initdir/etc/cmdline.d/00-no-zfcp-conf.conf" # => only activate individual zfcp paths found as required below @@ -81,9 +81,14 @@ install() { for_each_host_dev_and_slaves_all check_zdev sed -i -e 's/^\[active /\[persistent /' "$_tempfile" + ddebug < "$_tempfile" + # Apply via --import to prevent other devices from being configured chzdev --import "$_tempfile" --persistent --base "/etc=$initdir/etc" \ - --yes --quiet --no-root-update --force >/dev/null + --yes --no-root-update --force 2>&1 | ddebug + + lszdev --configured --persistent --info \ + --base "/etc=$initdir/etc" 2>&1 | ddebug rm -f "$_tempfile" diff --git a/zdev/dracut/95zdev/module-setup.sh b/zdev/dracut/95zdev/module-setup.sh index c2592553..95351d64 100644 --- a/zdev/dracut/95zdev/module-setup.sh +++ b/zdev/dracut/95zdev/module-setup.sh @@ -90,16 +90,21 @@ install() { --quiet 2>/dev/null >> "$_tempfile" done + ddebug < "$_tempfile" + # Apply via --import to prevent other devices from being configured chzdev --import "$_tempfile" --persistent --base "/etc=${initdir:?}/etc" \ - --yes --quiet --no-root-update --force >/dev/null + --yes --no-root-update --force 2>&1 | ddebug # Apply site-specific configurations via --import for (( site=0; site<10; site++ )) do chzdev --import "$_tempfile" --persistent --base "/etc=$initdir/etc" \ - --site $site --yes --quiet --no-root-update --force >/dev/null + --site $site --yes --no-root-update --force 2>&1 | ddebug done + lszdev --configured --persistent --info \ + --base "/etc=$initdir/etc" 2>&1 | ddebug + rm -f "$_tempfile" return 0