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

From eLinux.org
Jump to: navigation, search
(Finding the kernel sources: Updated for non=bitbake version)
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:ECE497]]
 
[[Category:ECE497]]
 
[[Category:BeagleBoard]]
 
[[Category:BeagleBoard]]
 +
{{YoderHead}}
  
This is unfinished....
+
In a previous exercise ([[EBC Exercise 22 Cross-Compiling and Finding the Right Kernel]]) you learned how to get and compile the kernel. Here we'll look at configuring it.
  
There are several ways to get and configure the kernel. In [[http://elinux.org/ECE497_Lab02_Installing_The_Angstrom_Distribution#Compile_via_make]] you learned how to get and compile the kernel.  Here we'll look at configuring it.
+
== Finding the kernel sources ==
  
Let's first learn how to do it the bitbake way.  First set up the environment and go to the kernel directory
+
First set up the environment and go to the kernel directory
  
<pre>
+
host$ '''source ~/.oe/crossCompileEnv.sh'''
$ source ~/BeagleBoard/oe/crossCompileEnv.sh
+
host$ '''cd ~/BeagleBoard/kernel'''
$ cd ~/BeagleBoard/oe/build/tmp-angstrom_2008_1/work/beagleboard-angstrom-linux-gnueabi/linux-omap-psp-2.6.32-r88+gitra6bad4464f985fdd3bed72e1b82dcbfc004d7869/git
+
</pre>
+
  
One there try some of the make commands.  Help is a good place to start.
+
== Getting kernel make help ==
<pre>
+
Once there try some of the make commands.  Help is a good place to start.
$ make help | LESS
+
</pre>
+
  
 +
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.
  
$ make xconfig
+
== 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. [[ECE497_Tips_and_Tricks#On_the_host | Here]] are notes on how to discover what to install and installing it.
  
== Trying another branch ==
+
NOTE FOR UBUNTU USERS: 'sudo apt-get install libncurses5-dev' without quotes will install ncurses
  
Here's some notes on trying to get bitbake to compile the 2.6.32 version of the kernel.
+
== Configuring the kernel ==
  
<pre>
+
Try the various interfaces for configuring the kernel.
$ cd BeagleBoard/oe
+
 
$ . source-me.txt
+
host$ '''make menuconfig'''
$ cd ${OETREE}
+
host$ '''make xconfig'''
$ git checkout -b 2011.03-maintenance origin/2011.03-maintenance
+
host$ '''make gconfig'''
$ bitbake
+
 
</pre>
+
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'''
 +
 
 +
{{YoderFoot}}

Revision as of 19:44, 29 October 2012

thumb‎ Embedded Linux Class by Mark A. Yoder


In a previous exercise (EBC Exercise 22 Cross-Compiling and Finding the Right Kernel) 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 ~/.oe/crossCompileEnv.sh
host$ cd ~/BeagleBoard/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




thumb‎ Embedded Linux Class by Mark A. Yoder