Newer
Older
barebox / arch / arm / boards / freescale-mx27-ads / env / bin / _update
@Sascha Hauer Sascha Hauer on 3 Feb 2014 447 bytes ARM: rename boards to more consistent naming
#!/bin/sh

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 [ $# = 1 ]; then
	image=$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"
echo
tftp $image $part