Solved

Kernel Compilation

Posted on 2001-08-06
8
350 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
 

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now