There is an updated and bugfixed version of this script now added to the OE git repository where all updates from now will be done.
Latest Version
Since the instructions to format an SD card for booting with beagle/zoom2/other omap boards seems to be so complex I decided to write a script that was nice and simple to accomplish the same task.
Here is my tested and working script.
#! /bin/sh
DRIVE=$1
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
To run this script you will require to run it as root. On Ubuntu or other linux with sudo setup run the script as
sudo sh mkcard.sh /dev/sdX
replacing sdX with the base device name of your SD card device.
If your running a distribution without sudo setup then become root then run the script as
su -
sh mkcard.sh /dev/sdX