Difference between revisions of "EBC Exercise 23 Configuring the Kernel"

From eLinux.org
Jump to: navigation, search
m (Updated for 3.8 kernel)
(Added Install section)
Line 61: Line 61:
 
  host$ '''sudo apt-get install libglade2-dev'''
 
  host$ '''sudo apt-get install libglade2-dev'''
  
 +
== Making and Installing the kernel ==
 +
Once you have the kernel configured it's easy to make and install it on the bone.
 +
host$ '''cd linux-dev/KERNEL'''
 +
host$ '''source ~/crossCompileEnv.sh'''
 +
host$ '''make -j''X'' '''
 +
 +
Replace the ''X'' with the number of cores on your machine.  After a while (depending on the number of cores) you will see.
 +
 +
Now you are ready to install. Have your Bone running and on the network. On your host run:
 +
host$ '''cd linux-dev/tools'''
 +
host$ '''ln -s ../../exercises/setup/beagle_install_kernel.sh ../../exercises/setup/remote_install_kernel.sh .'''
 +
 +
This will link in two files from the git repository that we'll use.  Edit '''remote_install_kernel.sh''' and change '''BeagleAddr''' to the address of your beagle. Then run:
 +
host$ '''./remote_install_kernel.sh'''
 +
 +
This copies several files to your Bone. Then, on the Bone run:
 +
beagle$ '''cd linux-dev'''
 +
beagle$ '''tools/beagle_install.sh'''
 +
 +
This uncompresses and
 
{{YoderFoot}}
 
{{YoderFoot}}

Revision as of 15:58, 3 September 2013

thumb‎ Embedded Linux Class by Mark A. Yoder


3.8 Kernel

These instructions are for the 3.8 kernel. See EBC Exercise 23 Configuring the Kernel - bitbake for the 3.2 kernel.

In a previous exercises (EBC Exercise 08a Cross-Compiling and EBC Exercise 08 Installing Development Tools) you learned how to get and compile the kernel. Here we'll look at configuring it.

Finding the kernel sources

First set up the environment and go to the kernel directory

host$ source ~/crossCompileEnv.sh  (set up in EBC Exercise 08a Cross-Compiling)
host$ cd ~/BeagleBoard/linux-dev/KERNEL

Getting kernel make help

Once 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.

Finding and installing support software

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. Here are notes on how to discover what to install and installing it.

NOTE FOR UBUNTU USERS: 'sudo apt-get install libncurses5-dev' without quotes will install ncurses

Configuring the kernel

Try the various interfaces for configuring the kernel.

host$ make menuconfig
host$ make xconfig
host$ make gconfig

I had to run the following to get these to work.

host$ sudo apt-get install libncurses5-dev
host$ sudo apt-get install qt3-dev-tools
host$ sudo apt-get install libglade2-dev

Making and Installing the kernel

Once you have the kernel configured it's easy to make and install it on the bone.

host$ cd linux-dev/KERNEL
host$ source ~/crossCompileEnv.sh
host$ make -jX 

Replace the X with the number of cores on your machine. After a while (depending on the number of cores) you will see.

Now you are ready to install. Have your Bone running and on the network. On your host run:

host$ cd linux-dev/tools
host$ ln -s ../../exercises/setup/beagle_install_kernel.sh ../../exercises/setup/remote_install_kernel.sh .

This will link in two files from the git repository that we'll use. Edit remote_install_kernel.sh and change BeagleAddr to the address of your beagle. Then run:

host$ ./remote_install_kernel.sh

This copies several files to your Bone. Then, on the Bone run:

beagle$ cd linux-dev
beagle$ tools/beagle_install.sh

This uncompresses and



thumb‎ Embedded Linux Class by Mark A. Yoder