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/6] defaultenv/update: add check crc32 options
Date: Mon, 11 Oct 2010 16:34:42 +0200	[thread overview]
Message-ID: <1286807684-17355-4-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <20101011135329.GA7412@game.jcrosoft.org>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 common/Kconfig              |    2 ++
 defaultenv/bin/_update_help |    8 +++++---
 defaultenv/bin/update       |    8 +++++++-
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/common/Kconfig b/common/Kconfig
index e8d467e..617f640 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -394,6 +394,8 @@ config DEFAULT_ENVIRONMENT_GENERIC
 	depends on DEFAULT_ENVIRONMENT
 	select SHELL_HUSH
 	select HUSH_GETOPT
+	select CMD_CRC
+	select CMD_CRC_CMP
 	prompt "Default environment generic"
 	help
 	  With this option barebox will use the generic default
diff --git a/defaultenv/bin/_update_help b/defaultenv/bin/_update_help
index e6ea64c..a23f00f 100644
--- a/defaultenv/bin/_update_help
+++ b/defaultenv/bin/_update_help
@@ -1,8 +1,10 @@
 #!/bin/sh
 
-echo "usage: $0 -t <kernel|rootfs> -d <nor|nand> [-f imagename]"
+echo "usage: $0 -t <kernel|rootfs> -d <nor|nand> [-f imagename] -c"
 echo "update tools."
-echo""
+echo ""
+echo "options"
+echo " -c     to check the crc32 for the image and flashed one"
+echo ""
 echo "type update -t kernel -d <nor|nand> [-f imagename] to update kernel into flash"
 echo "type update -t rootfs -d <nor|nand> [-f imagename] to update rootfs into flash"
-
diff --git a/defaultenv/bin/update b/defaultenv/bin/update
index bdac11f..504bff6 100644
--- a/defaultenv/bin/update
+++ b/defaultenv/bin/update
@@ -4,8 +4,9 @@
 
 type=""
 device_type=""
+check=n
 
-while getopt "ht:d:f:" Option
+while getopt "ht:d:f:c" Option
 do
 if [ ${Option} = t ]; then
 	type=${OPTARG}
@@ -13,6 +14,8 @@ elif [ ${Option} = d ]; then
 	device_type=${OPTARG}
 elif [ ${Option} = f ]; then
 	imagename=${OPTARG}
+elif [ ${Option} = c ]; then
+	check=y
 else
 	. /env/bin/_update_help
 	exit 0
@@ -43,3 +46,6 @@ else
 fi
 
 . /env/bin/_update
+if [ x${check} = xy ]; then
+	crc32 -f $image -F $part
+fi
-- 
1.7.1


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

  parent reply	other threads:[~2010-10-11 14:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-11 13:53 defaultv env update v2 Jean-Christophe PLAGNIOL-VILLARD
2010-10-11 14:34 ` [PATCH 1/6] defaultenv: introduce CONFIG_DEFAULT_ENVIRONMENT_GENERIC to enable it Jean-Christophe PLAGNIOL-VILLARD
2010-10-11 14:34 ` [PATCH 2/6] commands/crc32: add compare 2 files crc Jean-Christophe PLAGNIOL-VILLARD
2010-10-11 14:34 ` [PATCH 3/6] defaultenv/update: merge update_rootfs and update_kernel Jean-Christophe PLAGNIOL-VILLARD
2010-10-11 14:34 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2010-10-11 14:34 ` [PATCH 5/6] defaultenv: add xmodem support for update Jean-Christophe PLAGNIOL-VILLARD
2010-10-11 14:34 ` [PATCH 6/6] defaultenv: add update_barebox to update barebox easly via tftp or xmodem Jean-Christophe PLAGNIOL-VILLARD
2010-10-12  8:13 ` [PATCH] nhk8815: use defaultenv 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=1286807684-17355-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