Patchwork [U-Boot,v2] UBIFS: Change ubifsload to set the filesize variable

login
register
mail settings
Submitter Bastian Ruppert
Date Sept. 5, 2011, 1:03 p.m.
Message ID <1315227837-17714-1-git-send-email-Bastian.Ruppert@Sewerin.de>
Download mbox | patch
Permalink /patch/113361/
State Accepted
Commit 46d7274cdcacc581bd02881e0aee4bb1a73e6f3a
Headers show

Comments

Bastian Ruppert - Sept. 5, 2011, 1:03 p.m.
This is the same behaviour like tftp or fatload command.

Signed-off-by: Bastian Ruppert <Bastian.Ruppert@Sewerin.de>
CC: kmpark@infradead.org
---
 fs/ubifs/ubifs.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
Detlev Zundel - Sept. 9, 2011, 12:12 p.m.
Hi Bastian,

> This is the same behaviour like tftp or fatload command.
>
> Signed-off-by: Bastian Ruppert <Bastian.Ruppert@Sewerin.de>
> CC: kmpark@infradead.org

Acked-by: Detlev Zundel <dzu@denx.de>

Cheers
  Detlev
Wolfgang Denk - Sept. 9, 2011, 10:04 p.m.
Dear Bastian Ruppert,

In message <1315227837-17714-1-git-send-email-Bastian.Ruppert@Sewerin.de> you wrote:
> This is the same behaviour like tftp or fatload command.
> 
> Signed-off-by: Bastian Ruppert <Bastian.Ruppert@Sewerin.de>
> CC: kmpark@infradead.org
> ---
>  fs/ubifs/ubifs.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 5a5c739..75a2edc 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -688,6 +688,7 @@  int ubifs_load(char *filename, u32 addr, u32 size)
 	int i;
 	int count;
 	int last_block_size = 0;
+	char buf [10];
 
 	c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READONLY);
 	/* ubifs_findfile will resolve symlinks, so we know that we get
@@ -739,8 +740,11 @@  int ubifs_load(char *filename, u32 addr, u32 size)
 
 	if (err)
 		printf("Error reading file '%s'\n", filename);
-	else
+	else {
+	        sprintf(buf, "%lX", size);
+		setenv("filesize", buf);
 		printf("Done\n");
+	}
 
 	ubifs_iput(inode);