Solved

Kernel Compilation

Posted on 2001-08-06
8
360 Views
Last Modified: 2013-12-15
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
Comment
Question by:jgarr
8 Comments
 
LVL 2

Expert Comment

by:olidel
ID: 6361475
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
 
LVL 2

Author Comment

by:jgarr
ID: 6361810
I'll poke around for it and let you know if I succeed. Thanks
0
 
LVL 40

Expert Comment

by:jlevie
ID: 6365746
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
Independent Software Vendors: 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!

 

Expert Comment

by:netskywalker
ID: 6446444
 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
 
LVL 2

Author Comment

by:jgarr
ID: 6447011
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
 
LVL 40

Accepted Solution

by:
jlevie earned 98 total points
ID: 6447202
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
 
LVL 2

Author Comment

by:jgarr
ID: 6447914
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
 

Expert Comment

by:CleanupPing
ID: 9086720
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question