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 <tbzatek@redhat.com>
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