• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 391
  • Last Modified:

Kernel Compilation

I'm screwing around with the kernel on my PC. I'm running redhat 6.2 and using xconfig to make the kernel. I was successful doing what I initially attempted to do (emulate SCSI Cdroms for my CDR drive so cdrecord would work), but I want to find out if there is a way to get the current kernel setup and import it into xconfig.

If there was a way to do this, I would be a little more confident in making changes to only what I wanted to change and not have to worry about forgetting to turn off SMP support, etc.

Any suggestions?

thanks in advance.
0
jgarr
Asked:
jgarr
1 Solution
 
olidelCommented:
Hi,

    You just have to find a file which is called .config in the directory where you compiled your kernel, so if you want to have the parameter of your original kernel, you must find a .config file in the kernel source of RH 6.2. You probably have a RPM which contains all that stuff e.g. kernel-source.

Hope this help.

Bye.
0
 
jgarrAuthor Commented:
I'll poke around for it and let you know if I succeed. Thanks
0
 
jlevieCommented:
Okay, you are using RedHat, and they graciously include the configs for the kernels they ship. If you look in /usr/src/linux/configs you'll see several kernel config files for the various CPU types. To duplicate the stock kernel you'd use the i386 config. But, it makes more sense to pick the config file that matches your CPU type, as shown by 'uname -m'.

You can copy the appropriate file to where "make xconfig" can see it, or you can load the config into the xconfig tool. To copy it do:

chaos# cd /usr/src/linux
chaos# make mrproper
chaos# uname -m
i686
chaos# cp configs/kernel-2.2.19-6.2.7-i686.config .config
chaos# make xconfig
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
netskywalkerCommented:
 don't worry about where is the original place where hold the config file. I think you just need to store the current configuration as a alternative config file to the folder you already know while you stay in xconfig. then you can modify any thing in the xconfig as you want and do your test.
when you wana restore back just need reload the alternative
config file at xconfig then all the reliable setting will be back. teh do what you want.
0
 
jgarrAuthor Commented:
Here's the problem. I have a machine that I installed a long while ago. I can run through xconfig or menuconfig, but I really don't recall everything that I added into the kernel way back then. But I liked the way it worked. I would like to be able to use the kernel config that I boot the machine with and make changes to that one. For example, I have APM on my kernel and while rebuilding the last time, SMP support was enabled (which breaks things). I wouldn't even have visited those sections of the config if hadn't had to start from scratch. I saved off the current one before I compiled it for next time, but there has to be a way to look at what I have.
Ideally you could take bzImage and run the sausage machine backwards to show what is in the compiled version for xconfig.

Netskywalker- I can't accept that as an answer because it doesn't answer the question. It does provide a way to maintain the kernel configs after you change them.
jlevie- Does red hat only use those kernels? Or will it let you make changes during the install that alter the kernel?



thanks
0
 
jlevieCommented:
If there's a way to "run the sausage machine backwards" I sure don't know what it is. There is information that you can glean from an existing kernel image, like via 'strings', but that doesn't exactly correspond to the options in the kernel config file.

The config files that I referred to are the '.config' file used to build the RedHat kernel of a specific CPU type (i386, i686, i686-smp, etc) as shipped on the RedHat OS CD(s). And yes you can use one of those as a starting point, loading it into xconfig or menuconfig , and change the RedHat config to your liking. That's the way I always custom configure a kernel. I load the RedHat config for the CPU type I'm building the kernel for ('uname -m" will tell you what the CPU type for the current machine is) into xconfig and then modify that to include/exclude support as desired. When I'm done I save a copy of the '.config' file to some other name so that the next 'make mrproper' doesn't wipe it out. And speaking of 'make mrproper', the kernel build doc's don't in my opinion stress the importance of doing that enough. On a RedHat box it is very important to do 'make mrproper' the very first time you build a kernel and any time you change the CPU type (like going from an i686 to an i586, or going to/from SMP).
0
 
jgarrAuthor Commented:
Thanks, Jlevie.
I'm going to keep the question open for a couple of days to see if there is any other comments. If that's where I have to start, then thats what I'll do.

0
 
CleanupPingCommented:
jgarr:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now