Module automatic loading

Hello, I want to know, if you enter the command “lsmod” on the development board, the automatically loaded modules will be displayed, where is it set? Thank you!!

Hi Yolomei,

lsmod will show the loadable kernel modules which are currently loaded.
They could be set up in Kconfig.

You could also use insmod to insert modules into the kernel.

What I want to ask is how loadable modules are loaded. For example, the spiderv.ko module in the following directory is automatically loaded in R32.5.1. If it is not loaded automatically, I can use the command “sudo modprobe spider” to load it manually. Where is the automatic loading command set.


You could set up the module which you want it automatically loaded in the following configuration file.


So what should I do if I want to cancel automatic loading of loaded modules?
This file does not contain the corresponding settings of the auto-loading module.

This configuration file is used to add kernel module automatically loaded at every boot. If the module which you want to disable auto loaded is not contain here, you might need to disable it in kernel and re-compile.

Are you using R32.5.1 on Xavier NX?
Which module do you want to disable?

After the driver is compiled into a module, it should be loaded manually before it can be used. Now it can only be loaded automatically?

Yes, if I want to disable the automatic loading of the spiderv.ko module, and then manually load this module myself.

If you select y in kernel config, the kernel module would built-in module and it would be loaded automatically.
If you select m in kernel config, the kernel module would external module, and could be manually loaded with modprobe, insmod command.

Just set CONFIG_SPI_SPIDEV as external module (m) for spiderv.ko module.

I selected m in the kernel module. Can I automatically load this module without entering commands in the development board? Where are the relevant settings

Just add spiderv in the following configuration file.


which you could also seen in rootfs of your source

The problem is that it has been automatically loaded. I want to remove the automatic loading on the basis that the kernel configuration has selected m

  • What is in your file “/etc/modules” (you can attach it to the forum)?
  • What files are in “/etc/depmod.d”?
  • What files are in “/etc/modules-load.d”?
  • What files are in “/etc/modprobe.d”?
  • Is your particular module listed in any of those files?

For example, I don’t want spiderv.ko to load automatically after powering on.


Hi Yolomei,

Please use current R32.7.3 release.

I’ve verified this release on Xavier NX devkit.
spidev should not be loaded automatically at boot up.

I have replaced R32.7.2 and will still load automatically.
What I want to ask is, where is the automatic loading set? Can it be removed.

I have no idea about where this module (spidev) be loaded.
Automatic loading setting of kernel module for user to use is located in /etc/modules-load.d/nv.conf

Or you could try modifying the following compatible property in tegra194-p3668-common.dtsi

- compatible = "spidev";
+ compatible = "tegra-spidev";

I will suggest that you can blacklist a module, and still manually load it (it just won’t be loaded automatically). You need this file:
(you might already have this)

Add a line similar to this to name the module (end of the file is best):
blacklist spidev

Yes, that’s all right. Thank you!!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.