From: Tomas Bzatek Date: Tue, 3 Jun 2025 16:34:39 +0000 (+0200) Subject: improvement(74nvmf): lookup required NIC kernel modules for NBFT interfaces X-Git-Tag: 109~151 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=82f7f7d;p=thirdparty%2Fdracut-ng.git 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 --- 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