How to get the list of built-in modules and device drivers in Linux system

Time:2020-10-21

put questions to:The built-in Linux system, and what modules I want to know about each module in the Linux system. Is there any way to get a list of built-in modules and device drivers, and their details?

The modern Linux kernel is growing rapidly over time to support a large number of hardware, file systems, and network functions. During this period, the introduction of “loadable kernel modules” [LKM]) prevents the kernel from becoming more and more bulky, and flexibly extends functions and hardware support in different environments without having to rebuild the kernel.

The kernel of the latest Linux distributions only comes with relatively small “built-in modules”, and other specific hardware drivers or custom functions are used as “loadable modules” for you to selectively load or unload.

Built in modules are statically compiled into the kernel. Unlike loadable kernel modules, which can dynamically load, unload, and query modules using modprobe, insmod, rmmod, modinfo, or lsmod commands, built-in modules are always loaded into the kernel at startup and will not be managed by these commands.

Find the list of built-in modules

To getList of built-in modulesRun the following command.

Copy code

The code is as follows:

$ cat /lib/modules/$(uname -r)/modules.builtin

You can also use the following command to see which built-in modules are available:

Find the built-in module parameters

Each kernel module, whether built-in or loadable, has a series of parameters. For loadable modules, the modinfo command displays their parameter information. However, this command does not work with built-in modules. You will get the following error.

Copy code

The code is as follows:

modinfo: ERROR: Module XXXXXX not found.

If you want to see the parameters of the built-in modules and their values, you can check their contents under / sys / module.

In the / sys / module directory, you can find the subdirectories named for the kernel modules (including built-in and loadable). Enter the directory of each module. There is a “parameters” directory, which lists all the parameters of this module.

For example, you need to find out TCP_ Parameters of cube (the default TCP implementation of the kernel). You can do this:

Copy code

The code is as follows:

$ ls /sys/module/tcp_cubic/parameters

Then read the file to see the values for each parameter.

Copy code

The code is as follows:

$ cat /sys/module/tcp_cubic/parameters/tcp_friendliness

This article will introduce you to this. I believe you will know how to get the list of built-in modules and device drivers of Linux system. I hope you like this article.

Recommended Today

Modify user information changeinfo

When judging the persistence layer: Problem: there is such a problem when modifying user information. For example: the user’s email is not required. It was not empty originally. At this time, the user deletes the mailbox information and submits it. At this time, if it is not empty to judge whether it needs to be […]