From 7e8126704b32f78b1f7ea3618b19cfc6c3c11df0 Mon Sep 17 00:00:00 2001 From: Steffen Maier Date: Mon, 23 Jan 2023 15:57:08 +0100 Subject: [PATCH] zdev/dracut: fix to not depend on existing chzdev persistent config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dracut knows exactly what dependencies it needs. Do not break it by accidentally missing parts in the chzdev persistent configuration (/etc/udev/rules.d/41-*.rules). Depicted as mathematical sets: +-------------------------------+ | active | | +---------------------------------+ | | | persistent | | +------------------------------------+ | | | root / kdump dependencies | | | | was | | | | | | missing| zdev so far | DR | | | +------------------------------------+ | | | | | +-------------------------------+ | | | +---------------------------------+ 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/module-setup.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zdev/dracut/95zdev/module-setup.sh b/zdev/dracut/95zdev/module-setup.sh index 5da77327..30c12760 100644 --- a/zdev/dracut/95zdev/module-setup.sh +++ b/zdev/dracut/95zdev/module-setup.sh @@ -30,6 +30,7 @@ check() { # Ensure that required tools are available require_binaries chzdev lszdev /lib/s390-tools/zdev_id || return 1 + require_binaries sed || return 1 return 0 } @@ -75,10 +76,13 @@ install() { cd -P /sys/dev/block/"$_dev" && echo "$PWD" ) _bdevpath=/dev/${_devsysfs##*/} - chzdev --export - --persistent --by-node "$_bdevpath" --quiet \ - --type 2>/dev/null >> "$_tempfile" + chzdev --export - --active --by-node "$_bdevpath" --quiet \ + 2>/dev/null >> "$_tempfile" + #--type # needs a change in chzdev to not have subsequent + # import bail out on unknown type properties } for_each_host_dev_and_slaves_all check_zdev + sed -i -e 's/^\[active /\[persistent /' "$_tempfile" chzdev --export - --persistent --by-attrib "zdev:early=1" --quiet \ --type 2>/dev/null >> "$_tempfile"