![如何在 22.04 上加载和安装 i2c-dev 内核模块?](https://linux22.com/image/1194790/%E5%A6%82%E4%BD%95%E5%9C%A8%2022.04%20%E4%B8%8A%E5%8A%A0%E8%BD%BD%E5%92%8C%E5%AE%89%E8%A3%85%20i2c-dev%20%E5%86%85%E6%A0%B8%E6%A8%A1%E5%9D%97%EF%BC%9F.png)
user@desktop:~/ddcci-plasmoid$ find /lib/modules/$(uname -r) -name i2c-dev
• 不返回任何内容
user@desktop:~/ddcci-plasmoid$ lsmod | grep i2c_dev
• 不返回任何内容
答案1
你不知道!
默认情况下,i2c-dev
它被编译到内核中,而不是作为单独的模块,这就是为什么你找不到它。
搜索内核头文件grep -R i2c-dev /usr/src/linux-headers-$(uname -r)/
通常是一个有用的技巧,可以发现这类东西,这就是我在其中发现它的方法drivers/i2c/Kconfig
:
config I2C_CHARDEV
tristate "I2C device interface"
help
Say Y here to use i2c-* device files, usually found in the /dev
directory on your system. They make it possible to have user-space
programs use the I2C bus. Information on how to do this is
contained in the file <file:Documentation/i2c/dev-interface.rst>.
This support is also available as a module. If so, the module
will be called i2c-dev.
您可以通过运行以下命令来确认它是否内置:grep I2C_CHARDEV /boot/config-$(uname -r)
,该命令将返回:
CONFIG_I2C_CHARDEV=y
而不是像模块那样:
CONFIG_I2C_CHARDEV=m