Insert linux kernel module statically

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 11:44:10
Roland

Sure, you just need to do a bit of hacking to move the external module into the kernel source tree, tweak the Makefiles/Kconfig a bit so that the code is built-in, and then build your kernel image. For example, let's say you move the module source into drivers/blah. Then you should add a line to then end of drivers/Makefile like

obj-y += blah/

and you should make sure that drivers/blah/Makefile is set up to build your module in, with something like

obj-y += mymodule.o
mymodule-objs := src.o other.o

and so on, where your Makefile is set up however it needs to be to build the particular module you're working on. Note: You have to use the output file name for mymodule-objs and not the input filename!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!