# Easier way to configure kernel?

## Moondhum

Hello

I installed gentoo about 3 days earlier and since then I have been trying to configure my kernel but not yet successful. lscpi -k shows my ethernet kernel module is not present, It's starting to get little frustrating at this point. I tried using modprobed_db but seems it doesn't work properly. Is there more easier way to configure kernel than doing it manually, maybe some alternative to modprobed_db?Last edited by Moondhum on Fri Jan 27, 2017 6:50 am; edited 1 time in total

----------

## John R. Graham

Yes, and it's described right in the Handbook. Search for "genkernel".

- John

----------

## 1clue

I don't like genkernel.

I use a script I wrote which requires 2 config files. I've been tempted to rewrite so that it can use just a single config file but it works well and I haven't had time to do the change.

Script kcheck:

```

#!/bin/bash

echo "Watched:"

cat .config \

| grep -f /root/kernel.grepf \

| grep -vf /root/kernel.grepv

echo "Not Found:"

cat .config \

| grep -Lf /root/kernel.grepf

```

The config files are almost mirrors of each other, but the first one  contains only the kernel settings I care about, usually followed by a regex \> end-of-word matcher.

```

CONFIG_64BIT\>

CONFIG_9P_FS\>

CONFIG_9P_FS_POSIX_ACL\>

CONFIG_BRIDGE_EBT_MARK_T\>

CONFIG_BRIDGE_EBT_T_NAT\>

CONFIG_BRIDGE_EBT_VLAN\>

...

```

The second file contains the setting with the value I want.

```

CONFIG_64BIT=y

CONFIG_9P_FS_POSIX_ACL=y

CONFIG_9P_FS=y

CONFIG_BRIDGE_EBT_MARK_T=y

CONFIG_BRIDGE_EBT_T_NAT=y

CONFIG_BRIDGE_EBT_VLAN=y

...

```

The way this works, I need to be in my new kernel source directory. I copy the running kernel's .config file into the directory and then 'make oldconfig'. Once I finish that, I run 'kcheck' and hope for no CONFIG lines in the output. If something prints then it's a change I need to make. The row printed will be the value which should be in the config, not the one that's there.

Also if a CONFIG shows up after 'Not Found:' that means that the module has disappeared from the new kernel config and I need to figure out what happened to it. Rows showing up here means that the kernel has changed relevant to the printed lines, maybe the module name changed or it's become obsolete. At any rate since the values in my config files are what is required to run the box in the capacity I want then any misconfiguration or absent value means that I'll have a nonfunctional box if I run the new kernel without fixing it.

I know there are some things I could do better with this script, but you're welcome to mess with it if you want.

----------

## Roman_Gruber

In my early years I used a binary distro kernel (or genkernel when it boots) config and slimmed it down.

genkernel may work (still bloatware)

Some ebuilds will tell you to enable something in the kernel, and than you can improve your kernel.

----------

## Ant P.

Boot a livecd or other environment where your hardware works and build the kernel using "make localyesconfig" to make the loaded drivers permanent.

----------

## Moondhum

It was really helpful, thank you all for your suggestions.

----------

