From 7bec672c7e7c78603f7d4ce007ed457e0ec5b198 Mon Sep 17 00:00:00 2001 From: Steffen Maier Date: Thu, 11 May 2023 19:35:14 +0200 Subject: [PATCH] zdev/dracut: fix kernel module install even for hostonly mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise, dracut skips modules that are "not hostonly", i.e. not used / loaded on the system when running dracut to build an initrd. Without the fix, zdev device auto configuration only works for device types for which a device driver happened to be loaded when building an initrd. Likewise for specifying rd.* boot options. Hostonly mode is often the default in Linux distributions. Make zdev device auto configuration work nonetheless without users having to know about and tweak dracut modes for initrd generation. On the typical sloppy hostonly mode, the code disables hostonly for installing kernel modules. This covers building regular initrds, where zdev device auto configuration should even work for device types, for which device drivers were not loaded when an initrd was generated. This can happen when new devices of new types are configured for a DPM logical partition. Also, users could want to start using dracut cmdline options rd.{dasd,zfcp,znet} for a device type that was not used when the initrd was built. The special strict hostonly mode is used by some kdump implementations. In that case, hostonly remains in effect intentionally because only support for the really required devices as determined by dracut module 95zdev-kdump should be included in a kdump initrd due to the memory-constrained kdump environment. Cf. commit 73c46a30563d ("zdev/dracut: fix kdump by only activating required devices"), which also provides more references on strict hostonly mode. Even for non-kdump cases, let strict hostonly mode be effective here in 95zdev in case some future use case appears for this special mode beyond kdump. Github-ID: https://github.com/ibm-s390-linux/s390-tools/pull/158 Reviewed-by: Alexander Egorenkov 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/zdev/dracut/95zdev/module-setup.sh b/zdev/dracut/95zdev/module-setup.sh index cef1e2c9..f4d267cc 100644 --- a/zdev/dracut/95zdev/module-setup.sh +++ b/zdev/dracut/95zdev/module-setup.sh @@ -43,6 +43,7 @@ depends() { installkernel() { # Add modules for all device types supported by chzdev (required for # auto-configuration) + hostonly="$(optional_hostonly)" \ instmods ctcm lcs qeth qeth_l2 qeth_l3 dasd_mod dasd_eckd_mod dasd_fba_mod \ dasd_diag_mod zfcp }