[Om-beagle-panda-hybrid] [OM-Beagle-Hybrid] makesd script

Joerg Eesmann jeesmann at gmx.de
Wed Jan 12 21:48:42 CET 2011


Hello there,
yesterday I got my beagle hybrid to work. Here are my results:

in my PC the SD is /dev/mmcblk0, so I had to do some adjustments to the
makesd-script. The script that worked for me is attached.
The basic script works for device which are like /dev/sdb, so that you
only attach 1 or 2 to get the name of the partitions. In my case I had
to attach p1 and p2. Setting the device name to /dev/mmcblk0p did not
help either because some command like fdisk are using the pure device
name and fail on /dev/mmcblk0p.
The attached script it worked for me.
The calibration did not start automatically, so I had to start
ts_calibrate manually and restarted.
Furthermore during postinst a file named /etc/rts.conf will be copied to
ts.conf.cfg, and later it will be copied back, this file did not exist
in my case.
But... it is working, and it is fast.
BR
Joerg 
-------------- next part --------------
# make an SD suitable for the BeagleBoard
# run on eeePC
[ "$SERVER" ] || export SERVER=http://download.goldelico.com/ombeagle/20100921-lenny
[ "$DEV" ] || export DEV=/dev/mmcblk0
[ "$PART1" ] || export PART1=${DEV}p1
[ "$PART2" ] || export PART2=${DEV}p2

umount ${PART1}
umount ${PART2}

# new based on http://omappedia.org/wiki/SD_Configuration#Script_to_partition.2Fformat_SDCards

#!/bin/sh
if [ ! "${DEV}" = "/dev/sda" ] ; then
	DRIVE=${DEV}
	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=`expr $SIZE / 255 / 63 / 512`
		echo CYLINDERS - $CYLINDERS
		{
		echo ,9,0x0C,*
		echo ,,,-
		} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
		mkfs.vfat -F 32 -n "boot" ${PART1}
		mke2fs -j -L "rootfs" ${PART2}

	fi 
fi

if false
then	# old

dd if=/dev/zero of=${DEV} bs=1024 count=1024

SIZE=$(fdisk -l ${DEV} | grep Disk | awk '{print $5}')
echo DISK SIZE - $SIZE bytes
CYLINDERS=$(expr $SIZE / 255 / 63 / 512)
#CYLINDERS=$(echo $SIZE/255/63/512 | bc)
echo CYLINDERS - $CYLINDERS

#fdisk ${DEV} >tmp <<END
#p
#q
#END
#CYLINDERS=$(( read DUMMY; read DUMMY; read A B C MB CAPACITY BYTES; expr $CAPACITY / 255 / 63 / 512 ) <tmp)

fdisk ${DEV} <<END
o
x
h
255
s
63
c
$CYLINDERS
r
o
p
n
p
1

+8M
t
c
a
1
p
n
p
2


p
w
q
END

# Create a filesystem on each partition :
mkfs.msdos -F 32 ${PART1} -n LABEL1
mkfs.ext3 -L LABEL2 ${PART2}

fi

umount ${PART1}
umount ${PART2}

fsck.msdos -y ${PART1}
fsck.ext3 -y ${PART2}

mkdir -p /media/P1
mount ${PART1} /media/P1
mkdir -p /media/P2
mount ${PART2} /media/P2

wget $SERVER/MLO -O /media/P1/MLO	# must come first
wget $SERVER/u-boot.bin -O/media/P1/u-boot.bin
wget $SERVER/splash.rgb16 -O/media/P1/splash.rgb16
wget $SERVER/menu.rgb16 -O/media/P1/menu.rgb16
wget $SERVER/boot.scr -O/media/P1/boot.scr
wget $SERVER/uImage -O /media/P1/uImage

ls -l /media/P1
wget $SERVER/bootstrapped-rootfs.tbz -O - | (cd /media/P2 && tar xvjf - )
rm -rf /media/P2/boot/*
rm -rf /media/P2/lib/modules
wget $SERVER/modules.tgz -O - | (cd /media/P2 && tar xvzf - )
wget $SERVER/config.tgz -O - | (cd /media/P2 && tar xvzf - )

sync
df
umount ${PART1}
rmdir /media/P1
umount ${PART2}
rmdir /media/P2


More information about the Om-beagle-panda-hybrid mailing list