compiling only one module without recompiling the kernel
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm not sure, but i believe i've read somewhere that you don't have to recompile the whole kernel when you want to compile a module.
Just run make menuconfig (or whatever is your choice of configuring the kernel), select the module you want to compile. Save the kernel options, make dep and make modules && make modules_install. The kernel will not be compiled, only the modules will.
But then again.. I might be wrong
And so that I can learn something too:
IF I'm wrong, please tell me!
That would work if you have previously compiled your kernel in the same source tree. If you haven't or if you have done a make clean. Then all the modules will be recompiled not just one specific module.
Okay, that makes sence. But compiling the modules doesn't take that long unless you have a slow system of course.
I think figuring out how to compile the source of just one module takes longer than compiling all the modules
You should always make your kernel, each time you change any module, and thus allow "make" to figure it all out.
Each module will become "part of the kernel, in every respect," as soon as you install it. Therefore it is imperative that it exactly matches the rest of the installed kernel. There is "a correct way to do it," and you should religiously follow it. Don't try to shortcut.
Yes, allow the makefile to determine module dependencies. Sometimes compiling a single module might need to recompile other parts of your kernel, so never invoke gcc directly on the kernel source tree.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.