summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2010-11-26 20:58:37 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2010-11-29 21:55:25 +0100
commit7e0982bdc24dade46345b00c83d2779e602354db (patch)
tree0038b70ac2a4a147535ed93fa9620b27ece84d53
parenta75df244b2ff2e08bd142d2c94defb8781522575 (diff)
downloadbarebox-7e0982bdc24dade46345b00c83d2779e602354db.tar.gz
barebox-7e0982bdc24dade46345b00c83d2779e602354db.tar.xz
defaultenv/udpate: in xmodem mode load the data before erasing
and abort the update if loadb failed or cancelled Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--defaultenv/bin/_update9
1 files changed, 8 insertions, 1 deletions
diff --git a/defaultenv/bin/_update b/defaultenv/bin/_update
index 87e6922326..f736acc744 100644
--- a/defaultenv/bin/_update
+++ b/defaultenv/bin/_update
@@ -22,6 +22,14 @@ if [ x$mode = xtftp ]; then
fi
fi
+if [ x$mode = xxmodem ]; then
+ loadb -f $image -c
+ if [ $? -ne 0 ] ; then
+ echo "loadb failed or cancelled! Update aborted."
+ exit 1
+ fi
+fi
+
unprotect $part
echo
@@ -36,7 +44,6 @@ echo
if [ x$mode = xtftp ]; then
tftp $image $part
else
- loadb -f $image -c
cp $image $part
fi