warewulf / warewulf3

Warewulf is a scalable systems management suite originally developed to manage large high-performance Linux clusters.
107 stars 45 forks source link

Update provision/initramfs/detect #176

Open bensallen opened 5 years ago

bensallen commented 5 years ago

provision/initramfs/detect uses a fairly naive approach of matching device modalias against the kernel's modules.alias to find the kernel modules to load.

Example of detect's logic failing to find an Intel Optane drive to load the nvme kernel module:

$ PCI=/sys/bus/pci/devices/0000\:05\:00.0
$ VENDOR_1=`cat $PCI/vendor`
$ DEVICE_1=`cat $PCI/device`
$ ALIAS=`printf "v%08xd%08x\n" $VENDOR_1 $DEVICE_1`
$ echo $ALIAS
v00008086d00002701
$ grep -i "$ALIAS" /lib/modules/$(uname -r)/modules.alias | awk '{print $3}'
# grep nvme /lib/modules/$(uname -r)/modules.alias
alias pci:v*d*sv*sd*bc01sc08i02* nvme
alias pci:v0000144Dd0000A822sv*sd*bc*sc*i* nvme
alias pci:v0000144Dd0000A821sv*sd*bc*sc*i* nvme
alias pci:v00001C5Fd00000540sv*sd*bc*sc*i* nvme
alias pci:v00001C58d00000023sv*sd*bc*sc*i* nvme
alias pci:v00001C58d00000003sv*sd*bc*sc*i* nvme
alias pci:v00008086d00005845sv*sd*bc*sc*i* nvme
alias pci:v00008086d0000F1A5sv*sd*bc*sc*i* nvme
alias pci:v00008086d00000A55sv*sd*bc*sc*i* nvme
alias pci:v00008086d00000A54sv*sd*bc*sc*i* nvme
alias pci:v00008086d00000A53sv*sd*bc*sc*i* nvme
alias pci:v00008086d00000953sv*sd*bc*sc*i* nvme
alias nvmet-transport-254 nvme_loop
alias nvmet-transport-1 nvmet_rdma
# cat $PCI/modalias
pci:v00008086d00002701sv00008086sd00003905bc01sc08i02

Likely approach:

    find /sys/devices -name modalias -print0 \
        | xargs -0 sort -u \
        | xargs modprobe -a -q -b 2>/dev/null
renatopancheri commented 4 years ago

same problem with a WD black, kernel centos7.7 3.10.0-1062.18.1.el7.x86_64, ALIAS = v000015b7d00005002 MODALIAS = pci:v000015B7d00005002sv000015B7sd00005002bc01sc08i02 and same entry matches, temporary solution used is: drivers += kernel/drivers/nvme/host (saw from ohpc repo they added this one) modprobe += nvme in bootstrap.conf

I should have some days where i can do tests if you want.