From f8db5317b3c6a4b267db98f8400ff267b21c6f5d Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Wed, 22 Nov 2023 12:40:07 +0100 Subject: [PATCH] feat(multipath): don't add rd.driver.pre= directives to cmdline For multipath to work correctly, the scsi_dh modules must be loaded early after boot (before actually probing any SCSI disks, i.e. before loading any SCSI host adapter drivers), and the dm-multipath module must be loaded before calling multipath or multipathd. We used to achieve this with "rd.driver.pre". This makes assumptions about the distribution's kernel configuration, in particular that the mentioned modules as well the scsi_mod, sd_mod, and sg modules are actually compiled as modules rather than being built-in, and unnecessarily forces loading of the SCSI modules on systems that have no SCSI hardware, or where multipath is disabled via cmdline. On modern Linux systems, we have generic and more transparent ways to configure module loading. It can be achieved via systemd's modules-load.d mechanism or modprobe@.service, or kmod's soft dependencies. Upstream multipath-tools 0.9.7 uses modprobe@.service to load dm-multipath. On-demand loading of SCSI device handlers can be done using modules-load.d, or a soft dependency like this: softdep scsi_mod post: scsi_dh_alua scsi_dh_rdac scsi_dh_emc Instead of hard-coding the early loading of these modules using "rd.driver.pre", leave it up to the distribution to configure it in a generic a way that's consistent with the configuration in the root FS. --- modules.d/90multipath/module-setup.sh | 9 --------- 1 file changed, 9 deletions(-) diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh index 42cc282562..ab0320dd55 100755 --- a/modules.d/90multipath/module-setup.sh +++ b/modules.d/90multipath/module-setup.sh @@ -39,15 +39,6 @@ depends() { return 0 } -# called by dracut -cmdline() { - for m in scsi_dh_alua scsi_dh_emc scsi_dh_rdac dm_multipath; do - if grep -m 1 -q "$m" /proc/modules; then - printf 'rd.driver.pre=%s ' "$m" - fi - done -} - # called by dracut installkernel() { local _arch=${DRACUT_ARCH:-$(uname -m)}