Panda How to Barebox

Introduction
For this How-to, we will use the Code Sourcery G++ version arm-2009q3. It should already be installed on your system. MLO, u-boot and kernels have also been successfully built with arm-2010q1.

MLO
First, let's get the x-loader source code and build it. But the difference with Barebox is that the x-loader is just a down size of Barebox it self

git clone git://git.pengutronix.de/git/barebox.git

Next, select the panda config:

mkdir MLO make CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=MLO panda_xload_defconfig

Now compile MLO:

make CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=MLO

This should produce the MLO file as MLO/barebox.bin.

Barebox
Now for Barebox:

Next, select the panda config:

mkdir boot make CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=boot panda_defconfig

Now compile Barebox:

make CROSS_COMPILE=Path_to_your/arm-2009q3/bin/arm-none-linux-gnueabi- O=boot

This should produce boot/barebox.bin

Creating a working SD card
Use this script to prepare an SD card with the small vfat partition and the larger ext2/3 partition (it has been posted many places, I take no credit for it btw, the card needs to be larger than 64Mbytes since this original script wants to make a 64Mbyte vfat partition) You may need to be root for some of the following operations. For the feint of heart, you can use sudo instead in the right places.

if [ ! "$1" = "/dev/sda" ] ; then DRIVE=$1 if [ -b "$DRIVE" ] ; then dd if=/dev/zero of=$DRIVE bs=1024 count=1024 SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'` echo DISK SIZE - $SIZE bytes CYLINDERS=`echo $SIZE/255/63/512 | bc` echo CYLINDERS - $CYLINDERS { 		echo ,9,0x0C,* echo ,,,- } | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE mkfs.vfat -F 32 -n "boot" ${DRIVE}1 mke2fs -j -L "rootfs" ${DRIVE}2 fi fi
 * 1) !/bin/sh

More to come....