Gentoo Logo

Disclaimer : This document is not valid and is not maintained anymore.

[ << ] [ < ] [ Home ] [ > ] [ >> ]

7. Configuring the Kernel


7.a. Installing the Sources

Choosing a Kernel

The core around which all distributions are built is the Linux kernel. It is the layer between the user programs and your system hardware. Gentoo provides its users several possible kernel sources. A full listing with description is available at the Gentoo Kernel Guide.

For ARM systems, we will use gentoo-sources (contains additional patches for extra features).

Now install it using emerge.

Code Listing 1.1: Installing a kernel source

# emerge gentoo-sources

When you take a look in /usr/src you should see a symlink called linux pointing to your kernel source. In this case, the installed kernel source points to gentoo-sources-3.3.8. Your version may be different, so keep this in mind.

Code Listing 1.2: Viewing the kernel source symlink

# ls -l /usr/src/linux
lrwxrwxrwx    1 root   root    12 Oct 13 11:04 /usr/src/linux -> linux-3.3.8

7.b. Manual Configuration


Manually configuring a kernel is often seen as the most difficult procedure a Linux user ever has to perform. Nothing is less true -- after configuring a couple of kernels you don't even remember that it was difficult ;)

However, one thing is true: you must know your system when you start configuring a kernel manually. Most information can be gathered by emerging pciutils (emerge pciutils) which contains lspci. You will now be able to use lspci within the chrooted environment. You may safely ignore any pcilib warnings (like pcilib: cannot open /sys/bus/pci/devices) that lspci throws out. Alternatively, you can run lspci from a non-chrooted environment. The results are the same. You can also run lsmod to see what kernel modules the Installation CD uses (it might provide you with a nice hint on what to enable).

Now go to your kernel source directory and execute make menuconfig. This will fire up an ncurses-based configuration menu.

Code Listing 2.1: Invoking menuconfig

# cd /usr/src/linux
# make menuconfig

You will be greeted with several configuration sections. We'll first list some options you must activate (otherwise Gentoo will not function, or not function properly without additional tweaks). We also have a Gentoo Kernel Configuration Guide on the Gentoo wiki that might help you further.

Activating Required Options

Due to the highly specific nature of the embedded, we'll cover known configurations for boards here. If your machine is not listed, then you should visit the respective community website to figure out how to properly configure your kernel.

Please select your machine from the list below to jump to the configuration section.

7.c. NetWinder configuration options

Remember that EXT2 support is required for the boot partition as that is the only filesystem that the bootloader can read reliably. Otherwise, the only filesystem that has been tested is EXT3 but your welcome to try your luck with the others ;).

Code Listing 3.1: NetWinder configuration options

First generate a default config
# make netwinder_defconfig

Required options
System Type --->
  ARM system type (FootBridge) --->
    (X) FootBridge
  Footbridge Implementations --->
    [*] NetWinder

Floating point emulation --->
  [*] NWFPE math emulation

File systems --->
  [*] Second extended fs support
  Pseudo Filesystems --->
    [*] /proc file system support
    [*] Virtual memory file system support (former shm fs)

Device Drivers --->
  ATA/ATAPI/MFM/RLL support --->
    [*] ATA/ATAPI/MFM/RLL support
    [*]   Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
    [*]     Include IDE/ATA-2 DISK support
    ---     IDE chipset support/bugfixes
    [*]     PCI IDE chipset support
    [*]       Winbond SL82c105 support
    [*]       Generic PCI bus-master DMA support

  Network device support --->
    [*] Network device support
    Ethernet (10 or 100Mbit) --->
      [*] Ethernet (10 or 100Mbit)
      Tulip family network device support --->
        [*] "Tulip" family network device support
        [*]   DECchip Tulip (dc2114x) PCI support
        [*]     Use PCI shared mem for NIC registers
        [*]     Use NAPI RX polling
      [*] EISA, VLB, PCI and on board controllers
      [*]   PCI NE2000 and clones support

  Character devices --->
    Serial drivers --->
      [*] 8250/16550 and compatible serial support
      [*]   Console on 8250/16550 and compatible serial port
      --- Non-8250 serial port support
      [*] DC21285 serial port support
      [*]   Console on DC21285 serial port
    Watchdog Cards --->
      [*] Watchdog Timer Support
      [*]   NetWinder WB83C977 watchdog
    [*] NetWinder thermometer support
    [*] NetWinder Button
    [*]   Reboot Using Button

Recommended options
Kernel Features --->
  [*] Preemptible Kernel
  [*] Timer and CPU usage LEDs
  [*]   CPU usage LED

File systems --->
  [*] Ext3 journalling file system support

Device Drivers --->
  Input device support --->
    [*] Keyboards --->
      [*] AT keyboard
    [*] Mouse --->
      [*] PS/2 mouse

  Graphics support --->
    [*] Support for frame buffer devices
    [*]   Enable firmware EDID
    [*]   CyberPro 2000/2010/5000 support
    Logo configuration --->
      [*] Bootup logo
      [*]   Standard 224-color Linux logo

  Sound --->
    [*] Sound card support
    Open Sound System --->
      [*] Open Sound System
      [*]   OSS sound modules
      [*]     Yamaha FM synthesizer (YM3812/OPL-3) support
      [*]     Netwinder WaveArtist

You should only enable this to upgrade your flash
Device Drivers --->
  Character devices --->
    [*] NetWinder flash support

When you've finished configuring the kernel, continue with Compiling and Installing.

7.d. Compiling and Installing

Now that your kernel is configured, it is time to compile and install it. Exit the configuration and start the compilation process:

Code Listing 4.1: Compiling the kernel

# make && make modules_install

When the kernel has finished compiling, copy the kernel image to /boot. Use whatever name you feel is appropriate for your kernel choice and remember it as you will need it later on when you configure your bootloader. Remember to replace kernel-3.3.8-gentoo with the name and version of your kernel.

Code Listing 4.2: Installing the kernel

# cp vmlinux.gz /boot/kernel-3.3.8-gentoo

Now continue with Kernel Modules.

7.e. Kernel Modules

Configuring the Modules

You should list the modules you want automatically loaded in /etc/conf.d/modules. You can add extra options to the modules too if you want.

To view all available modules, run the following find command. Don't forget to substitute "<kernel version>" with the version of the kernel you just compiled:

Code Listing 5.1: Viewing all available modules

# find /lib/modules/<kernel version>/ -type f -iname '*.o' -or -iname '*.ko' | less

For instance, to automatically load the 3c59x.ko module (which is the driver for a specific 3Com network card family), edit the /etc/conf.d/modules file and enter the module name in it.

Code Listing 5.2: Editing /etc/conf.d/modules

# nano -w /etc/conf.d/modules

Continue the installation with Configuring your System.

[ << ] [ < ] [ Home ] [ > ] [ >> ]


View all

Page updated May 11, 2014

Summary: The Linux kernel is the core of every distribution. This chapter explains how to configure your kernel.

Sven Vermeulen

Grant Goodyear

Roy Marples

Daniel Robbins

Chris Houser

Jerry Alexandratos

Seemant Kulleen
Gentoo x86 Developer

Tavis Ormandy
Gentoo Alpha Developer

Jason Huebel
Gentoo AMD64 Developer

Guy Martin
Gentoo HPPA developer

Pieter Van den Abeele
Gentoo PPC developer

Joe Kallar
Gentoo SPARC developer

Mike Frysinger
Gentoo * developer

John P. Davis

Pierre-Henri Jondot

Eric Stockbridge

Rajiv Manglani

Jungmin Seo

Stoyan Zhekov

Jared Hudson

Colin Morey

Jorge Paulo

Carl Anderson

Jon Portnoy

Zack Gilburd

Jack Morgan

Benny Chuang


Joshua Kinard

Stuart Longland

Tobias Scherbaum

Xavier Neys

Gerald J. Normandin Jr.

Donnie Berkholz

Ken Nowack

Lars Weiler

Donate to support our development efforts.

Copyright 2001-2014 Gentoo Foundation, Inc. Questions, Comments? Contact us.