linux源代码-.有一个模块在config /boot/config-3.4-主干-686-pae中禁用,因此它不是linux映像的一部分-.(这是关于Debian的,但是对于Ubuntu来说,解决方案应该是相同的,或者?)。
# CONFIG_CAN_PEAK_USB is not set如何只编译这个内核模块,以便它可以与分布式内核一起使用?
各自的linux源代码-.包已经安装、解压缩并链接到/usr/src/linux。/boot/config-3.4-主干-686-pae被复制到/usr/src/linux/.config,并使用
CONFIG_CAN_PEAK_USB=m使用
make
make modules可以编译内核和所有模块。但是,如何只编译特定的单个模块呢?
(注意:还需要在编译之前编译内核,否则会出现以下错误:no symbol version for module_layout)
发布于 2013-08-28 14:09:34
我也有同样的问题。我假设您不仅需要复制.config,还需要复制Module.symvers
我的编译模块ft1000的步骤(运行Debian 7.1.0;内核3.2.04-6866-PAE):
aptitude install linux-headers-3.2.0-4-686-pae
aptitude install linux-source-3.2
cd /usr/src/
tar xjf linux-source-3.2.tar.bz2
cd /usr/src/linux-source-3.2
cp ../linux-headers-3.2.0-4-686-pae/Module.symvers .
make oldconfig # it copies .config to ./
vi .config # enable ft1000 module: CONFIG_FT1000=m
make prepare # setup FT1000 as module
make modules_prepare
make SUBDIRS=scripts/mod
make SUBDIRS=drivers/staging/ft1000/ft1000-usb modules
cp drivers/staging/ft1000/ft1000-usb/ft1000.ko /lib/modules/3.2.0-4-686-pae/kernel
/drivers/staging/
depmod
modprobe ft1000发布于 2012-07-26 08:38:57
从顶层源目录中,只需给出通往模块名称或模块目录的路径,例如:
make drivers/net/can/usb/peak_usb/或者更简单的例子(英特尔e1000以太网驱动程序):
make drivers/net/ethernet/intel/e1000/e1000.ko发布于 2019-10-21 11:47:48
简单如:(本例演示了ft1000驱动程序,如果不是即时的话,只需几分钟)
cd /usr/src/kernel-sources
make SUBDIRS=drivers/staging/ft1000/ft1000-usb modules
# Enable the ft1000 module: CONFIG_FT1000=m on the config with
make xconfig # or "make menuconfig" then save
make prepare
make modules_prepare
make SUBDIRS=scripts/mod
make SUBDIRS=drivers/staging/ft1000/ft1000-usb modules
make SUBDIRS=drivers/staging/ft1000/ft1000-usb modules_install然后,您可以在modprobe之后加载depmod模块。
注意:根据模块依赖关系,您可能需要完全重新构建内核。
https://askubuntu.com/questions/168279
复制相似问题