如何仅重新编译一个内核模块? [英] How to recompile just a single kernel module?
本文介绍了如何仅重新编译一个内核模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
通常,内核源存储在/usr/src/linux-2.6.x/
中.
为了避免在修改模块的源代码时重新编译整个内核,该如何仅重新编译该模块?
Usually kernel source are stored in /usr/src/linux-2.6.x/
.
To avoid to recompile the entire kernel if I modify a module's source, how can I recompile just that module?
推荐答案
切换到源代码树的根目录,然后运行以下命令:
Switch to the root directory of your source tree and run the following command:
$ make modules SUBDIRS=drivers/the_module_directory
并安装已编译的模块:
$ make modules_install SUBDIRS=drivers/the_module_directory
注意:如lunakid所述,后一个命令可能不是先构建模块,所以要小心.
Note: As lunakid mentions, the latter command might not build the module first, so be careful.
这篇关于如何仅重新编译一个内核模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文