Fedora ARM On A Panda From Scratch

Below is a script to help create a panda sdcard from scratch but using pre-compiled kernel and boot files.

#!/bin/bash

if [ "$1" == "" ]
then
	echo "Usage: $0 <device>"
	exit 1
fi

# http://www.angstrom-distribution.org/demo/pandaboard/mkcard.txt

export CARD="$1"
export BOOT="/mnt/boot"
export ROOT="/mnt/root"
export TEMP="/tmp/temp"

echo "formatting [${CARD}] after sleeping..." ; sleep 10
mkdir ${TEMP} 2> /dev/null
umount ${CARD}{1..4} 2> /dev/null
dd if=/dev/zero of=${CARD} bs=1024 count=1024
./mkcard.sh ${CARD}

# http://www.angstrom-distribution.org/demo/pandaboard/{MLO,u-boot.bin,uImage}

umount ${BOOT} 2> /dev/null ; mkdir ${BOOT} 2> /dev/null ; mount ${CARD}1 ${BOOT}

wget -O ${BOOT}/MLO 'http://www.angstrom-distribution.org/demo/pandaboard/MLO' ; sync
wget -O ${BOOT}/u-boot.bin 'http://www.angstrom-distribution.org/demo/pandaboard/u-boot.bin'
wget -O ${BOOT}/uImage 'http://www.angstrom-distribution.org/demo/pandaboard/uImage'

time sync ; umount ${BOOT} 2> /dev/null

# http://fedoraproject.org/wiki/Architectures/ARM
# http://scotland.proximity.on.ca/fedora-arm/rootfs/f13-rc1/rootfs-f13-rc1-2011-06-29.tar.bz2

umount ${ROOT} 2> /dev/null ; mkdir ${ROOT} 2> /dev/null ; mount ${CARD}2 ${ROOT}

tar -xjvf rootfs-f*.tar.bz2 -C ${ROOT} ; mv ${ROOT}/rootfs-*/* ${ROOT} 2> /dev/null

time sync ; umount ${ROOT} 2> /dev/null

# path to kernel modules

umount ${ROOT} 2> /dev/null ; mkdir ${ROOT} 2> /dev/null ; mount ${CARD}2 ${ROOT}

echo '# custom added section' >> ${ROOT}/etc/rc.local
echo '/sbin/ifconfig usb0 inet 192.168.1.253 netmask 255.255.255.0 up' >> ${ROOT}/etc/rc.local
echo '/sbin/route add default gw 192.168.1.254' >> ${ROOT}/etc/rc.local
echo 'while true ; do /sbin/agetty -L 115200 console vt100 ; done' >> ${ROOT}/etc/rc.local

time sync ; umount ${ROOT} 2> /dev/null

# done

eject ${CARD}

Note: A good guide to compiling the kernel is located here: http://wiki.meego.com/ARM/OMAP4_Panda

Leave a comment