July 30, 2012
This document describes the steps taken to build a cross-compile environment for Angstrom. It was formulated after we needed to recompile the rtl8188cu drivers for the Beaglebone in order to get the wireless USB adapter to function correctly with wpa-supplicant. This driver was subsequently tested in late 2012 in the wind rig. The process is relatively straightforward and involves the following:
Follow this guide if you wish to recompile or create Kernel modules for Beaglebone/Angstrom.
First, select a suitable Linux environment to do your compiling on. This guide was developed using lubuntu on VMWare but will function using other distributions. Package management commands in this document assume some distribution of Ubuntu.
First install git by running the following:
sudo apt-get install git
Once git is installed on your machine, follow the instructions for compiling the Angstrom distribution using OpenEmbedded at the OpenEmbedded website. Please read the instructions included on the website to gain an understanding of how OpenEmbedded functions. Checking out the Angstrom distribution's git repository will create a file called "setup-scripts" in your home directory (or wherever you've chosen to check out the repository). Run the following command to check out the repository:
git clone git://github.com/Angstrom-distribution/setup-scripts.git
Go into the OpenEmbedded setup directory by running:
The following step is extremely important. Go to setup-scripts/conf/local.conf and comment out or remove the following line:
INHERIT += "rm_work"
This will prevent the Angstrom kernel source from being removed once compilation has finished.
Bitbake is a python-based tool that OpenEmbedded uses to compile the kernel. Load and compile the Kernel by running the following commands in order:
MACHINE=beaglebone ./oebb.sh config beaglebone MACHINE=beaglebone ./oebb.sh update MACHINE=beaglebone ./oebb.sh bitbake virtual/kernel
These commands will take a long time to execute. Be patient. If there is a package (i.e. svn, gawk, etc) that you are missing, you will receive an error. If this happens, install the relevant package and re-run the commands.
Once you are done, you will find the cross-compilation environment in:
Please note that the name tmp-angstrom_v2012_05-eglibc may be superseded in future releases.
Add the directory where your toolchain is located to the $PATH variable i.e.
In your Makefile, you will generally be using a CROSS_COMPILE variable that is set to "arm-angstrom-Linux-gnueabi-" which tells the compiler the toolchain to use.
If the local.conf file was modified correctly, the kernel source will be in the following directory:
Obviously, the Linux-XXX folder name will change depending on the release. As of the time this documentation was written, testing was being performed on the 3.2.18 kernel.
Module Makefiles will generally have a variable for Kernel source, usually called KSRC. Set this variable to the path to the kernel source above (the git directory) either in the Makefile or when make is executed. The variable KVER must be set to the kernel version, or what the Beaglebone outputs when you run "uname -r".
Last modified 6/1/2013Wind Project Documentation