Detect kernel modules?
Is it possible to detect hardware needed kernel modules for example to initialize NIC / HDD?
Extend information with kernel module, dependencies and if firmware ist needed?
Hello @pwFoo. I'm afraid it's the kernels job to detect hardware and apply adequate drivers to make it function. Detection rules are actually quite complicated. We wouldn't want to duplicate all that in a simple utility.
Where sysinfo reports driver used is only because the info was provided by the kernel via sys and proc virtual filesystems.
Hi @zcalusic linux systems are read /sys to detect needed kernel modules like that (example alpine linux).
grep -h MODALIAS /sys/bus/*/devices/*/uevent | cut -d= -f2 | xargs modprobe -abq 2> /dev/null
The example get the information needed to initialize the hardware from /sys and pipe it to modprobe to load the kernel modules.
But I don't know how to get just HDD / NIC driver from /sys. Maybe you have an idea? I would need to detect the needed NIC / HDD module with a golang script. So information IS located in /sys, but unclear to me how to searching for ;)