mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] defaultenv/udpate: in xmodem mode load the data before erasing
Date: Fri, 26 Nov 2010 20:58:37 +0100	[thread overview]
Message-ID: <1290801517-3281-2-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1290801517-3281-1-git-send-email-plagnioj@jcrosoft.com>

and abort the update if loadb failed or cancelled

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 defaultenv/bin/_update |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/defaultenv/bin/_update b/defaultenv/bin/_update
index 87e6922..f736acc 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
 
-- 
1.7.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2010-11-26 20:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-26 19:58 [PATCH 1/2] defaultenv/udpate: fix typo in default barebox image name Jean-Christophe PLAGNIOL-VILLARD
2010-11-26 19:58 ` Jean-Christophe PLAGNIOL-VILLARD [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1290801517-3281-2-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox