LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
LinkBack Search this Thread
Old 04-15-2008, 11:09 AM   #1
scottbiker
LQ Newbie
 
Registered: Apr 2008
Posts: 5

Rep: Reputation: 0
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!
 
Old 04-15-2008, 07:49 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,532
Blog Entries: 51

Rep: Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601
Quote:
Originally Posted by scottbiker View Post
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 View Post
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
 
Old 04-16-2008, 02:37 AM   #3
scottbiker
LQ Newbie
 
Registered: Apr 2008
Posts: 5

Original Poster
Rep: Reputation: 0
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
 
Old 04-18-2008, 07:50 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,532
Blog Entries: 51

Rep: Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601
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...
 
Old 05-19-2008, 02:42 AM   #5
omesh
LQ Newbie
 
Registered: May 2008
Posts: 2

Rep: Reputation: 0
i have always compiled the modules also when i am compiling the kernel but i dont know whether it is necessary or not...
 
Old 05-21-2008, 09:14 PM   #6
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,045

Rep: Reputation: 953Reputation: 953Reputation: 953Reputation: 953Reputation: 953Reputation: 953Reputation: 953Reputation: 953
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?
 
Old 05-22-2008, 01:39 AM   #7
scottbiker
LQ Newbie
 
Registered: Apr 2008
Posts: 5

Original Poster
Rep: Reputation: 0
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does recompiling the kernel overwrite the modules ? ankit4u1 Linux - General 10 07-20-2007 12:33 PM
word to the wise: when recompiling same kernel version, watch your /lib/modules/! stabu Slackware 7 04-03-2007 11:07 AM
forget to install modules after recompiling kernel janos Suse/Novell 3 05-28-2006 07:17 AM
kernel modules when recompiling kernel prozac Linux - General 8 04-13-2006 06:17 AM
recompiling kernel goes fine, problem with make modules fritex Linux - Software 4 11-07-2002 10:17 PM


All times are GMT -5. The time now is 11:33 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration