LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-10-2010, 05:30 PM   #1
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Rep: Reputation: 69
A question about kernel rebuilds...


I did a kernel recompile simply to add pre-emptive kernel. I used the same config that I used before. I'm using kernel 2.6.29.7-smp.

I copied the resulting bzImage, config, and system map over to the /boot directory and updated the symlinks to point to these 3 files.

I then ran lilo -v to update the MBR. This step probably wasn't necessary.

Then when I rebooted the modules that get loaded were giving me errors like

magic 2.6.29.6-smp SMP preempt mod_unload 686 'should be 2.6.29.6-smp SMP mod_unload 686.

So I did some reading and it seems that when I ran 'make modules' it recompiled the modules as 2.6.29.6-smp SMP instead of 2.6.29.6-smp SMP preempt.

1. How do I compile my modules so that they can be SMP preempt?
2. If I have compiled a Nvidia module how can I include that in with the 'make modules' part of the kernel recompile?

The more information you give me the better. It just feels like the kernel recompile process is still a little ambiguous to me and I would really like to fully understand it.

Last edited by trist007; 09-10-2010 at 05:32 PM.
 
Old 09-10-2010, 08:13 PM   #2
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 225

Rep: Reputation: 21
Hello.
1. SMP (Symmetric MultiProcessing) means you have a multicore processor,
preempt means the kernel exist of code snippets that can be run while a maximum timeframe. So the kernel can have time breaks for other tasks, f.e. scheduling - smooth working kernel.
If you have preemption selected in the kernel .config file
( Processor type and features / Preemptible Kernel (Low-Latency Desktop) (PREEMPT) )
it should compile all right.
Sometimes distributions don't install the right .config file. So go though it and maybe you can also optimize this section for your processor. (make xconfig is most comfortable)

2. The kernel has also nvidia modules but that are in the kernel make process so I think you mean a separately compiled nvidia module. - It will be too complicate to do this change to the kernel make process.
What you could do is to move your nvidia module to /lib/modules/kernel_version/extra and run "make modules_install"
The directory extra is kept untouched and is also added/used (file modules.dep).

Thanks for this question - I allway intalled my nvidia driver new - till now !

Last edited by bastl; 09-10-2010 at 08:27 PM.
 
Old 09-11-2010, 11:30 AM   #3
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Original Poster
Rep: Reputation: 69
I reinstalled my computer. I did not format the hard disk. Everything works fine. I wanted to try this kernel recompile from scratch.

I ran 'make mrproper'. To clean up the old make.

Then I figure since all I'm doing is changing those two things, I only have to compile the kernel image so I ran

'make bzImage'. I then created an entry in /etc/lilo.conf point to this new kernel image once it was done and ran

'lilo -v'.

Is this necessary to run lilo?

Anyhow I rebooted and select the new option from lilo boot menu and I got the same errors.

Code:
Sep 11 10:08:38 slackware kernel: snd: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '
Sep 11 10:08:38 slackware kernel: processor: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                      
Sep 11 10:08:38 slackware last message repeated 4 times                                                                                     
Sep 11 10:08:38 slackware kernel: snd_timer: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                      
Sep 11 10:08:38 slackware kernel: thermal: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                        
Sep 11 10:08:38 slackware kernel: snd_pcm: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                        
Sep 11 10:08:38 slackware kernel: snd_hwdep: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                      
Sep 11 10:08:38 slackware kernel: snd_hda_codec: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                  
Sep 11 10:08:38 slackware kernel: snd_hda_intel: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                  
Sep 11 10:08:38 slackware kernel: nvidia: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                         
Sep 11 10:08:38 slackware kernel: nvidia: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                         
Sep 11 10:08:38 slackware kernel: fuse: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                           
Sep 11 10:08:38 slackware kernel: parport: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                        
Sep 11 10:08:38 slackware kernel: parport_pc: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                     
Sep 11 10:08:38 slackware kernel: parport: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                        
Sep 11 10:08:38 slackware kernel: lp: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 ' 
Sep 11 10:08:38 slackware kernel: agpgart: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                        
Sep 11 10:08:38 slackware kernel: fuse: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                           
Sep 11 10:08:38 slackware kernel: fuse: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                           
Sep 11 10:08:39 slackware kernel: ipv6: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                           
Sep 11 10:08:39 slackware kernel: ipv6: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '                                                                                                                                           
Sep 11 10:08:39 slackware kernel: fuse: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '
Sep 11 10:08:40 slackware kernel: fuse: version magic '2.6.29.6-smp SMP mod_unload 686 ' should be '2.6.29.6-smp SMP preempt mod_unload 686 '
So it seems that the libraries I have are for preempt but the modules that I have installed are not preempt.

So what do I need to do?

Do I need to run

'make modules' from within /usr/src/linux ?

Will my system know to check the present .config file and know to compile these modules for preempt? Or is there somewhere I need to specify this?

I really want to understand this. Thanks again.
 
Old 09-11-2010, 03:15 PM   #4
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 225

Rep: Reputation: 21
Quote:
Originally Posted by trist007 View Post
So what do I need to do?
Do I need to run
'make modules' from within /usr/src/linux ?
Will my system know to check the present .config file and know to compile these modules for preempt? Or is there somewhere I need to specify this?

I really want to understand this. Thanks again.
Yes. all is done in the kernel source dir, normal /usr/src/linux where linux is a link to the active kernel dir linux-2.6.x.x.
Do there in a root terminal:
- "make xconfig" to see what the configuration of your kernel is and to add or delete kernel supports and features so preempt, too.
- "make" to make all, the kernel and new added modules. The new kernel is /usr/src/linux/arch/x86/boot/bzImage. You can rename it. Copy or move it to /boot/.
- "make modules_install" to install the newly compiled modules
- What to do with lilo I can guess - it's a long time ago. I think lilo needs to be reinstalled to the MBR if its menu changes - I use grub.

The ".config" file in the linux source dir will be used to build the kernel.
Read the file "README" in the kernel source dir for how to configure a kernel and do all the things.
PREEMPT can be selected in the configuration process. The kernel make process does all that's necessary to run proper with a configuration declared in the ".config" file.
The kernel will ask you what to do if some selected options mismatch.
Not all can be checked so compilation errors can occur ,too.
 
Old 09-11-2010, 04:16 PM   #5
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Original Poster
Rep: Reputation: 69
Ah ok, got it, works now.

I noticed that at the end I ran

make install which ran a script that copied System.map vmlinuz and map over to my /boot directory.

I know the vmlinuz file is the kernel image. What are System.map and map? In lilo I know I specify a map file up at the top. Is that the map file?

What are these two files for exactly?

Also the modules are installed to /lib/modules/{kernel version}.

In this case I have two folders in /lib/modules/. They are 2.6.29.6 & 2.6.29.6-smp. I was using the 2.6.29.6-smp before. However, after I run 'make modules' or maybe after 'make modules_install' I can see that the modules in 2.6.29.6-smp folder are for preempt by running 'modinfo' on any module in that folder.

So does that mean that I cannot run my older kernel image of 2.6.29.6-smp non-preempt anymore?

I would imagine if I set lilo to point to my old kernel image it would load using the non preempt libraries but would only find preempt modules in my /lib/modules/2.6.29.6-smp folder and give me that error I got on my OP.

Any way to have made another folder in the /lib/modules folder called 2.6.29.6-smp-preempt? If so how would I set that up? I'm sure this has been done so that I can select the non-preempt kernel image from lilo at the boot menu.

Also, after I recompiled the kernel and rebooted into the new kernel image I had to recompile the nvidia module for preempt. Any way to set it up so that when I run a kernel recompile again, it recompiles the nvidia module to fit the new kernel version or in this case the same kernel version but with preempt on?

Thanks for all this. It's helping me really understand the kernel recompile process.

Last edited by trist007; 09-11-2010 at 04:32 PM.
 
Old 09-11-2010, 06:21 PM   #6
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 225

Rep: Reputation: 21
Quote:
Originally Posted by trist007 View Post
In lilo I know I specify a map file up at the top. Is that the map file?

What are these two files for exactly?

Also the modules are installed to /lib/modules/{kernel version}.

So does that mean that I cannot run my older kernel image of 2.6.29.6-smp non-preempt anymore?

Any way to have made another folder in the /lib/modules folder called 2.6.29.6-smp-preempt? If so how would I set that up? I'm sure this has been done so that I can select the non-preempt kernel image from lilo at the boot menu.

Also, after I recompiled the kernel and rebooted into the new kernel image I had to recompile the nvidia module for preempt. Any way to set it up so that when I run a kernel recompile again, it recompiles the nvidia module to fit the new kernel version or in this case the same kernel version but with preempt on?
.
I don't know if lilo changed a lot since development is restarted so search the web and you will find anything about lilo.

The file:///boot/System.map is a mirror what the kernel includes and so possibly supports.
That could be a hint for configuring kernel relaying software. I don't know if something really needs it.
- maybe for debugging or if some modules want to know if they can relay on other modules ?

If you want to use a differen module directory than /lib/modules/version then you have to set the environment variable
INSTALL_MOD_PATH before "make modules_install".
type in f.e.: INSTALL_MOD_PATH=/lib/modules/version_SMP_preempt make modules_install.
Each kernel finds its modules if they are not overwritten or deleted.

The nvidia module compiles for kernel version not for a special kernel configuration.
You should not need to recompile the nvidia module if you change the contents of your kernel.
O.K. preempt - but do you want a sever kernel?
Else you can compile it for the loaded / running kernel and put it in modules extra dir of that kernel and do "make modules_install" - ready.
I think preempt is really the only change on which you need to recompile the nvidia module (all modules).
 
Old 09-12-2010, 07:04 AM   #7
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 225

Rep: Reputation: 21
Oh, sorry about INSTALL_MOD_PATH, what you meant is more INSTALL_MOD_DIR.
And it have to be defined after make - I did edit it above.
Read about in the documentations in the kernel source dir.
Some key words:
- module
- modprobe
- kbuild
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
automating module rebuilds on kernel upgrades - for the computer illiterate lurko Debian 6 02-22-2009 06:28 PM
LXer: Microsoft rebuilds open source Sandcastle LXer Syndicated Linux News 0 07-03-2008 12:20 AM
disabling anacrontab and rpm rebuilds AndrewCAtWayofthebit Red Hat 2 06-24-2006 09:57 AM
vmware hates rebuilds DAChristen29 Linux - Software 3 01-20-2003 12:01 AM
Lilo/kernel question & font question phek Linux - General 9 09-18-2001 01:20 PM


All times are GMT -5. The time now is 12:07 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration