【发布时间】:2016-08-18 18:16:37
【问题描述】:
我正在使用运行 linux 内核 4.4.0 系列的 Ubuntu 16.0.4 LTS。 我对 i2c-ocores 代码和 eeprom 驱动程序进行了一些更改,并重新构建了整个内核。然后我安装了新构建的内核。
我使用以下步骤构建内核:
1. sudo apt-get source linux-image-$(uname -r)
2. Applied my changes to i2c-ocores and eeprom driver
3. sudo chmod a+x debian/scripts/*
4. sudo chmod a+x debian/scripts/misc/*
5. sudo fakeroot debian/rules clean
6. sudo fakeroot debian/rules editconfigs
a. Checked all the options for i2c driver
7. sudo fakeroot debian/rules binary-headers binary-generic skipabi=true skipmodule=true
8. Installed all the .deb packages created by the build.
安装新内核后,我重新启动机器并插入i2c-ocores 和eeprom 驱动程序,它们运行良好。但是在重新启动四五次之后,我插入这些驱动程序失败了。我正在使用modprobe 插入模块。
与 i2c-ocores 一样,我收到以下错误:
Aug 18 11:08:14 manik kernel: [ 214.831678] i2c_ocores: disagrees about version of symbol i2c_new_device
Aug 18 11:08:14 manik kernel: [ 214.831682] i2c_ocores: Unknown symbol i2c_new_device (err -22)
Aug 18 11:08:14 manik kernel: [ 214.831700] i2c_ocores: disagrees about version of symbol i2c_del_adapter
Aug 18 11:08:14 manik kernel: [ 214.831701] i2c_ocores: Unknown symbol i2c_del_adapter (err -22)
Aug 18 11:08:14 manik kernel: [ 214.831708] i2c_ocores: disagrees about version of symbol i2c_add_adapter
Aug 18 11:08:14 manik kernel: [ 214.831709] i2c_ocores: Unknown symbol i2c_add_adapter (err -22)
有人知道这里发生了什么吗?我是不是做错了什么?
【问题讨论】:
-
你不需要重新编译整个内核。
-
@AndyShevchenko - 我如何在这个 ubuntu 设置中单独构建这些模块?
-
@AndyShevchenko 我认为问题不在于我构建模块的方式,因为我正在构建整个内核本身。
-
不清楚你为什么这样做,为什么你经常重启机器。通常情况下不需要所有这些,尤其是。当你为正在运行的内核构建模块时。
-
关于模块化构建有很多文章和示例。谷歌它或使用您的 Makefile、源模块目录布局等创建一个新问题。
标签: linux-device-driver kernel-module ubuntu-16.04