LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Simple Kernel Compile Question. (https://www.linuxquestions.org/questions/linux-software-2/simple-kernel-compile-question-157420/)

murphaph 03-14-2004 05:02 AM

Simple Kernel Compile Question.
 
Hey all,
I've just got a quick one concerning kernel compiling,
How do I save a config file from a known good and working kernel (2.4.7-10) and then load it into xconfig when compiling my new kernel (2.4.25) or is this even possible? The reason I ask is that I'm getting a few problems after booting my new kernel, things not working as they did (adsl in particular). I just need to remove one thing from the old kernel (pcmcia support) as I want to use pcmcia-cs externally you see, so the easiest thing for me to do is use the config from the perfectly working kernel and justremove that one little thing.

Thanks in advance guys, I know there'll be a solution.

Hangdog42 03-14-2004 05:41 AM

It's actually pretty easy.....In fact there are a couple of ways I can think of. The first way is using the make oldconfig command. In theory, that reads your current .config file and uses it. If there are any new settings not addressed by your current .config, it asks. The reason I say "in theory" is that I've been having a lot of trouble with make oldconfig and the 2.6.x series of kernels. It seems to import some, but not all, of my current settings. So that's why I usually go for approach number two. Both make menuconfig and make xconfig give you the option to save your config to a separate file and to read your config from a different file than .config. So I tend to keep a copy of my .config in my /usr/src directory and just have make menuconfig read that. When I'm done making any changes, I save both to the .config in the kernel directory and to my separate config file in /usr/src.

murphaph 03-14-2004 06:05 AM

Thanks a lot hangdog,
One more thing though.....(newbie here)

What's the full path to the existing .config file (the working one the distribution installed) look like?

Can I just install the kernel source RPMs from the redHat CD (as i don't really need to update the kernel, just want to strip out pcmcia card services) and will the .config file be under /usr/src/linux-2.4.7-10/configs ?

Hangdog42 03-14-2004 07:56 AM

I'm not so sure about RH, but in Slackware the installation program drops the config file in /boot. Have a look there. Otherwise, you should always find it in your kernel source directory (since that is where the compiler would look) and I would assume that RH would provide the file used by their kernel. However, at least on my system, the .config file is in the top kernel source directory, not in the config directory. Since it is preceded by the . you have to use ls -a to see it.

murphaph 03-14-2004 09:57 AM

Thanks again hangdog,

I'll give that a try when I get home this evening. I do know that the default RH installation (workstation type) does not install the source code for the kernel, as I had to install it myself last time I (re)compiled. Like I say, I'll take a look later and report on how it goes!

murphaph 03-15-2004 04:48 PM

Good evening,
well, I didn't get arond to replying last night, cos it took a very long time to recompile all those modules!

Ok, the status is much better than last time. Here's how I stand:

Installed the kernel-source from CD and I tried 'make oldconfig' (did a bit of googling to make sure I was giving it the correct .config file!) and did all the other makes and everything seemed to go ok, save a couple of things I did notice at the end of 'make modules' and make modules_install' - I saw a couple of harmless(?) errors there at the end, though I'm sure I'm going to be told nothing is a harmless error! Anyways, it was late so I said I'd chance making the kernel image and away it went. It compiled without reporting errors. Fine, so I edited LILO and she booted into the new kernel, BUT: I got three 'unresolved symbols' errors upon booting. These are:

Mar 15 22:05:04 localhost depmod: *** Unresolved symbols in /lib/modules/2.4.7-10custom/kernel/abi/cxenix/abi-cxenix.o
Mar 15 22:05:04 localhost depmod: depmod: *** Unresolved symbols in /lib/modules/2.4.7-10custom/kernel/abi/ibcs/abi-ibcs.o
Mar 15 22:05:04 localhost depmod: depmod: *** Unresolved symbols in /lib/modules/2.4.7-10custom/kernel/abi/sco/abi-sco.o

I did read PRIOR to compiling that I should move the /lib/modules/2.4.7-10 (my distribution kernel) into /lib/oldmodules/ which i did, or I thought i did but on reflection I think I actually typed: cp /lib/modules/2.4.7-1 /lib/oldmodules without the '/' at the end..............would this make a difference and is there anything I can do about it?

At least this is being written in Mozilla, not IE6, on my booting custom kernel with my working ADSL so thanks for your help on all of that hangdog. If yourself of anyone else can help me 'tidy things up' around here (I don't like seeing error messages on boot) I'd genuinely appreciate it. Thanks again.

Hangdog42 03-15-2004 05:23 PM

I'm pretty sure that you can solve the problem by a careful combing of the kernel configuration, but I have no idea where to look. This thread suggests that those modules are needed to run Unixware and SCO binares.......which probably means you don't need them. It also appears to be a hold-over from the 2.2.x kernels. I just grepped my 2.6.3 config file and there is no mention of ibcs, so it may have been yanked.

As for you oldmodules problem, if you created the oldmodules directory before copying, the old modules should be there. Just go have a look and see. However, the best approach is simply to start tweaking your custom kernel until the dependancy problems are solved.


And congrats on compiling your kernel. It is the first step towards a genuine addiction:D

murphaph 03-16-2004 02:49 PM

the kernel booted cleanly second time around, don't ask me-I'm new here!


All times are GMT -5. The time now is 09:23 AM.