View previous topic :: View next topic |
Author |
Message |
dolphinling n00b
Joined: 28 Apr 2005 Posts: 33
|
Posted: Sun Oct 14, 2007 9:39 pm Post subject: Compile and use new kernel module without rebooting? |
|
|
I need to add a feature to my kernel (RTC support, which I had disabled) and while I could do it easily enough by building a whole new kernel and rebooting, I figure it's time for me to learn how to avoid the rebooting step. Unfortunately google isn't being very helpful.
So, I know how to configure and compile my kernel, its modules, and install and use them. I want to know how to use the same source tree to compile only the new modules I need, and install and use those without rebooting.
Thanks in advance,
--dolphinling _________________ dolphinling
«http://dolphinling.net» |
|
Back to top |
|
|
w00ter n00b
Joined: 04 Mar 2005 Posts: 57 Location: Groningen, Netherlands
|
Posted: Sun Oct 14, 2007 10:02 pm Post subject: |
|
|
As far as I know you just look at the kernel you are currently running by typing 'uname -a'. Then look at /usr/src whether the source of that particular kernel is there, probably it is. Then do a 'make xconfig' or a 'make menuconfig' to select your option that you want as a module. Lastly do a 'make && make modules_install' to make the modules and install them. Then do a 'modprobe module_you_wanted´ . That does the trick over here. If you compiled a kernel before with this source, then it will only compile stuff that needs compiling, no 'all over' compiling will take place. |
|
Back to top |
|
|
Mantaar Apprentice
Joined: 17 May 2007 Posts: 219
|
Posted: Sun Oct 14, 2007 10:25 pm Post subject: |
|
|
As long as you didn't change any compiled in information you should be fine. Select your module and compile - though I usually type make modules modules_install. The && is not needed, make can take multiple targets and should resolve any dependencies automatically. You can always see if the module you want to have in place is correctly installed with modprobe -l.
Sometimes this method will fail. You will typically get some messages moaning about "missing symbols" and the like. In this case you'll have to copy your bzImage and reboot as usual. For most modules you should get along fine without rebooting, though. _________________ Error compiling committee.c: too many arguments to function. |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9625 Location: beyond the rim
|
Posted: Mon Oct 15, 2007 9:56 am Post subject: Re: Compile and use new kernel module without rebooting? |
|
|
dolphinling wrote: | So, I know how to configure and compile my kernel, its modules, and install and use them. I want to know how to use the same source tree to compile only the new modules I need, and install and use those without rebooting. |
The only difference is that you don't have to install the kernel (the bzImage). Note that sometimes even if you add an option as module it might require some new symbols in the kernel itself, so it's not always possible to skip the kernel install & reboot. |
|
Back to top |
|
|
|