World of XorA

September 7, 2009

OMAP3 Card Formatter License

Filed under: Uncategorized — XorA @ 3:04 pm

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

At a request from TI developers I have decided to change the license of the script to GPLv2 as its more important to me that people can use the the script than spend their time arguing legal points.

Download
#! /bin/sh
# mkcard.sh v0.3
# (c) Copyright 2009 Graeme Gregory 
# Licensed under terms of GPLv2

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

if [ -b ${DRIVE}1 ]; then
	mkfs.vfat -F 32 -n "boot" ${DRIVE}1
else
	if [ -b ${DRIVE}p1 ]; then
		mkfs.vfat -F 32 -n "boot" ${DRIVE}p1
	else
		echo "Cant find boot partition in /dev"
	fi
fi

if [ -b ${DRIVE}2 ]; then
	mke2fs -j -L "rootfs" ${DRIVE}2
else
	if [ -b ${DRIVE}p2 ]; then
		mke2fs -j -L "rootfs" ${DRIVE}p2
	else
		echo "Cant find rootfs partition in /dev"
	fi
fi

1 Comment »

  1. [...] Latest Version [...]

    Pingback by OMAP3 SD Booting « World of XorA — November 19, 2009 @ 7:35 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress