# Genkernel and kernel config file

## HMC

Hi,

I am certain these questions have been asked, but I haven't been able to find them...

The 'genkernel all' command is producing an unexpected result. That is, genkernel is looking to /etc/kernels/ for the kernel config file and if it doesn't exist, uses a generic configuration file /usr/share/genkernel/... The desired behaviour is to use the kernel configuration file from the source directory.

Is there an easy way to set genkernel to use the source directory kernel configuration file.

Another unrelated problem with genkernel... I use lvm over a luks encrypted disk and with genkernel versions after 3.45.x produce 'scattered' boot messages that don't stop at the disk password prompt. Typing the password blind after the prompt flashes past boots the system properly. Any thoughts on what might cause this?

Regards

Anne Marie

----------

## Marlo

Hi HMC,

You need a working /usr/src/linux/.config!

Then the easiest way is to copy this file to /etc/kernels/kernel-config-x86_64-3.10.0-gentoo (this is the file name in my case).

Both files will be synchronized when you "genkernel all" used in the future.

The default kernel-config ist very old:

 */usr/share/genkernel/defaults/kernel-config wrote:*   

> 
> 
> #
> 
> # Automatically generated make config: don't edit
> ...

 

So if you have a very good (perfect)  .config, copy this file to /usr/share/genkernel/defaults/kernel-config and you have a new startpoint.

Ma

----------

## John R. Graham

 *HMC wrote:*   

> ...Is there an easy way to set genkernel to use the source directory kernel configuration file[?]

 Yes. It's described in the man page. See the --oldconfig command line option or the OLDCONFIG option in /etc/genkernel.conf (which also has its own man page).   :Wink: 

You may also be interested in setting CLEAN="no" in the genkernel.conf file. You can always override it on the command line (--clean) when you want to start fresh.

Note that, by default and by design, genkernel uses canned "build the kitchen sink as modules" configurations that are shipped with genkernel itself. Most people use it that way but there's nothing at all wrong with using it the way you're saying you want to, either.

- John

----------

## HMC

Yes, I have a working config in /usr/src/linux/. It used to be the default behaviour to use this config, but somewhere that changed. 

I currently copy the config saved to the default save location in the source directory from the source directory to /etc/kernels/ or specify the config at the command line.

Anne Marie.

PS. HMC is my dad.

----------

## Tony0945

This is the script that I use when there is a kernel update

```
#! /bin/bash

zcat /proc/config.gz >/root/config.now

cp /root/config.now /usr/src/linux/.config

cd /usr/src/linux

make oldconfig

cp .config /root/config.new

genkernel --menuconfig --install --kernel-config=/root/config.new  --bootloader=grub all

```

----------

## HMC

 *Tony0945 wrote:*   

> This is the script that I use when there is a kernel update
> 
> ```
> #! /bin/bash
> 
> ...

 

Thanks,

I had been using something like this for some time, but I had little detour back to the Windows world (I need this to remind me why I changed in the first place) and didn't recreate it. It just surprised me that genkerel uses a different default to menuconfig. That seems to have changed sometime in the last 4 months or so.

The option used in my new genkernel-all script is: "--kernel-config=$PWD/.config" so that it points at the working directory.

There also seems to be changes for the better to the handling of /etc/genkernel.conf during updates, but I just went ahead and put all of the options in the script.

The only other task for that script is to rebuild modules (eg vbox) against the new kernel.

----------

## Tony0945

I have a script somewhere that does that, but it's not on this box. I'll look for it.

Meanwhile, if you use any binary X drivers that need to be linked or have emerged an update to X11, run this to rebuild all the X packages. It shouldn't take long. I often run it when in doubt as I hate to boot the new kernel and have it hang on X.

```
emerge -1 $(qlist -IC x11-drivers)
```

I got this command a few years ago from a member on this forum.

----------

## HMC

Please, anyone doing an X upgrade should know that and you're entirely off on your own tangent.

----------

## Tony0945

Sorry. Thought you were looking for help with build scripts.

----------

