LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 03-31-2007, 04:34 PM   #1
stabu
Member
 
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Blog Entries: 5

Rep: Reputation: 32
word to the wise: when recompiling same kernel version, watch your /lib/modules/!


Wow, have I had a bit fun today. I was deploying a new iptables script which looked for IP_CONNTRACK which I noticed I did not have set up in the kernel so I decided to recompile.

It's been a while since I recompiled, but it took longer than expected (considering the small change I made) but anyhow, I rebooted with the new kernel image and I got problems, so I said, OK, it's a bigger problem than I thought, leave it for another day.

So I tried to boot back into my old kernel image. No reason for it not to work, right? I've done this tons of times with no problems.

However, I did get a problem. A segmentation fault, no less, during the running of rc.inet1. The process at fault (it says) is dhcpcd. The problem is real similar to Charred's here: http://www.linuxquestions.org/questi...d.php?t=355452

This caught me by surprise. The old kernel image must have been affected the recompile of the new image. I had not thought of this before. I mean, if you compile a new version of the kernel, a new directory with the version number is created in /lib/modules. But if you recompile the exact same version of the kernel (maybe because of minor change) the /lib/modules/$(VERSION_NUMBER) directory is written over with the new modules. The old kernel image will use this newly written directory

Now I am wisened on to this, in future I think I will take a copy of the old /lib/modules/$(VERSION_NUMBER) directory just in case stuff like this happens.

Of course, I have yet to find out what exactly happened. How could the modules get so mucked up during a recompile? Of course, I'm only at an early stage of troubleshooting. I'm just really surprised I hadn't come across this problem before.
 
Old 03-31-2007, 05:16 PM   #2
arcanex
Member
 
Registered: Mar 2007
Posts: 41

Rep: Reputation: 15
Unless you did a 'make modules_install', it shouldn't have copied the recompiled kernel modules over to '/lib/modules'
 
Old 03-31-2007, 05:52 PM   #3
bl0tt0
Member
 
Registered: Aug 2005
Location: The Glorious People's Republic of Austin
Posts: 145

Rep: Reputation: 21
best solution to this kind of problem is to add a localversion string to the kernels you compile. It's the first option in General Setup. I've made it a habit to just put the date in as the localversion string. That way, whenever you make modules_install, a new directory is creating in /lib/modules with the date as an additional string. It definitely makes it easier to keep things clean.
 
Old 04-01-2007, 02:54 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,775

Rep: Reputation: 481Reputation: 481Reputation: 481Reputation: 481Reputation: 481
I usually just change the name of the directory with the original modules just before running make modules_install.
The error you got probably came about because of hard-linking a feature which also has a module installed. modprobe tries to install the module, but the feature is already in the kernel so you get all kinds of paging and memory allocation errors.
 
Old 04-01-2007, 09:29 AM   #5
stabu
Member
 
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Blog Entries: 5

Original Poster
Rep: Reputation: 32
Many thanks for the replies!

Yes, a little too much fiddling was to blame. I've got it all back now, with a new, further slimmed down version of my kernel.
 
Old 04-02-2007, 06:26 AM   #6
LazyP
Member
 
Registered: Jun 2005
Location: Athens GR
Distribution: Slackware 10.2
Posts: 43

Rep: Reputation: 15
Apart from appending a localstring for every kernel compilation, you should check whether you really need to recompile. If you want just another module you don't have to recompile the whole kernel. Just compile the module instead. Do a make help to get further instructions.
 
Old 04-03-2007, 07:59 AM   #7
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,469
Blog Entries: 4

Rep: Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525
Hi,

Just change the ExtraVersion to something unique in the Makefile. That way you will have modules for that compile session.
 
Old 04-03-2007, 12:07 PM   #8
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
stabu : The reason you ran into problems could be because the System.map is different for both the kernels?
 
  


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
/lib/modules/kernel-2.6.19.2 -- lost deadlinx Linux - Kernel 8 03-27-2007 01:24 PM
forget to install modules after recompiling kernel janos Suse/Novell 3 05-28-2006 08:17 AM
LXer: A Word-Wise Firefox Extension LXer Syndicated Linux News 0 02-09-2006 06:46 PM
no lib/modules/2.6.13 after kernel compile Motown Slackware 2 09-07-2005 08:59 AM
recompiling kernel goes fine, problem with make modules fritex Linux - Software 4 11-07-2002 11:17 PM


All times are GMT -5. The time now is 12:59 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration