Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect kernel modules? #7

Open
pwFoo opened this issue Nov 12, 2018 · 2 comments
Open

Detect kernel modules? #7

pwFoo opened this issue Nov 12, 2018 · 2 comments

Comments

@pwFoo
Copy link

pwFoo commented Nov 12, 2018

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?

@zcalusic
Copy link
Owner

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.

@pwFoo
Copy link
Author

pwFoo commented Nov 12, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants