UBIFS: Change ubifsload to set the filesize variable
PATCH 1/1 UBIFS: Change ubifsload to set the filesize variable
This is the same behaviour like tftp or fatload command.
--- fs/ubifs/ubifs.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
fs/ubifs/ubifs.c +4 -0
@@ -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
@@ -719,6 +720,9 @@ int ubifs_load(char *filename, u32 addr, u32 size)printf ("Loading file '%s' to addr 0x%08x with size %d (0x%08x)...\n" , filename, addr, size, size); +sprintf (buf,"%lX" , size); +setenv ("filesize" , buf); + page.addr = (void *)addr; page.index =0 ; page.inode = inode;
Signature · 1 line
1.6.3.3
PATCH 1/1 UBIFS: Change ubifsload to set the filesize variable
Dear Bastian Ruppert,
fs/ubifs/ubifs.c int ubifs_load(char *filename, u32 addr, u32 size) · line 725
Quoted 9 lines · In message <[email protected]> you…
This is the same behaviour like tftp or fatload command.
fs/ubifs/ubifs.c +3
-0@@ -719,6 +720,9 @@ int ubifs_load(char *filename, u32 addr, u32 size)printf ("Loading file '%s' to addr 0x%08x with size %d (0x%08x)...\n" , filename, addr, size, size); +sprintf (buf,"%lX" , size); +setenv ("filesize" , buf); +
Please insert this piece of code _after_ the file has successfully been loaded to RAM (not before starting to load it).
Best regards,
Wolfgang Denk
Signature · 8 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I wrote my name at the top of the page. I wrote down the number of
the question ``1''. After much reflection I put a bracket round it
thus ``(1)''. But thereafter I could not think of anything connected
with it that was either relevant or true.
- Sir Winston Churchill _My Early Life_ ch. 2PATCH v2 1/1 UBIFS: Change ubifsload to set the filesize variable
In reply to Bastian RuppertThis is the same behaviour like tftp or fatload command.
--- fs/ubifs/ubifs.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
fs/ubifs/ubifs.c +5 -1
@@ -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);
Signature · 1 line
1.6.3.3
PATCH v2 1/1 UBIFS: Change ubifsload to set the filesize variable
Hi Bastian,
Quoted 4 lines
This is the same behaviour like tftp or fatload command.
Signed-off-by Bastian Ruppert <[email protected]>CC kmpark at infradead.org
Cheers
Detlev
Signature · 8 lines
Paul Simon sang "Fifty Ways to Lose Your Lover", because quite
frankly, "A Million Ways to Tell a Developer He Is a D*ckhead"
doesn't scan nearly as well. But I'm sure he thought about it.
-- linux/Documentation/ManagementStyle
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.deWolfgang Denk
AppliedPATCH v2 1/1 UBIFS: Change ubifsload to set the filesize variable
In reply to Bastian RuppertDear Bastian Ruppert,
Quoted 7 lines · In message <[email protected]> you…
This is the same behaviour like tftp or fatload command.
Signed-off-by Bastian Ruppert <[email protected]>CC kmpark at infradead.org--- fs/ubifs/ubifs.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de When choosing between two evils, I always like to take the one I've never tried before. -- Mae West, "Klondike Annie"
PATCH 1/1 UBIFS: fix warning: format '%lX' expects type 'long unsigned int'
In reply to Bastian RuppertCommit 46d7274 "UBIFS: Change ubifsload to set the filesize variable" introduced the follwing compiler warning:
ubifs.c: In function 'ubifs_load':
ubifs.c:742: warning: format '%lX' expects type 'long unsigned int', but argument 3 has type 'u32'
--- fs/ubifs/ubifs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ubifs/ubifs.c +1 -1
@@ -739,7 +739,7 @@ int ubifs_load(char *filename, u32 addr, u32 size)if (err)printf ("Error reading file '%s'\n" , filename);else { -sprintf (buf,"%lX" , size); +sprintf (buf,"%X" , size);setenv ("filesize" , buf);printf ("Done\n" ); }
Signature · 1 line
1.7.6
Wolfgang Denk
AppliedPATCH 1/1 UBIFS: fix warning: format '%lX' expects type 'long unsigned int'
Dear Wolfgang Denk,
Quoted 11 lines · In message <[email protected]> you wrote:
Commit 46d7274 "UBIFS: Change ubifsload to set the filesize variable" introduced the follwing compiler warning:
ubifs.c: In function 'ubifs_load':
ubifs.c:742: warning: format '%lX' expects type 'long unsigned int', but argument 3 has type 'u32'Signed-off-by Wolfgang Denk <[email protected]>Cc Bastian Ruppert <[email protected]>--- fs/ubifs/ubifs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Premature optimization is the root of all evil. -- D.E. Knuth
PATCH 1/1 UBIFS: Change ubifsload to set the filesize variable
In reply to Bastian RuppertQuoted 21 lines · Bastian Ruppert
This is the same behaviour like tftp or fatload command.
Signed-off-by Bastian Ruppert <[email protected]>CC kmpark at infradead.org--- fs/ubifs/ubifs.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)fs/ubifs/ubifs.c +1
-0@@ -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
fs/ubifs/ubifs.c int ubifs_load(char *filename, u32 addr, u32 size) · line 725
Quoted 6 lines
fs/ubifs/ubifs.c +3
-0@@ -719,6 +720,9 @@ int ubifs_load(char *filename, u32 addr, u32 size)printf ("Loading file '%s' to addr 0x%08x with size %d (0x%08x)...\n" , filename, addr, size, size); +sprintf (buf,"%lX" , size); +setenv ("filesize" , buf); +
Hi,
maybe you want to check set_local_var() too ?
Quoted 3 lines
fs/ubifs/ubifs.c +0
-0page.addr = (void *)addr; page.index =0 ; page.inode = inode;
PATCH 1/1 UBIFS: Change ubifsload to set the filesize variable
Dear Marek Vasut,
Quoted 4 lines · In message <[email protected]> you wrote:
fs/ubifs/ubifs.c int ubifs_load(char *filename, u32 addr, u32 size) · line 724
Quoted 2 lines
fs/ubifs/ubifs.c +1
-0+setenv ("filesize" , buf);maybe you want to check
set_local_var()too ?
Yes, we should clean up all these auto-generated environment variables one day. But what you propose here is not a good approach:
(1) not all boards use the hush shell, and set_local_var() is only available there.
(2) if you make such a change, then you must make it everywhere, and you must make sure not to break existent use of these things.
Both is definitely out of the scope of this patch.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Quote from a recent meeting: "We are going to continue having these meetings everyday until I find out why no work is getting done."
PATCH 1/1 UBIFS: Change ubifsload to set the filesize variable
Quoted 10 lines · Wolfgang Denk
Dear Marek Vasut,
Quoted 3 lines · In message <[email protected]> you wrote:
fs/ubifs/ubifs.c int ubifs_load(char *filename, u32 addr, u32 size) · line 724
Quoted 1 line
fs/ubifs/ubifs.c +1
-0+setenv ("filesize" , buf);maybe you want to check
set_local_var()too ?Yes, we should clean up all these auto-generated environment variables one day. But what you propose here is not a good approach:
Quoted 6 lines
(1) not all boards use the hush shell, and
set_local_var()is only available there.
(2) if you make such a change, then you must make it everywhere, and you must make sure not to break existent use of these things.Both is definitely out of the scope of this patch.
You're definitelly right on this thing.
Quoted 4 lines
Best regards,
Wolfgang Denk