Skip to contentSkip to conversation

jffs2: change U_BOOT_CMD ls to fsls

PATCH New Suriyan Ramasami 2 participants 3 messages Oct 10, 2013 – Oct 13, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 jffs2: change U_BOOT_CMD ls to fsls

multiple definitions of `_u_boot_list_2_cmd_2_ls' if CONFIG_CMD_JFFS2 and CONFIG_CMD_FS_GENERIC are defined.

---
 common/cmd_jffs2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/cmd_jffs2.c +1 -1
index bce0983..f38455f 100644
@@ -606,7 +606,7 @@ U_BOOT_CMD(
 	"      with offset 'off'"
 );
 U_BOOT_CMD(
-	ls,	2,	1,	do_jffs2_ls,
+	fsls,	2,	1,	do_jffs2_ls,
 	"list files in a directory (default /)",
 	"[ directory ]"
 );
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 jffs2: change U_BOOT_CMD ls to fsls

Dear Suriyan Ramasami,

Quoted 13 lines · In message <[email protected]> you wrote:

multiple definitions of `_u_boot_list_2_cmd_2_ls' if CONFIG_CMD_JFFS2 and CONFIG_CMD_FS_GENERIC are defined.

---
 common/cmd_jffs2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/cmd_jffs2.c +0 -0
index bce0983..f38455f 100644

common/cmd_jffs2.c U_BOOT_CMD( · line 609

Quoted 5 lines
common/cmd_jffs2.c +1 -1
@@ -606,7 +606,7 @@ U_BOOT_CMD(
 	"      with offset 'off'"
 );
 U_BOOT_CMD(
-	ls,	2,	1,	do_jffs2_ls,
+	fsls,	2,	1,	do_jffs2_ls,

This makes no sense to me. Either we mimick Unix style, then the command name shouldbe "ls' (where else but in a file system could you LiSt files?); or we implement file system specific commands, than the name of the file system should be recognizable.

I think your problem should be fixed differently (such that "ls" also works with JFFS2).

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
backups: always in season, never out of style.
#2 lore raw

PATCH 1/1 jffs2: change U_BOOT_CMD ls to fsls

Hello Wolfgang Denk,

Quoted 27 lines · Wolfgang Denk

Dear Suriyan Ramasami,

Quoted 13 lines · In message <[email protected]> you wrote:

multiple definitions of `_u_boot_list_2_cmd_2_ls' if CONFIG_CMD_JFFS2 and CONFIG_CMD_FS_GENERIC are defined.

---
 common/cmd_jffs2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/cmd_jffs2.c +0 -0
index bce0983..f38455f 100644

common/cmd_jffs2.c U_BOOT_CMD( · line 609

Quoted 5 lines
common/cmd_jffs2.c +1 -1
@@ -606,7 +606,7 @@ U_BOOT_CMD(
      "      with offset 'off'"
 );
 U_BOOT_CMD(
-     ls,     2,      1,      do_jffs2_ls,
+     fsls,   2,      1,      do_jffs2_ls,

This makes no sense to me. Either we mimick Unix style, then the command name shouldbe "ls' (where else but in a file system could you LiSt files?); or we implement file system specific commands, than the name of the file system should be recognizable.

Quoted 3 lines

I think your problem should be fixed differently (such that "ls" also works with JFFS2).

I think I haven't defined the problem properly. I am sure you know about the below, but am just reemphasizing so we could discuss the issue.

The macro U_BOOT_CMD maps the user invocable commands at the u-boot prompt to actual function calls. For example, looking at common/cmd_ext4.c It defines the below:
ext4ls maps to do_ext4_ls()
ext4load maps to do_ext4_load()
etc.
Looking at the CMD_SYS_FS_GENERIC (common/cmd_fs.c) implementation which works with the u-boot commands ls and load as follows:
ls maps to do_ls_wrapper()
load maps to do_load_wrapper()
Looking at CONFIG_CMD_JFFS2 with comman/cmd_jffs2.c, we see that it defines the u-boot commands ls, fsinfo and fsload as follows:
ls maps to do_jffs_fsload()
fsload maps to do_jffs_fsload()
fsinfo maps to do_jffs2_fsinfo()

Firstly, this is a little inconsistent in the u-boot command name, namely, ls is for ls of jffs fs, but the load and info commands have an fs prefix - fsload, fsinfo.

Hence, we are left with two u-boot commands with the same name - ls, one for jffs2 and the other for fs.c leading to the linking issue.

Quoted 10 lines

Best regards,

Wolfgang Denk

--
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
backups: always in season, never out of style.