Rebuilding a single kernel module
I need to make a small change and rebuild just one module in the Gutsy distribution.
How do I do this without building the kernel or the other modules? I want to just manually replace the module in my /lib/module tree. How can I be sure it will be versioned consistantly so that the kernel won't complain at load time? Ubuntu uses a Debian style make-kpkg for its builds. |
Do you want to create an installable package from this module, or just replace the existing one? Rebuilding the modules separate from the kernel is as easy as "make modules" in the kernel build directory. From there you could either install them all, or just manually replace the one you rebuilt (though there is really no reason not to replace them all).
As long as the modules are built against the same source tree as the running kernel, they will install fine on the official Ubuntu binary kernel (I.E. make sure you get the kernel source package from the Ubuntu repositories, and not just try and download the vanilla kernel). But, again, if you want to make an installable package out of these (create a new kernel module package to replace the current one, for example) then there will be more steps involved. Depending on what your needs are, you might not need to actually go that far. |
I just want to build the single "ko" file, not the package. However, I would like not to build all the kernel modules, just the one I want.
|
Quote:
|
Quote:
If I need to make the change each time there is a kernel update, I would prefer to just build the one module I need to change. |
Quote:
In any case, you can always force the rebuild of a particular module with make as well (by passing the pathname to make). E.g., if I want to rebuild the rtc.ko module, I would type the following: Code:
$ make drivers/char/rtc.ko If you ever need quick help with the kernel make system, “make help” will explain most of the targets. |
I've detailed this here: http://www.pixelbeat.org/docs/rebuil...el_module.html
|
I am assuming Ubuntu is the same as Debian in the following:
If you look in the file "Makefile" you will find this: Quote:
Quote:
Code:
make M=drivers/ata You might want to consider adding your distro to your LQ options. |
All times are GMT -5. The time now is 06:01 AM. |