From ed106d7f28d95d48d1b6cae10e4fa3325a86472d Mon Sep 17 00:00:00 2001 From: Steffen Maier Date: Thu, 31 Aug 2023 17:03:17 +0200 Subject: [PATCH] zdev/dracut: add site support for early devices to the kdump case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The existing code can already determine the required devices for the actively running system, but this does not work for execution environments in different (disaster recovery) sites. Kdump likely does not notice when running in a different site and does not re-generate the kdump initrd (because the kdump config itself does not change). The new code allows users to explicitly specify devices required for early boot in initrd on different sites. Assuming this is a small number of devices and could even overlap between the root-fs and the kdump case, do not further distinguish those two sets of devices, but simply use the same marker attribute "zdev:early=1" for both cases. With all this site information available at the (initial) kdump initrd generation, the resulting kdump initrd can work on any site without having to re-generate. Complements commit 3c7adcc3c81d ("zdev: dracut: modifiy the module-setup.sh"). Github-ID: https://github.com/ibm-s390-linux/s390-tools/pull/158 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 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/zdev/dracut/95zdev-kdump/module-setup.sh b/zdev/dracut/95zdev-kdump/module-setup.sh index 27fb9d75..7f9a6451 100755 --- a/zdev/dracut/95zdev-kdump/module-setup.sh +++ b/zdev/dracut/95zdev-kdump/module-setup.sh @@ -86,12 +86,27 @@ install() { chzdev --export - --persistent --by-attrib "zdev:early=1" --quiet \ --type 2>/dev/null >> "$_tempfile" + # site support + # Obtain early device configuration for site-specific settings + for (( site=0; site<10; site++ )) + do + chzdev --export - --persistent --by-attrib "zdev:early=1" --site $site \ + --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 --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 --no-root-update --force 2>&1 | ddebug + done + lszdev --configured --persistent --info \ --base "/etc=$initdir/etc" 2>&1 | ddebug