# Compile and use new kernel module without rebooting?

## dolphinling

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

----------

## w00ter

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.

----------

## Mantaar

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.

----------

## Genone

 *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.

----------

