All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3 v2] Sandbox: document support of block device emulation
       [not found] <20160811205205.6184-1-stefan.bruens@rwth-aachen.de>
@ 2016-08-11 20:52 ` Stefan Brüns
  2016-08-27 15:15   ` Simon Glass
  2016-08-11 20:52 ` [U-Boot] [PATCH 2/3 v2] sandbox: Add "host size" hostfs command for fs test Stefan Brüns
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Stefan Brüns @ 2016-08-11 20:52 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
Acked-by: Simon Glass <sjg@chromium.org>
---
 board/sandbox/README.sandbox | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/board/sandbox/README.sandbox b/board/sandbox/README.sandbox
index ed820d3..02d8ab3 100644
--- a/board/sandbox/README.sandbox
+++ b/board/sandbox/README.sandbox
@@ -320,6 +320,25 @@ CONFIG_SPI_IDLE_VAL
 	The idle value on the SPI bus
 
 
+Block Device Emulation
+----------------------
+
+U-Boot can use raw disk images for block device emulation. To e.g. list
+the contents of the root directory on the second partion of the image
+"disk.raw", you can use the following commands:
+
+=>host bind 0 ./disk.raw
+=>ls host 0:2
+
+A disk image can be created using the following commands:
+
+$> truncate -s 1200M ./disk.raw
+$> echo -e "label: gpt\n,64M,U\n,,L" | /usr/sbin/sfdisk  ./disk.raw
+$> lodev=`sudo losetup -P -f --show ./disk.raw`
+$> sudo mkfs.vfat -n EFI -v ${lodev}p1
+$> sudo mkfs.ext4 -L ROOT -v ${lodev}p2
+
+
 Writing Sandbox Drivers
 -----------------------
 
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/3 v2] sandbox: Add "host size" hostfs command for fs test
       [not found] <20160811205205.6184-1-stefan.bruens@rwth-aachen.de>
  2016-08-11 20:52 ` [U-Boot] [PATCH 1/3 v2] Sandbox: document support of block device emulation Stefan Brüns
@ 2016-08-11 20:52 ` Stefan Brüns
  2016-08-27 15:16   ` Simon Glass
  2016-08-11 20:52 ` [U-Boot] [PATCH 3/3 v2] test/fs: strip carriage-return from sandbox output Stefan Brüns
       [not found] ` <20160811205205.6184-4-stefan.bruens@rwth-aachen.de>
  3 siblings, 1 reply; 7+ messages in thread
From: Stefan Brüns @ 2016-08-11 20:52 UTC (permalink / raw)
  To: u-boot

This complements the size/fatsize/ext4size commands added in
commit cf6598193aed5de8855eaf70c1994f2bc437255a
load, save and ls are already implemented for hostfs, now tests can
cover the same operations on hostfs and emulated block devices.

Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
Acked-by: Simon Glass <sjg@chromium.org>
---
 cmd/host.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/cmd/host.c b/cmd/host.c
index 8d84415..b427e54 100644
--- a/cmd/host.c
+++ b/cmd/host.c
@@ -25,6 +25,12 @@ static int do_host_ls(cmd_tbl_t *cmdtp, int flag, int argc,
 	return do_ls(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX);
 }
 
+static int do_host_size(cmd_tbl_t *cmdtp, int flag, int argc,
+			   char * const argv[])
+{
+	return do_size(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX);
+}
+
 static int do_host_save(cmd_tbl_t *cmdtp, int flag, int argc,
 			   char * const argv[])
 {
@@ -138,6 +144,7 @@ static cmd_tbl_t cmd_host_sub[] = {
 	U_BOOT_CMD_MKENT(load, 7, 0, do_host_load, "", ""),
 	U_BOOT_CMD_MKENT(ls, 3, 0, do_host_ls, "", ""),
 	U_BOOT_CMD_MKENT(save, 6, 0, do_host_save, "", ""),
+	U_BOOT_CMD_MKENT(size, 3, 0, do_host_size, "", ""),
 	U_BOOT_CMD_MKENT(bind, 3, 0, do_host_bind, "", ""),
 	U_BOOT_CMD_MKENT(info, 3, 0, do_host_info, "", ""),
 	U_BOOT_CMD_MKENT(dev, 0, 1, do_host_dev, "", ""),
@@ -174,6 +181,7 @@ U_BOOT_CMD(
 	"host ls hostfs - <filename>                    - list files on host\n"
 	"host save hostfs - <addr> <filename> <bytes> [<offset>] - "
 		"save a file to host\n"
+	"host size hostfs - <filename> - determine size of file on host"
 	"host bind <dev> [<filename>] - bind \"host\" device to file\n"
 	"host info [<dev>]            - show device binding & info\n"
 	"host dev [<dev>] - Set or retrieve the current host device\n"
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 3/3 v2] test/fs: strip carriage-return from sandbox output
       [not found] <20160811205205.6184-1-stefan.bruens@rwth-aachen.de>
  2016-08-11 20:52 ` [U-Boot] [PATCH 1/3 v2] Sandbox: document support of block device emulation Stefan Brüns
  2016-08-11 20:52 ` [U-Boot] [PATCH 2/3 v2] sandbox: Add "host size" hostfs command for fs test Stefan Brüns
@ 2016-08-11 20:52 ` Stefan Brüns
       [not found] ` <20160811205205.6184-4-stefan.bruens@rwth-aachen.de>
  3 siblings, 0 replies; 7+ messages in thread
From: Stefan Brüns @ 2016-08-11 20:52 UTC (permalink / raw)
  To: u-boot

DM added carriage-returns to every newline. Strip everything after the
32 character long mdsum.

Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
---
 test/fs/fs-test.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/fs/fs-test.sh b/test/fs/fs-test.sh
index 043e5d0..171b1de 100755
--- a/test/fs/fs-test.sh
+++ b/test/fs/fs-test.sh
@@ -402,7 +402,7 @@ check_md5() {
 	# the 7th field is the actual md5
 	md5_src=`grep -A3 "$1" "$2" | grep "md5 for"`
 	md5_src=($md5_src)
-	md5_src=${md5_src[6]}
+	md5_src=${md5_src[6]:0:32}
 
 	# The md5 list, each line is of the form:
 	# - <md5>
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 1/3 v2] Sandbox: document support of block device emulation
  2016-08-11 20:52 ` [U-Boot] [PATCH 1/3 v2] Sandbox: document support of block device emulation Stefan Brüns
@ 2016-08-27 15:15   ` Simon Glass
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Glass @ 2016-08-27 15:15 UTC (permalink / raw)
  To: u-boot

On 11 August 2016 at 14:52, Stefan Br?ns <stefan.bruens@rwth-aachen.de> wrote:
> Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
> Acked-by: Simon Glass <sjg@chromium.org>
> ---
>  board/sandbox/README.sandbox | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)

Applied to u-boot-dm/next, thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/3 v2] sandbox: Add "host size" hostfs command for fs test
  2016-08-11 20:52 ` [U-Boot] [PATCH 2/3 v2] sandbox: Add "host size" hostfs command for fs test Stefan Brüns
@ 2016-08-27 15:16   ` Simon Glass
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Glass @ 2016-08-27 15:16 UTC (permalink / raw)
  To: u-boot

On 11 August 2016 at 14:52, Stefan Br?ns <stefan.bruens@rwth-aachen.de> wrote:
> This complements the size/fatsize/ext4size commands added in
> commit cf6598193aed5de8855eaf70c1994f2bc437255a
> load, save and ls are already implemented for hostfs, now tests can
> cover the same operations on hostfs and emulated block devices.
>
> Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
> Acked-by: Simon Glass <sjg@chromium.org>
> ---
>  cmd/host.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Applied to u-boot-dm/next, thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 3/3 v2] test/fs: strip carriage-return from sandbox output
       [not found] ` <20160811205205.6184-4-stefan.bruens@rwth-aachen.de>
@ 2016-09-08 20:28   ` Stefan Bruens
  2016-09-08 20:55     ` Tom Rini
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Bruens @ 2016-09-08 20:28 UTC (permalink / raw)
  To: u-boot

On Donnerstag, 11. August 2016 22:52:05 CEST you wrote:
> DM added carriage-returns to every newline. Strip everything after the
> 32 character long mdsum.
> 
> Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
> ---
>  test/fs/fs-test.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/test/fs/fs-test.sh b/test/fs/fs-test.sh
> index 043e5d0..171b1de 100755
> --- a/test/fs/fs-test.sh
> +++ b/test/fs/fs-test.sh
> @@ -402,7 +402,7 @@ check_md5() {
>  	# the 7th field is the actual md5
>  	md5_src=`grep -A3 "$1" "$2" | grep "md5 for"`
>  	md5_src=($md5_src)
> -	md5_src=${md5_src[6]}
> +	md5_src=${md5_src[6]:0:32}
> 
>  	# The md5 list, each line is of the form:
>  	# - <md5>

This issue has been fixed in a different way.

Superseded-by: 634a4d2e825ba2effc01298ca194cd5cb09f6e3a
"fs-test.sh: Correct check_md5() test with newlines"

Kind regards,

Stefan

-- 
Stefan Br?ns  /  Bergstra?e 21  /  52062 Aachen
home: +49 241 53809034     mobile: +49 151 50412019
work: +49 2405 49936-424

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 3/3 v2] test/fs: strip carriage-return from sandbox output
  2016-09-08 20:28   ` Stefan Bruens
@ 2016-09-08 20:55     ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2016-09-08 20:55 UTC (permalink / raw)
  To: u-boot

On Thu, Sep 08, 2016 at 10:28:44PM +0200, Stefan Bruens wrote:
> On Donnerstag, 11. August 2016 22:52:05 CEST you wrote:
> > DM added carriage-returns to every newline. Strip everything after the
> > 32 character long mdsum.
> > 
> > Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
> > ---
> >  test/fs/fs-test.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/test/fs/fs-test.sh b/test/fs/fs-test.sh
> > index 043e5d0..171b1de 100755
> > --- a/test/fs/fs-test.sh
> > +++ b/test/fs/fs-test.sh
> > @@ -402,7 +402,7 @@ check_md5() {
> >  	# the 7th field is the actual md5
> >  	md5_src=`grep -A3 "$1" "$2" | grep "md5 for"`
> >  	md5_src=($md5_src)
> > -	md5_src=${md5_src[6]}
> > +	md5_src=${md5_src[6]:0:32}
> > 
> >  	# The md5 list, each line is of the form:
> >  	# - <md5>
> 
> This issue has been fixed in a different way.
> 
> Superseded-by: 634a4d2e825ba2effc01298ca194cd5cb09f6e3a
> "fs-test.sh: Correct check_md5() test with newlines"

Ug, sorry I missed this.  On the plus side, I hit this (and cursed and
fixed it) since I'm running fs-test.sh automatically on every batch of
commits I bring in now, and it errors if the output changes.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160908/552cd68a/attachment.sig>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-09-08 20:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20160811205205.6184-1-stefan.bruens@rwth-aachen.de>
2016-08-11 20:52 ` [U-Boot] [PATCH 1/3 v2] Sandbox: document support of block device emulation Stefan Brüns
2016-08-27 15:15   ` Simon Glass
2016-08-11 20:52 ` [U-Boot] [PATCH 2/3 v2] sandbox: Add "host size" hostfs command for fs test Stefan Brüns
2016-08-27 15:16   ` Simon Glass
2016-08-11 20:52 ` [U-Boot] [PATCH 3/3 v2] test/fs: strip carriage-return from sandbox output Stefan Brüns
     [not found] ` <20160811205205.6184-4-stefan.bruens@rwth-aachen.de>
2016-09-08 20:28   ` Stefan Bruens
2016-09-08 20:55     ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.