I need to do TX2 kernel trim & port,but I know nothing about these module functions and feature. Would someone help me?

Hello,I need to do TX2 kernel trim & port.I use the command “lsmod” and list these modules:
fuse
snd_usb_audio
snd_usbmidi_lib
snd_hwdep
uvcvideo
videobuf2_vmalloc
bcmdhd
pci_tegra
bluedroid_pm
I do not know the functions and relationships for each other, so I am not sure which one or some to keep?
Would somebody help to give me some descriptions for these module functions and relationships?

thanks!!

I’m not sure what you mean by “trim” or “port”…it sounds like you’re trying to make a minimal system.

FYI, modules are just features loaded as a module. Most features are integrated (but have the option to be a module or to be integrated). To see what your kernel is configured to support:

zcat /proc/config.gz

(and I suggest always saving a copy of config.gz on any system where you might work on the kernel…this is a reflection of the current running kernel’s config, and if you were to custom compile a kernel you’d want to start with this)

In a kernel config the “=y” is integrated and will not show up in lsmod. The “=m” is built as a module, and if the module is present and loaded, then the module will show up in lsmod. Modules are always searched for at:

/lib/modules/$(uname -r)/

If you build your own kernel, then “uname -r” is a combination of the base kernel version (e.g., “4.4.38”) and the CONFIG_LOCALVERSION of the config at time of build (default in a Jetson is “-tegra”…thus the default “uname -r” is “4.4.38-tegra” and modules are somewhere in “/lib/modules/4.4.38-tegra/”…the subdirectory corresponds to the kernel source tree location where the module is output).

hi linuxdev,
Thanks for your reply. yeah,I am trying to make a minimal system for TX2. I want to know the function description for these modules(fuse\snd_usb_audio\snd_usbmidi_lib\snd_hwdep\uvcvideo\videobuf2_vmalloc
\bcmdhd\pci_tegra\bluedroid_pm),what roles do they play in a actual test project. Would you kindly to give me some suggestions or some these modules useage manuals?

thanks!!

Sorry, I don’t know of a single method to find everything you want. Consider what follows to be a methodology and not an answer.

For modules which are a part of the publicly distributed kernel you will find many modules are documented in the “Documentation/” subdirectory of the kernel source. Consider using source_sync.sh (in the “Linux_for_Tegra/” directory of the driver package on the PC host…but this can be copied to a Jetson and run there) to download a kernel via the L4T tag, e.g.:

./source_sync.sh -k tegra-l4t-r28.2.1

Most modules found in “/lib/modules/(uname -r)/" will be in a location which is a relative match to where they are in the actual kernel source. Think of "/lib/modules/(uname -r)/kernel/” as the root of the kernel source. Think of “/lib/modules/$(uname -r)/kernel/fs/fuse/” (containing “fuse.ko”) as coming from the kernel source “fs/fuse/” directory (Kconfig within this talks about specific modules built in this directory).

As an example, “snd_usb_audio” typically means look in the “sound/usb/” subdirectory of kernel source, and the Kconfig file will define what is selected specific to “SND_USB_AUDIO”. The files built by this particular module would be in this subdirectory (or deeper if the config is just to define other configs). For SND_USB_AUDIO in Kconfig this message is what “make menuconfig” would show as a result of that Kconfig entry:

config SND_USB_AUDIO
        tristate "USB Audio/MIDI driver"
        select SND_HWDEP
        select SND_RAWMIDI
        select SND_PCM
        select BITREVERSE
        help
          Say Y here to include support for USB audio and USB MIDI
          devices.

          To compile this driver as a module, choose M here: the module

If you don’t find what you want related to this in the “Documentation/” subdirectory (“cd /where/ever/it/is/kernel/Documentation; egrep -R -l SND_USB_AUDIO”), or if that documentation is not sufficient, then you might need to do a google search (often such searches just return the information from the Kconfig so google won’t necessarily be a fast way to know more about a feature).

Note that if you have a running system and lsmod shows the module, then it is likely something is using it. If you have a module which isn’t loaded, then likely you can remove it (save a copy of “/proc/config.gz” before you start changing things…you’ll want the original config in a safe spot).

It isn’t unusual for http://www.wikipedia.org to have a good description, though you’d have to go through the “deobfuscation” page. If you go to wikipedia and search for “linux fuse” (https://en.wikipedia.org/wiki/Special:Search?search=linux+fuse&go=Go&searchToken=a1d9tf7o641i26vkdiatxjts8), then you will end up with the choice of looking at several file system pages. You’d end up (after possibly reading some of the wrong ones) that the kernel option is a file system option (https://en.wikipedia.org/wiki/Filesystem_in_Userspace). You’ll see fuse on every live DVD distribution made, and also often with various GUI window managers. If you have any GUI login you probably can’t remove FUSE without removing many window managers. If you are running only console or some simpler window managers, then you can probably remove FUSE.

Because the kernel isn’t put in via a dpkg tool (it’s part of the custom NVIDIA setup) you can’t use “dpkg -S /where/ever” to find owners of modules, but you can still run commands such as “apt search fuse”, and if you have the sanity to look through all of the results, you’ll notice:

fuse/xenial-updates,now 2.9.4-1ubuntu3.1 arm64 [installed,automatic]
  Filesystem in Userspace

…or…

apt list fuse

If you come up with specific questions about modules or kernel configs someone can probably help, but mostly it’s just a lot of work to find out what a feature is and whether or not it can be removed.