Newer
Older
barebox / board / ipe337 / env / bin / _update
@Wolfram Sang Wolfram Sang on 15 Feb 2008 458 bytes add alternate mechanism & flash scripts - part2
#!/bin/sh

if [ $# = 1 ]; then
	image=$1
fi

if [ -z "$part" -o -z "$image" ]; then
	echo "define \$part and \$image"
	exit 1
fi

if [ \! -e "$part" ]; then
	echo "Partition $part does not exist"
	exit 1
fi

if [ x$ip = xdhcp ]; then
	dhcp
fi

ping $eth0.serverip
if [ $? -ne 0 ] ; then
	echo "update aborted"
	exit 1
fi

unprotect $part

echo
echo "Erasing partition $part"
erase $part

echo
echo "Flashing $image to $part"
tftp $image $part

protect $part