From 7ecfe2353f31752d4605306a83c18a369de57168 Mon Sep 17 00:00:00 2001 From: Steffen Maier Date: Mon, 28 Aug 2023 19:54:46 +0200 Subject: [PATCH] zdev/dracut: respect hostonly mode choice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise it risks adding arbitrary persistent configuration of the build host into generic dracut initrds such as those for distro installers. Github-ID: https://github.com/ibm-s390-linux/s390-tools/pull/158 Reviewed-by: Marc Hartmayer 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zdev/dracut/95zdev/module-setup.sh b/zdev/dracut/95zdev/module-setup.sh index f4d267cc..c2592553 100644 --- a/zdev/dracut/95zdev/module-setup.sh +++ b/zdev/dracut/95zdev/module-setup.sh @@ -62,6 +62,11 @@ install() { inst_rules "81-dpm.rules" # Obtain early + root device configuration + + # If enabled, add the host-specific config of required devices into initrd + # shellcheck disable=SC2154 + [[ $hostonly ]] || return 0 + _tempfile=$(mktemp --tmpdir dracut-zdev.XXXXXX) function check_zdev() { local _dev=$1