I know that we can check the Linux kernel module dependency at runtime with the lsmod or modprobe command. But what if we only have the kernel code, is there a way to check the kernel module's dependency, or is there any dependency definition in the kernel source code?
Thanks in advance.
You can check the Kconfig entry for the driver. Dependency to external modules, subsystem is specified as
You can find more details in Documentation/kbuild/kconfig-language.txt
For example, if CONFIG_MY_DRIVER
depends on I2C
, you can specify this as depends on
in Kconfig
. This means, if I2C
is not selected in menuconfig, MY_DRIVER
will not show up in menuconfig entry.
Opposite to which, when you use select
, I2C
is automatically selected when selecting MY_DRIVER
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.