-   Gentoo (
-   -   Original .conf file for Custom Kernel compile (

steve_pa 01-28-2012 10:29 AM

Original .conf file for Custom Kernel compile

After compiling a series of custom kernels, I would like to compare my modified .config file to the original .config file as it was before I started.

Where is the location of that original unmodified file?


TobiSGD 01-29-2012 02:56 AM

You should find it in the /boot directory.

ukiuki 01-29-2012 03:02 AM

Should be at /boot it is a good idea to save one .config for each serie you compile, something like .config-01 .config-02 etc. You can skip the dot in the begin to make it visible.

You can use something like this to copy your original/current running kernel:

cp /boot/config-$(uname -r) ./.config

steve_pa 01-29-2012 10:25 AM

@Tobi and uk

When I look in /boot I don't see any files that look like .config file contents.

I guess this is all sounding like something I could have figured out myself. :-(
So much is learned by trial and error, but I don't want to mess up this install.

Now, about /boot, maybe you meant the directory /usr/src/linux? This has a number of files there, like:
.config - what I assume is the config file I last used to compile a custom kernel
.config--2012*-bak - which appear to be backups.
.Kconfig - appears to be some kind of non kernel config file.

It's just when I did a diff between the .config and the .config--2012*-bak's, I was not absolutely sure which one was the original file.

Another question: Would re-emerge-ing the gentoo-sources re-establish my system's /usr/src/linux hierarchy? (If I wanted to start fresh...)
#emerge --unmerge gentoos-sources
#emerge gentoo-sources
#cd /usr/src/linux;make menuconfig

Reading the handbooks's description of removing software, makes me think it would leave the old kernel config files behind (and not really starting me over from scratch), or worse, break the system due to dependencies.

Another question is if I just delete or rename the .config file, and rerun make menuconfig, what will really happen?

I did copy the /usr/src/linux config files to a safe place, now!

Sorry if all this is obvious.

TobiSGD 01-29-2012 12:18 PM


Originally Posted by steve_pa (Post 4587438)
Now, about /boot, maybe you meant the directory /usr/src/linux?

No, I meant /boot. If your distro isn't something special you should see a file named config-YOURKERNELVERSION, where YOURKERENLVERSION is the version of the default kernel of that distribution. All distros i know of put that there. If it really is missing it is very simple to get the config of the default kernel. Just boot with it and launch

zcat /proc/config.gz > config-default_kernel
This will generate a file config-default_kernel with the configuration of the currently running kernel.

All times are GMT -5. The time now is 05:38 PM.