EBC Exercise 08 Installing Development Tools
Embedded Linux Class by Mark A. Yoder
Early in the class most of the exercises we will do will all run on the BeagleBoard. You'll be able to edit (gedit), compile (gcc) and run all on the Beagle. Later, when we start compiling the kernel [1] or the boot loader, (U-boot) you will need to cross compile on a Linux machine and copy the results to the Beagle.
The purpose of this exercise is to install all the tools needed for compiling on your host so they will be ready when you need them.
Instructions for building Ångström are given here; however there are a few changes you have to make. Here's what I did.
Tip: Run this exercise using a wired connection if you can. The Ubuntu wireless driver can be finicky, and if it stops working you'll have to restart some of this.
These instructions have been tested for the 3.2.25 kernel.
These are notes are based on Beagleboard kernel git site.
First download the tools needed to compile the kernel. This took about 25 seconds.
host$ sudo apt-get install -y git lzop gcc-arm-linux-gnueabi uboot-mkimage
Next download the tools to get the kernel and the patches needed to make it run on the beagle. (2.5 seconds)
host$ cd ~/BeagleBoard host$ git clone git://github.com/beagleboard/kernel.git
Next download the kernel and the patches. Before running ./patch/sh, take a look at it. Can you figure out what it's doing? Also look at patch_script.sh, it's where the details are. The downloading/patching process takes some 39 minutes.
host$ gedit patch.sh patch_script.sh host$ ./patch.sh
Once patched you are ready to compile the kernel. The first time takes a while. Mine tool 4 minutes, but I was running on 8 cores. Set the -jX to match the number of cores you have. uImage is the kernel!
host$ make -j9 host$ make uImage
You also need all the kernel modules. Here we create a directory to install them in. (a few seconds)
host$ mkdir rootfs host$ make INSTALL_MOD_PATH=rootfs modules_install
Copy the kernel and the modules to the Beagle. (a minute or so)
host$ scp kernel/arch/arm/boot/uImage root@beagle:/boot/uImage-3.2.25+ host$ cd rootfs host$ find -H -depth | cpio -o -H crc | ssh root@beagle 'cd /; cpio -id'
Now log into the beagle and move some things around.
host$ ssh root@beagle beagle$ cd /boot beagle$ rm uImage beagle$ ln -s uImage-3.2.25+ uImage beagle$ mkdir /media/mmcblk0p1 beagle$ mount /dev/mmcblk0p1 /media/mmcblk0p1 beagle$ cp /boot/uImage-3.2.25+ /media/uImage
Download and Compile U-boot
While were' at it, let's get the boot loader we'll be using...
host$ git clone git://git.denx.de/u-boot.git
Mine took about 3 minutes.
Once installed you are ready for kernel work.
Embedded Linux Class by Mark A. Yoder