summaryrefslogtreecommitdiffstats
path: root/defaultenv/bin/update
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2010-10-11 16:34:43 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2010-10-12 21:32:45 +0200
commitde1823f74ec6312ab35180667a6f19aaa03f0d5e (patch)
tree1c29a721365b22f0b5895d3fd5169dffea655939 /defaultenv/bin/update
parent3b8942faa0ef4088eec60fba0b34cb4be0d7661f (diff)
downloadbarebox-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/update11
1 files changed, 10 insertions, 1 deletions
diff --git a/defaultenv/bin/update b/defaultenv/bin/update
index 504bff60a0..032f3409f5 100644
--- a/defaultenv/bin/update
+++ b/defaultenv/bin/update
@@ -5,8 +5,9 @@
type=""
device_type=""
check=n
+mode=tftp
-while getopt "ht:d:f:c" Option
+while getopt "ht:d:f:m:c" Option
do
if [ ${Option} = t ]; then
type=${OPTARG}
@@ -16,6 +17,8 @@ elif [ ${Option} = f ]; then
imagename=${OPTARG}
elif [ ${Option} = c ]; then
check=y
+elif [ ${Option} = m ]; then
+ mode=${OPTARG}
else
. /env/bin/_update_help
exit 0
@@ -45,6 +48,12 @@ else
exit 1
fi
+if [ x${mode} != xtftp ] && [ x${mode} != xxmodem ] ; then
+ echo "unsupported mode ${mode}."
+ . /env/bin/_update_help
+ exit 1
+fi
+
. /env/bin/_update
if [ x${check} = xy ]; then
crc32 -f $image -F $part