summaryrefslogtreecommitdiffstats
path: root/board/pcm038/env/bin/_update
blob: 2abed97c61e41568f57b6a4e28a3c741e7821cbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/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

unprotect $part

echo "erasing partition $part"
erase $part

echo "flashing $image to $part"
tftp $image $part