zdev/dracut: respect hostonly mode choice

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 <mhartmay@linux.ibm.com>
Acked-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Acked-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Steffen Maier
2023-08-28 19:54:46 +02:00
committed by Jan Höppner
parent 7bec672c7e
commit 7ecfe2353f

View File

@@ -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