U-boot compilation

From AlwaysInnovating
Jump to: navigation, search

To compile U-boot, you can either use the u-boot recipe available in the AI OpenEmbedded branch, or download the sources and compile it with an external cross-compiler.

Download an external cross-compiler

You can typically use the toolchain from CodeSourcery available here

Following the instructions provided, you will typically end up with the following toolchain available on your machine:

arm-none-linux-gnueabi-addr2line
arm-none-linux-gnueabi-ar
arm-none-linux-gnueabi-as
arm-none-linux-gnueabi-c++
arm-none-linux-gnueabi-c++filt
arm-none-linux-gnueabi-cpp
arm-none-linux-gnueabi-g++
arm-none-linux-gnueabi-gcc
arm-none-linux-gnueabi-gcc-4.3.3
arm-none-linux-gnueabi-gcov
arm-none-linux-gnueabi-gdb
arm-none-linux-gnueabi-gprof
arm-none-linux-gnueabi-ld
arm-none-linux-gnueabi-nm
arm-none-linux-gnueabi-objcopy
arm-none-linux-gnueabi-objdump
arm-none-linux-gnueabi-ranlib
arm-none-linux-gnueabi-readelf
arm-none-linux-gnueabi-size
arm-none-linux-gnueabi-sprite
arm-none-linux-gnueabi-strings
arm-none-linux-gnueabi-strip

You will also need the mkimage command, so be sure it's installed on your host machine. On Ubuntu, you can install it with:

sudo apt-get install uboot-mkimage

Download the sources and compile

The source code is available here (12MB). Then expand it in your working directory and build everything. The CROSS_COMPILE argument must be filled with the prefix of your toolchain (ensure you have it in your PATH, or then pass the full path to the make command):

mkdir u-boot
cd u-boot
tar xzvf u-boot.tgz
make CROSS_COMPILE=arm-none-linux-gnueabi- touchbook_config
make CROSS_COMPILE=arm-none-linux-gnueabi-

Using u-boot on your SD card

Once built, you just need to copy u-boot.bin to the first partition of your SD card. Assuming the first partition of your SD card is under /media/disk/:

cp u-boot.bin /media/disk/
sync
Personal tools