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 4/5] defaultenv: add update_barebox to update barebox easly for tftp or xmodem
Date: Thu,  7 Oct 2010 18:37:37 +0200	[thread overview]
Message-ID: <1286469458-11362-4-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1286469458-11362-1-git-send-email-plagnioj@jcrosoft.com>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 commands/Kconfig              |    1 +
 defaultenv/bin/init           |    1 +
 defaultenv/bin/update_barebox |   21 +++++++++++++++++++++
 3 files changed, 23 insertions(+), 0 deletions(-)
 create mode 100644 defaultenv/bin/update_barebox

diff --git a/commands/Kconfig b/commands/Kconfig
index 5416073..151758b 100644
--- a/commands/Kconfig
+++ b/commands/Kconfig
@@ -204,6 +204,7 @@ config CMD_CRC
 
 config CMD_CRC_CMP
 	tristate
+	default y if DEFAULT_ENVIRONMENT_GENERIC
 	depends on CMD_CRC
 	prompt "compare 2 files crc"
 
diff --git a/defaultenv/bin/init b/defaultenv/bin/init
index db2b525..18a0c95 100644
--- a/defaultenv/bin/init
+++ b/defaultenv/bin/init
@@ -28,6 +28,7 @@ if [ $? != 0 ]; then
 	echo "default mode is net"
 	echo "type update_kernel nand|nor [<imagename>] [net|xmodem] to update kernel into flash"
 	echo "type update_rootfs nand|nor [<imagename>] [net|xmodem] to update rootfs into flash"
+	echo "type update_barebox nand|nor [<imagename>] [net|xmodem] to update barebox into flash"
 	echo
 	exit
 fi
diff --git a/defaultenv/bin/update_barebox b/defaultenv/bin/update_barebox
new file mode 100644
index 0000000..2f3b1d9
--- /dev/null
+++ b/defaultenv/bin/update_barebox
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+. /env/config
+image=barebox.bin
+mode=net
+
+if [ x$1 = xnand ]; then
+	part=/dev/nand0.barebox.bb
+elif [ x$1 = xnor ]; then
+	part=/dev/nor0.barebox
+else
+	echo "usage: $0 nor|nand [imagename] [net|xmodem]"
+	exit 1
+fi
+
+if [ x$3 != x ]; then
+	mode=$3
+fi
+
+. /env/bin/_update $2
+crc32 -f $image -F $part
-- 
1.7.1


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

  parent reply	other threads:[~2010-10-07 16:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-07 16:37 [PATCH 1/5] defaultenv: introduce CONFIG_DEFAULT_ENVIRONMENT_GENERIC to enable it Jean-Christophe PLAGNIOL-VILLARD
2010-10-07 16:37 ` [PATCH 2/5] commands/crc32: add compare 2 files crc Jean-Christophe PLAGNIOL-VILLARD
2010-10-07 16:37 ` [PATCH 3/5] defaultenv: add xmodem support for update Jean-Christophe PLAGNIOL-VILLARD
2010-10-08 12:27   ` Sascha Hauer
2010-10-11  5:11     ` Jean-Christophe PLAGNIOL-VILLARD
2010-10-07 16:37 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2010-10-07 16:37 ` [PATCH 5/5] nhk8815: use defaultenv Jean-Christophe PLAGNIOL-VILLARD
2010-10-08  6:59 ` [PATCH 1/5] defaultenv: introduce CONFIG_DEFAULT_ENVIRONMENT_GENERIC to enable it Sascha Hauer
2010-10-08 12:39   ` Jean-Christophe PLAGNIOL-VILLARD

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=1286469458-11362-4-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