EBC Exercise 23 Configuring the Kernel

From eLinux.org
Revision as of 08:14, 30 December 2011 by Yoder (Talk | contribs)

Jump to: navigation, search

This is unfinished....

In a previous exercise (EBC Exercise 12 Cross-Compiling and Finding the Right Kernel) you learned how to get and compile the kernel. Here we'll look at configuring it. First set up the environment and go to the kernel directory

host$ source ~/.oe/crossCompileEnv.sh
host$ cd BeagleBoard/oe/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/linux-omap-psp-2.6.32-r110b+gitr5fc29e7b2a76a64a739f857858ef0b98294aa155/git/

We'll be visiting this directory so often you should set up an alias:

host$ alias kernel="cd BeagleBoard/oe/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/linux-omap-psp-2.6.32-r110b+gitr5fc29e7b2a76a64a739f857858ef0b98294aa155/git/"

Then just entering

host$ kernel

will take you to the kernel directory. Put the alias in your ~/.bashrc file so it will be there every time you log in.

One there try some of the make commands. Help is a good place to start.

host$ make help | less
Cleaning targets:
  clean           - Remove most generated files but keep the config and
                    enough build support to build external modules
  mrproper        - Remove all generated files + config + various backup files
  distclean       - mrproper + remove editor backup and patch files

Configuration targets:
  config          - Update current config utilising a line-oriented program
  menuconfig      - Update current config utilising a menu based program
  xconfig         - Update current config utilising a QT based front-end
  gconfig         - Update current config utilising a GTK based front-end

This produces a list of common make targets. There are several ways to configure the kernel. make config will prompt you line-by-line for each of the settings, very tedious, not recommended. Try

host$ make menuconfig
 *** Unable to find the ncurses libraries or the
 *** required header files.
 *** 'make menuconfig' requires the ncurses libraries.
 *** Install ncurses (ncurses-devel) and try again.
make[1]: *** [scripts/kconfig/dochecklxdialog] Error 1
make: *** [menuconfig] Error 2

If you get the error above, you need to install the ncurses library.

host$ make xconfig

Trying another branch

Here's some notes on trying to get bitbake to compile the 2.6.32 version of the kernel.

$ cd BeagleBoard/oe
$ . source-me.txt
$ cd ${OETREE}
$ git checkout -b 2011.03-maintenance origin/2011.03-maintenance
$ bitbake