WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to find what different kernel modules do?  (Read 1667 times)

Offline flyingfishfinger

  • Jr. Member
  • **
  • Posts: 74
How to find what different kernel modules do?
« on: February 10, 2020, 02:49:58 PM »
Hi,
I want to trim out as much unneeded stuff from the kernel modules as I can while keeping my hardware fully functional. However, beyond the obvious hardware that my machine does not have (i.e the entire "thunderbolt", "parport" or "pcmcia" folders) I do not know how to find what each module does. I want to keep generics like HID (whatever peripherals I might plug in), so checking what modules are loaded on boot doesn't quite get me there.

Case in point: The largest remaining directory is still the "net" one. In it, I have removed all the hardware manufacturers that my Ethernet is NOT (as well as their phys), but there are a lot of large modules remaining whose names don't tell me anything:
- vmxnet3 directory
- ethernet modules in root: dnet, ec_bhf, ethoc, fealnx
- bonding

Other than ask the experts for each module, is there a place I can find what they are for, respectively?

Thanks,
R

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11590
Re: How to find what different kernel modules do?
« Reply #1 on: February 10, 2020, 03:46:15 PM »
Hi flyingfishfinger
I would start by downloading the kernel source package (linux-4.19.10-patched.txz) found here:
http://tinycorelinux.net/10.x/x86/release/src/kernel/
Then unpack it:
Code: [Select]
tar xf linux-4.19.10-patched.txz
Then search the  Kconfig  files for clues:
Code: [Select]
tc@E310:~$ grep --include=Kconfig -ri "bonding" kernel64/linux-4.19.10/drivers/net/
kernel64/linux-4.19.10/drivers/net/Kconfig:       networking core drivers (i.e. VLAN, bridging, bonding, etc.)
kernel64/linux-4.19.10/drivers/net/Kconfig:config BONDING
kernel64/linux-4.19.10/drivers/net/Kconfig:     tristate "Bonding driver support"
kernel64/linux-4.19.10/drivers/net/Kconfig:       'Trunking' by Sun, 802.3ad by the IEEE, and 'Bonding' in Linux.
kernel64/linux-4.19.10/drivers/net/Kconfig:       The driver supports multiple bonding modes to allow for both high
kernel64/linux-4.19.10/drivers/net/Kconfig:       Refer to <file:Documentation/networking/bonding.txt> for more
kernel64/linux-4.19.10/drivers/net/Kconfig:       will be called bonding.
tc@E310:~$
--include=Kconfig ------------------------ Only search through files called Kconfig
-ri ------------------------------------------- Recurse through directories and case insensitive search
"bonding" ---------------------------------- What to search for
kernel64/linux-4.19.10/drivers/net/ ---- Path to search, adjust this to match your path.

You can then look in the  Kconfig  files that are found for more context. The search for  bonding  turned up
"Refer to <file:Documentation/networking/bonding.txt> for more". The  Documentation  directory is part of the source package.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: How to find what different kernel modules do?
« Reply #2 on: February 11, 2020, 03:52:12 AM »
Some info is also available from the modinfo command. "modinfo bonding"
The only barriers that can stop you are the ones you create yourself.