From 82f7f7df20ef9ecd1c63a533b018d490a23ca543 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Tue, 3 Jun 2025 18:34:39 +0200 Subject: [PATCH] improvement(74nvmf): lookup required NIC kernel modules for NBFT interfaces When dracut is called with '--hostonly-mode strict' and perhaps even with --hostonly-nics '' as done by kdump/mkdumprd, all the kernel modules related to hostonly networking are stripped down. In such a case it is viable to lookup and install the required kernel modules ourselves, based on any currently present nbft interfaces. Note: the lookup depends on the current 'nbftX' network interface naming. Signed-off-by: Tomas Bzatek --- modules.d/74nvmf/module-setup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules.d/74nvmf/module-setup.sh b/modules.d/74nvmf/module-setup.sh index cf7c35ce2..3e64ef745 100755 --- a/modules.d/74nvmf/module-setup.sh +++ b/modules.d/74nvmf/module-setup.sh @@ -72,6 +72,14 @@ installkernel() { hostonly=$(optional_hostonly) instmods nvme_fc nvme_tcp nvme_rdma lpfc qla2xxx # 802.1q VLAN may be set up in Firmware later. Include the module always. hostonly="" instmods 8021q + # lookup NIC kernel modules for active NBFT interfaces + if [[ $hostonly ]]; then + for i in /sys/class/net/nbft*; do + [ -d "$i" ] || continue + _driver=$(basename "$(readlink -f "$i/device/driver/module")") + [ -z "$_driver" ] || instmods "$_driver" + done + fi } # called by dracut -- 2.47.3