LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (http://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   modify kernel source without recompiling modules? (http://www.linuxquestions.org/questions/linux-kernel-70/modify-kernel-source-without-recompiling-modules-635518/)

scottbiker 04-15-2008 11:09 AM

modify kernel source without recompiling modules?
 
Hi,

I've modified a source file in the linux kernel, and I would really like to use it without recompiling the modules.
At first sight, everything seems to work, but is it really safe to do this?
When I look at the System.map files of both kernels, I see that several symbols have changed location.
Can somebody explain to me how much they depend on each other?

=> Note: it concerns a small embedded system with only 2 modules

Thanks!

unSpawn 04-15-2008 07:49 PM

Quote:

Originally Posted by scottbiker (Post 3122032)
I've modified a source file in the linux kernel, and I would really like to use it without recompiling the modules. At first sight, everything seems to work, but is it really safe to do this?

The kernel source gets compiled and once it's up and running you shouldn't force changes. Besides, modifying a source file has no relation to the running kernel. But maybe I don't understand what you've done. Could you explain in detail what it is you have done?


Quote:

Originally Posted by scottbiker (Post 3122032)
When I look at the System.map files of both kernels, I see that several symbols have changed location. Can somebody explain to me how much they depend on each other?

See the external link at the bottom of http://en.wikipedia.org/wiki/System.map

scottbiker 04-16-2008 02:37 AM

I've recompiled the kernel (fixed a bug), and I'm using this new kernel.
Now I'm wondering whether it is mandatory to recompile the kernel modules again (I prefer not to recompile the modules, because they are in a separately upgradable package for this embedded system).

People often say, that whenever you recompile a kernel you have to recompile the modules. But is this true?
When I recompile a modules against this modified kernel, the only change I see in the binary object is the date.
Or do you only have to recompile the modules after you have changed the .config for this kernel?

Thanks

unSpawn 04-18-2008 07:50 AM

I never encountered that situation where I would change functionality, recompile the kernel but not the modules. Let's say that if it works it works, if it doesn't then you know wat to do...

omesh 05-19-2008 02:42 AM

i have always compiled the modules also when i am compiling the kernel but i dont know whether it is necessary or not...

sundialsvcs 05-21-2008 09:14 PM

When you load a module, it becomes "part of the kernel." To my way of thinking, it's just smart to make sure that every "part of the kernel" has been recompiled as-needed. It should not take a significant amount of wall-time to "make" both the resident kernel and the modules. Then, you know.

Bottom line: "yeah, maybe you could, but why would you want to take the chance?" Why bother?

scottbiker 05-22-2008 01:39 AM

In fact, time is no concern in my case.
I'm dealing with an embedded platform, for which the kernel and the modules are in a separately upgradable package (kernel = a kernel image, modules = on the ramdisk image).
My main concern is, if there would be problems if the kernel is upgraded, and the modules are not upgraded (I didn't redo a 'make menuconfig' or so, I just modified one source file). So I would like to know if there could be compatibility issues.

And indeed, 'try if it works' is one approach, but why not try to understand the mechanics behind it?
My experience says:
- if you modify a source in the kernel, you don't have to rebuild the modules
- if you change the kernel configuration (make menuconfig), you have to rebuild the modules
Why is that?
=> Is there a kind of relocation table that is modified while doing a 'make menuconfig' ?
=> apart from that relocation table (if there would be any), all exported kernel symbols may change place, because linking happens dynamically (while loading the module) ?

I still hope that somebody can give some background info here, thanks!


All times are GMT -5. The time now is 10:31 AM.