# kernel config

## sk8harddiefast

i want to config my new kernel.but has a lot of properties.i dont want with genkernel.is any way to make my config easier because there are a big part of properties (the most of them)that i have no idea!!!!!maybe is a little silly question but i want to learn to configure my kernel my own without tick choises with luck!!!!!!

----------

## bronzeboyvn

You can read some tutorials

Linux Sea

Pappy's Seed Kernels

----------

## AaronPPC

The first time you configure it'll be kind of a pain.  Genkernel will give you a baseline, then you can trim things down from there.  lspci and lshw will tell you about your hardware.  Don't forget to use help.  On many things the help description will tell you to say yes or no if you're in doubt.  Expect to use some trial and error.

Once you have a working config it is much easier to configure the next kernel and you won't need genkernel.  You will then just enable new features or trim out things you don't need.  As you gain experience you will get to know your hardware better and you will make better configs.  Experience will also teach you what you need to compile into the kernel and what you can set as modules.

I find it quite fun.

----------

## pappy_mcfae

Check out my seeds, and the tutorial recommended above (thanks, bronzeboyvn!). Kernel configuration is easy when you use one of my seeds. And, if you have problems, I can do the setup for you.

Blessed be!

Pappy

----------

## dvh

I am in the process of moving a gentoo install from one machine to another.  I successfully copied the entire / partition, booted the new machine with a gentoo CD, then chrooted into the new (old) gentoo install.  I rebuilt a kernel in the new system, and had to change processor type and a lot of other things too.  when i rebooted using the newly installed kernel, my keyboard and mouse would not work.  Did not know where to go next, but i stumbled upon "pappy's kernel seeds" and decided to use this approach.

After following most of the directions, I rebooted with *success*.  I can now use keyboard and mouse.  Of course, there were plenty of other issues because of kernel driver configuration, as I had not built-in ALL of the necessary device drivers or modules.  I think I tracked most of them down, and now I have a pretty decent load (thanks, Pappy!), but I i have a couple of remaining issues.

1) I am not sure that udev is working correctly.  I now have a /dev directory that looks like it did prior to udev (hundreds of ptyx and ttyx devices), but I do NOT have any devices showing for cdrom, dvd, and some others.  When I look at udev *persistent.x* rules, I see rules that identify my OLD devices from the prior machine...guess there is no surprise there.  I think those might be blocking new devices from appearing, but that does not seem reasonable.  how can I get all of these rules aligned with my new devices?

2) is there something about udev that I may have misconfigured in the kernel?  I didn't make many changes in this area from the basic seeds (2.6.30-gentoo, x86_64).

3) I'd like to prune my /dev again so that it looks reasonable and is readable.  what are the minimum device nodes that need to be static?

again, Pappy, thanks for the help to this point.

-dvh

----------

## dvh

posted my .config here: http://pastebin.com/m1a66673f

----------

## pappy_mcfae

 *dvh wrote:*   

> 1) I am not sure that udev is working correctly.  I now have a /dev directory that looks like it did prior to udev (hundreds of ptyx and ttyx devices), but I do NOT have any devices showing for cdrom, dvd, and some others.  When I look at udev *persistent.x* rules, I see rules that identify my OLD devices from the prior machine...guess there is no surprise there.  I think those might be blocking new devices from appearing, but that does not seem reasonable.  how can I get all of these rules aligned with my new devices?

 

I haven't had to go this deeply to clear things, but my assumption is if you want to refresh udev properly, copy all /etc/udev/rules.d/*persistent* somewhere safe, and reboot. If there were issues in those files, the reboot should reset your devices and their nomenclature.

 *Quote:*   

> 2) is there something about udev that I may have misconfigured in the kernel?  I didn't make many changes in this area from the basic seeds (2.6.30-gentoo, x86_64).

 

The only way you could hurt udev is to turn on "Create deprecated sysfs layout for older userspace tools (SYSFS_DEPRECATED_V2)", and you didn't do that. Using my basic seed, udev works properly.

 *Quote:*   

> 3) I'd like to prune my /dev again so that it looks reasonable and is readable.  what are the minimum device nodes that need to be static?

 

To me, that seems a waste of time. Since the /dev directory is virtual and kernel-driven, as far as I know, the only way to modify certain things is to modify them in the kernel. With PTY devices and such, you can trim the number you use, but that isn't going to make your CDROM device work if it's not set up properly

Which brings me to your .config. Please post the results of lspci -n and cat /proc/cpuinfo as well as your /etc/fstab file, and I'll make some minor corrections, and send the .config back in working order.

 *Quote:*   

> again, Pappy, thanks for the help to this point.
> 
> -dvh

 

You're most welcome. 

Blessed be!

Pappy

----------

## energyman76b

http://www.kroah.com/lkn/

----------

## dvh

lspci -n 

```
00:00.0 0600: 8086:27a0 (rev 03)

00:02.0 0300: 8086:27a2 (rev 03)

00:07.0 1101: 8086:27a3 (rev 03)

00:1b.0 0403: 8086:27d8 (rev 02)

00:1c.0 0604: 8086:27d0 (rev 02)

00:1c.1 0604: 8086:27d2 (rev 02)

00:1d.0 0c03: 8086:27c8 (rev 02)

00:1d.1 0c03: 8086:27c9 (rev 02)

00:1d.2 0c03: 8086:27ca (rev 02)

00:1d.3 0c03: 8086:27cb (rev 02)

00:1d.7 0c03: 8086:27cc (rev 02)

00:1e.0 0604: 8086:2448 (rev e2)

00:1f.0 0601: 8086:27b9 (rev 02)

00:1f.1 0101: 8086:27df (rev 02)

00:1f.2 0101: 8086:27c4 (rev 02)

00:1f.3 0c05: 8086:27da (rev 02)

01:00.0 0200: 11ab:4362 (rev 22)

02:00.0 0200: 168c:001c (rev 01)

03:03.0 0c00: 11c1:5811 (rev 61)

```

----------

## dvh

cat /proc/cpuinfo:

```
processor   : 0

vendor_id   : GenuineIntel

cpu family   : 6

model      : 15

model name   : Intel(R) Core(TM)2 CPU         T5600  @ 1.83GHz

stepping   : 2

cpu MHz      : 1833.000

cache size   : 2048 KB

physical id   : 0

siblings   : 2

core id      : 0

cpu cores   : 2

apicid      : 0

initial apicid   : 0

fdiv_bug   : no

hlt_bug      : no

f00f_bug   : no

coma_bug   : no

fpu      : yes

fpu_exception   : yes

cpuid level   : 10

wp      : yes

flags      : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm tpr_shadow

bogomips   : 3667.15

clflush size   : 64

power management:

processor   : 1

vendor_id   : GenuineIntel

cpu family   : 6

model      : 15

model name   : Intel(R) Core(TM)2 CPU         T5600  @ 1.83GHz

stepping   : 2

cpu MHz      : 1833.000

cache size   : 2048 KB

physical id   : 0

siblings   : 2

core id      : 1

cpu cores   : 2

apicid      : 1

initial apicid   : 1

fdiv_bug   : no

hlt_bug      : no

f00f_bug   : no

coma_bug   : no

fpu      : yes

fpu_exception   : yes

cpuid level   : 10

wp      : yes

flags      : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm tpr_shadow

bogomips   : 3666.49

clflush size   : 64

power management:
```

----------

## dvh

fstab:

```
# /etc/fstab: static file system information.

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.14 2003/10/13 20:03:38 azarah Exp $

#

# noatime turns off atimes for increased performance (atimes normally aren't

# needed; notail increases performance of ReiserFS (at the expense of storage

# efficiency).  It's safe to drop the noatime options if you want and to 

# switch between notail and tail freely.

# <fs>             <mountpoint>    <type>     <opts>            <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/sdb1      /      reiserfs   noatime         0 0

# NOTE: The next line is critical for boot!

none         /proc      proc      defaults      0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for

# POSIX shared memory (shm_open, shm_unlink). 

# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will

#  use almost no memory if not populated with files)

# Adding the following line to /etc/fstab should take care of this:

none         /dev/shm   tmpfs      defaults      0 0

```

----------

## dvh

thought this might help also:

systool -D -b pci: 

```
Bus = "pci"

  Driver = "HDA Intel"

    Devices using "HDA Intel" are:

      0000:00:1b.0 8086:27d8

  Driver = "PIIX_IDE"

    Devices using "PIIX_IDE" are:

      0000:00:1f.1 8086:27df

  Driver = "agpgart-amd64"

  Driver = "agpgart-intel"

    Devices using "agpgart-intel" are:

      0000:00:00.0 8086:27a0

  Driver = "ata_piix"

    Devices using "ata_piix" are:

      0000:00:1f.2 8086:27c4

  Driver = "ehci_hcd"

    Devices using "ehci_hcd" are:

      0000:00:1d.7 8086:27cc

  Driver = "i801_smbus"

    Devices using "i801_smbus" are:

      0000:00:1f.3 8086:27da

  Driver = "intelfb"

  Driver = "ohci1394"

    Devices using "ohci1394" are:

      0000:03:03.0 11c1:5811

  Driver = "pata_mpiix"

  Driver = "pata_oldpiix"

  Driver = "pcieport-driver"

    Devices using "pcieport-driver" are:

      0000:00:1c.0 8086:27d0

      0000:00:1c.1 8086:27d2

  Driver = "piix4_smbus"

  Driver = "sky2"

    Devices using "sky2" are:

      0000:01:00.0 11ab:4362

  Driver = "uhci_hcd"

    Devices using "uhci_hcd" are:

      0000:00:1d.0 8086:27c8

      0000:00:1d.1 8086:27c9

      0000:00:1d.2 8086:27ca

      0000:00:1d.3 8086:27cb

  Driver = "yenta_cardbus"
```

i notice that some of the "Driver=" are not followed by any "Devices using".  Does this mean I can safely remove those drivers from the kernel?

-dvh

----------

## pappy_mcfae

Along with this web site, and the results of lspci -n, I know all devices on your system. After that, /etc/fstab tells me you only use reiserfs, and cat /proc/cpuinfo tells me you have a core-2 duo. The rest is just putting it all together...

And for the most part, you did well. You didn't need all the devices you had set up, and having the ATA/ATAPI/MFM/RLL and the SATA drivers on is a bad thing for ICH7 or greater. The following .config should definitely fire up your optical drive, if it is functional.

In order to make sure you can automount your optical drive(s), you will also need to make sure you have hal and dbus installed and starting at boot, and that you are running X. Just add your username to the following in /etc/group: disk, usb, cdrom, cdrw (if exists), and plugdev. Reboot or restart hal/dbus, and then see what happens.

 *Quote:*   

> i notice that some of the "Driver=" are not followed by any "Devices using". Does this mean I can safely remove those drivers from the kernel? 

 

Yes. However, at this point, your best bet is to give the .config I whipped up a try. 

Be aware, the .30 kernel is unstable with Intel GPU's...at least mine. It can cause video based locking...sometimes hard locking where the power button is all that will get you back. This usually gives some cool colors. Sometimes soft locking so you can ssh to the machine and reboot gracefully. This usually results in a darkened screen. I have no such issues with non-Intel video chips.

Click here for your new .config. Compile as is.

For the best results, please do the following:

1) Move your .config file out of your kernel source directory (/usr/src/linux-2.6.30-gentoo ).

2) Issue the command make mrproper. This is a destructive step. It returns the source to pristine condition. Unmoved .config files will be deleted!

3) Copy my .config into your source directory.

4) Issue the command make && make modules_install.

5) Install the kernel as you normally would, and reboot.

6) Once it boots, please post /var/log/dmesg so I can see how things loaded.

I really didn't change that much, so if you have a diff program, you can decipher what I did. As you will see, you were really close to good.

Good luck.

Blessed be!

Pappy

----------

## dvh

Thanks for the help again, pappy.  I must tell you that in moving my system from the previous machine, the partition I created on the new drive is, in fact, ext3.  I messed up and did not change the fstab correctly, and you saw the reiserfs still included there.  For some reason, the partition mounted correctly anyway!  I really need ext3, not reiserfs, but I think that will be an easy change for me to execute with your provided seeds.

Based on the directions from your website, I had used the referenced link to determine which devices I had, and which drivers (sort of) that I needed, so that's the reason I was able to get as close as I did...not because I knew anything.  I got a little carried away, including several "PIIX" related drivers, as I could not tell just which one I might need.  I think that's where most of my extra inclusions came from.

I know the optical drive is functional, because when I boot gentoo from CD, it works fine.  ALso, this install is on a mac mini, and the drive works fine with OSX too.  I have HAL and Dbus working also (at least I think so, I can see the daemons in "ps -aux".

I was having some difficulty with the intel driver with both the .29 and the .30 kernels, so I am currently running with the vesa driver and it seems to be stable (but slow).

I will be trying your seeds ASAP, and I will indeed post results so that you can see how it went.  I appreciate your help.

-dvh

----------

## dvh

pappy:  here is the output of my dmesg:

```
http://pastebin.com/m58bf626
```

 The really good news is that you have fixed my issue with cdrom and dvd...they now appear.  Great, and thank you very much.  I don't know how you can do this for others.  I think that is just great.

As I said earlier, I did need to make changes to your seeds to add the ext3 support...I threw you a curve on that one.  and i did a quick "diff" to try to learn something, but I did not have enough time to really get through it, so I don't yet know what helped my optical drive recognition.

As you might expect, I have other questions.  My network failed to start because the sky2 module did not get loaded.  I manually loaded it with modprobe (you can see that load around the 200 second mark), and then it worked.  I had originally built this driver into the kernel, but my "diff" tells me that you wanted it to be a module.  I guess there is something else I needed to add in order to get this loaded at startup...maybe an entry into something like modules.autoload.d or the like?

lastly, I appear to be missing a module "dri" which causes a warning during the startup of X.  Is that a kernel module that should be produce during kernel build, or does that come from another package, like maybe xf86-video-intel?

I need to travel for work the next couple of days, so I won't be bothering you further in that time, at least.  thanks very much once more.  You have helped me learn.

-dvh

----------

## dvh

ok.  I lied.  I need to ask you one more thing.  in order to include ext3 support, I did a "make menuconfig" and manually included the support.  So i just did a "diff" to see what changed between your seeds file and the new ext3-enhanced file.  I expected to see just a couple of lines, but NO, there was a significant change!  here is an example (my altered version is "<")

```

< # CONFIG_64BIT is not set

< CONFIG_X86_32=y

< # CONFIG_X86_64 is not set

---

> CONFIG_64BIT=y

> # CONFIG_X86_32 is not set

> CONFIG_X86_64=y

```

I am using a 64-bit CPU, but this is a 32-bit gentoo system.  Something in the "make menuconfig" pass must alter these settings according to whatever I am building?  It seems to have worked...without my additional config step, what would have resulted?

-dvh

----------

## pappy_mcfae

 *dvh wrote:*   

> Thanks for the help again, pappy.  I must tell you that in moving my system from the previous machine, the partition I created on the new drive is, in fact, ext3.  I messed up and did not change the fstab correctly, and you saw the reiserfs still included there.  For some reason, the partition mounted correctly anyway!  I really need ext3, not reiserfs, but I think that will be an easy change for me to execute with your provided seeds.
> 
> Based on the directions from your website, I had used the referenced link to determine which devices I had, and which drivers (sort of) that I needed, so that's the reason I was able to get as close as I did...not because I knew anything.  I got a little carried away, including several "PIIX" related drivers, as I could not tell just which one I might need.  I think that's where most of my extra inclusions came from.

 

I am planning on redoing that page to make it a bit more concise. As a general rule, the ATA/ATAPI/MFM/RLL drivers are not to be used at the same time as the SATA (also known as libata) drivers. While there are cases when such things can be done to good effect, with ICH7 or greater, it causes serious conflicts.

 *Quote:*   

> I know the optical drive is functional, because when I boot gentoo from CD, it works fine.  ALso, this install is on a mac mini, and the drive works fine with OSX too.  I have HAL and Dbus working also (at least I think so, I can see the daemons in "ps -aux".

 

Your /var/log/dmesg also tells that tale. 

 *Quote:*   

> I was having some difficulty with the intel driver with both the .29 and the .30 kernels, so I am currently running with the vesa driver and it seems to be stable (but slow).

 

As have I. I consider myself lucky that 2.6.29-zen2 works as well as it does, and allows me to use the intel video drivers. Sometimes, that can lead to weird happenings, like locks and such, but overall, it has gotten better. Now, if the kernel devs will only pick on something else for a while so we can get stability back for Intel GPU users. That would be lovely

 *Quote:*   

> I will be trying your seeds ASAP, and I will indeed post results so that you can see how it went.  I appreciate your help.
> 
> -dvh

 

You're most welcome.

Blessed be!

Pappy

----------

## pappy_mcfae

 *dvh wrote:*   

> pappy:  here is the output of my dmesg:
> 
> ```
> http://pastebin.com/m58bf626
> ```
> ...

 

It did.

[quote]As you might expect, I have other questions.  My network failed to start because the sky2 module did not get loaded.  I manually loaded it with modprobe (you can see that load around the 200 second mark), and then it worked.  I had originally built this driver into the kernel, but my "diff" tells me that you wanted it to be a module.  I guess there is something else I needed to add in order to get this loaded at startup...maybe an entry into something like modules.autoload.d or the like?[/qutoe]

No, consider that my bad. I knew that there were one or two 1000 net devices that didn't work so well as a module. I guess sky3 is one of them. You can turn that back on without problem. My apologies. I'll have to keep that in mind for later.

 *Quote:*   

> lastly, I appear to be missing a module "dri" which causes a warning during the startup of X.  Is that a kernel module that should be produce during kernel build, or does that come from another package, like maybe xf86-video-intel?

 

No, actually it comes in a package called libdrm. For the moment, I recommend sticking with vesa. The .30 kernel is very resistive to working with intel GPU's. That goes for all sources tested (gentoo, vanilla, zen). Of course, that version works with all other GPU's without problem (ie nvidia, and old ATI). 

 *Quote:*   

> I need to travel for work the next couple of days, so I won't be bothering you further in that time, at least.  thanks very much once more.  You have helped me learn.
> 
> -dvh

 

You have just written the words I love to read, "you have helped me learn." That makes me feel as if I have achieved my goal. 

Blessed be!

Pappy

----------

## pappy_mcfae

 *dvh wrote:*   

> ok.  I lied.  I need to ask you one more thing.  in order to include ext3 support, I did a "make menuconfig" and manually included the support.  So i just did a "diff" to see what changed between your seeds file and the new ext3-enhanced file.  I expected to see just a couple of lines, but NO, there was a significant change!  here is an example (my altered version is "<")
> 
> ```
> 
> < # CONFIG_64BIT is not set
> ...

 

No boot scenario. That's weird. Your original .config is a 64 bit config. Hmm... It's a good thing you did that.

Blessed be!

Pappy

----------

## dvh

hey Pappy, seems I managed to commandeer the computer in my hotel lobby for a couple of minutes, and I thought I would give you a quick reply...

When i orignally grabbed your kernel seeds, I was not sure which (x86 or x86_64) to use, because while my new CPU is 64-bit, my old gentoo install was a 32-bit system.  after trying to configure what I grabbed (I think it was the x86 version), my make would fail (a message indicating a 64 vs. 32 bit problem) unless I used some "ARCH=i386" setting before doing the make (or was it the other way around??).  I tried so many things that I don't recall exactly, but I ended up selecting the x86_64 seed, and the altered version of that is what I had initially posted for you to see.

With a 64-bit CPU, and a 32-bit install, which seeds would be appropriate?

-dvh

----------

## pappy_mcfae

32 bit. A 32 bit kernel will run on a 64 bit processor, but you won't get the reverse. In my opinion, it's a shame to not use those 64 bit registers. You paid for them, after all. 

While sometimes 64 bit gets a bad rap, the only issue I ever had was when a 32 bit compatibility library came to portage that was broken. It was fixed the next day. I reverted to the old library, and updated when the new one came. Other than that, I love my 64 bit system. It compiles really fast, and has a lovely picture when playing DVD's. Best of all, I can use the fireworkx screen saver, crank it to the max, and still not max out the processors. WOOHOO!

I did run 32 bit on that machine for a week until I decided I wanted to take the 64 bit plunge. I've never regretted that decision.

Blessed be!

Pappy

----------

## dvh

pappy:  I have an arch linux 64-bit install, and this legacy 32-bit gentoo install.  I am comfortable with the 64-bit, and will likely rework my gentoo load to be just that...but I thought I could get the legacy system up quicker, so I chose that route.  Probably could have done the 64-bit quicker, now looking back.  Not time wasted, howwever, as I am now better equipped.

-dvh

----------

## pappy_mcfae

And there's nothing saying you can't connect another hard drive (or two), and set up a 64 bit install on said drive. Core-too had both 32 and 64 bit installs as I was transitioning. I wanted to check speed and workability, and 64 bit won. 

Either way, it's good to know your computer is in a better mood.

Blessed be!

Pappy

----------

