Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 03-31-2007, 03:34 PM   #1
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:

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, 04:16 PM   #2
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, 04:52 PM   #3
Registered: Aug 2005
Location: The Glorious People's Republic of Austin
Posts: 156

Rep: Reputation: 26
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, 01:54 AM   #4
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,856

Rep: Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547
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, 08:29 AM   #5
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, 05:26 AM   #6
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, 06:59 AM   #7
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,868
Blog Entries: 27

Rep: Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163Reputation: 2163

Just change the ExtraVersion to something unique in the Makefile. That way you will have modules for that compile session.
Old 04-03-2007, 11:07 AM   #8
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 is different for both the kernels?


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

All times are GMT -5. The time now is 02:51 PM.

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