# New to Gentoo, trying to use genkernel

## miscsubbin

So I'm just starting up and I realize that every time something goes wrong, I usually have to recompile the kernel with different settings. Is there a way to make a backup of the settings and use them again later (I'm assuming there has to be)? Because right now I'm memorizing the things I changed and then every time I have to add something new I run

```
genkernel --menu-config all
```

and put in the settings I remember. This is starting to get out of hand, and I would like to just be able to modify my old settings every time. Also, is there a guide to understanding what a lot of the settings do? I would like to move away from genkernel at some point and just compile with the bare minimum of things that I need.

----------

## John R. Graham

Yes. Edit /etc/genkernel.conf and set

```
CLEAN="no"

MRPROPER="no"
```

You can do this on the command line as well but it's easier to set as the default behavior by modifying the .conf file. This has the added benefit of not throwing away all of the work products each time you want to tweak one little thing.

I get the impression that most of us absorbed our kernel foo over time by reading posts, Googling, and experimenting. Perhaps someone else can point you to better tutorial material, but I don't know of it.

-  John

----------

## miscsubbin

Thanks! Is there any way I can make a backup, like if I want to try something new that I'm not sure will work and I want to make sure I can revert if I need to? I haven't run into a situation like this yet, but I can definitely see it happening. Even better would be something that makes a backup every time it runs and keeps a certain number.

----------

## The Doctor

You can. The config file is a plan text file located at /usr/src/linux/.config You can use cp to copy the file to wherever you want it, eg cp /usr/src/linux/.config kernel_backup.config which would place a copy in your working directory. Just don't edit it manually, that is asking for trouble.

----------

## dlaor

Maybe chapter 7 of "Linux Sea" is useful as a tutorial:

http://swift.siphos.be/linux_sea/

It is written by a gentoo developer and (from the abstract): "offers a gentle yet technical (from end-user perspective) introduction to the Linux operating system, using Gentoo Linux as the example Linux distribution."

I must say I haven't read much of it myself, but that is mostly because I found out about it only some weeks ago. To me the chaper on configuring the kernel looks pretty good, explaining many options as well as pappy's kernel seeds, grub, troubleshooting etc. (not much about genkernel though).

Hope that helps!

----------

## sgarcia

True, you can back up .config.

But there is something else that you should *always* do.  Make sure that these are in your config:

```
CONFIG_IKCONFIG=y

CONFIG_IKCONFIG_PROC=y
```

I don't recall exactly where in menuconfig that lives, but it's in the setup of the kernel itself.

Then your running kernel will always have its own configuration stored in /proc/config.gz

Any time you need to recreate it, simply

```
cat /proc/config.gz | gunzip > /usr/src/runningconfig

genkernel --kernel-config=/usr/src/runningconfig --menuconfig  all
```

----------

