sysinfo icon indicating copy to clipboard operation
sysinfo copied to clipboard

Detect kernel modules?

Open pwFoo opened this issue 7 years ago • 2 comments

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?

pwFoo avatar Nov 12 '18 04:11 pwFoo

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.

zcalusic avatar Nov 12 '18 08:11 zcalusic

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 ;)

pwFoo avatar Nov 12 '18 12:11 pwFoo