diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2010-10-11 16:34:43 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-10-12 21:32:45 +0200 |
commit | de1823f74ec6312ab35180667a6f19aaa03f0d5e (patch) | |
tree | 1c29a721365b22f0b5895d3fd5169dffea655939 /defaultenv/bin/_update | |
parent | 3b8942faa0ef4088eec60fba0b34cb4be0d7661f (diff) | |
download | barebox-de1823f74ec6312ab35180667a6f19aaa03f0d5e.tar.gz barebox-de1823f74ec6312ab35180667a6f19aaa03f0d5e.tar.xz |
defaultenv: add xmodem support for update
the default mode is tftp to do not change the default behavior
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'defaultenv/bin/_update')
-rw-r--r-- | defaultenv/bin/_update | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/defaultenv/bin/_update b/defaultenv/bin/_update index 6f2ebd3157..87e6922326 100644 --- a/defaultenv/bin/_update +++ b/defaultenv/bin/_update @@ -10,14 +10,16 @@ if [ ! -e "$part" ]; then exit 1 fi -if [ x$ip = xdhcp ]; then - dhcp -fi - -ping $eth0.serverip -if [ $? -ne 0 ] ; then - echo "Server did not reply! Update aborted." - exit 1 +if [ x$mode = xtftp ]; then + if [ x$ip = xdhcp ]; then + dhcp + fi + + ping $eth0.serverip + if [ $? -ne 0 ] ; then + echo "Server did not reply! Update aborted." + exit 1 + fi fi unprotect $part @@ -30,6 +32,12 @@ erase $part echo echo "flashing $image to $part" echo -tftp $image $part + +if [ x$mode = xtftp ]; then + tftp $image $part +else + loadb -f $image -c + cp $image $part +fi protect $part |