
ROMFS: Add support for ROMFS filesystem based on MTD system.
signed-off-by: Michal Simek monstr@monstr.eu
Patch is in attachement.
Best regards, Michal Simek

In message 003901c7b366$e4c09190$0200a8c0@monstrone you wrote:
ROMFS: Add support for ROMFS filesystem based on MTD system.
signed-off-by: Michal Simek monstr@monstr.eu
Patch is in attachement.
Please cleanup coding style violations (trailing white space, indentation not by TAB etc.) and resubmit.
Best regards,
Wolfgang Denk

Please cleanup coding style violations (trailing white space, indentation not by TAB etc.) and resubmit.
I hope you thought Use TAB characters for indentation, not spaces. (http://www.denx.de/wiki/UBoot/CodingStyle)
I resolve some coding style violations.
Best regards, Michal Simek
ROMFS: Add support for ROMFS filesystem based on MTD system.
signed-off-by: Michal Simek monstr@monstr.eu
Patch is in attachement.
Please cleanup coding style violations (trailing white space, indentation not by TAB etc.) and resubmit.
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@denx.de Don't tell me how hard you work. Tell me how much you get done.
v -- James J. Ling

In message 2385.4489-20586-1540854178-1182406872@seznam.cz you wrote:
Please cleanup coding style violations (trailing white space, indentation not by TAB etc.) and resubmit.
I hope you thought Use TAB characters for indentation, not spaces. (http://www.denx.de/wiki/UBoot/CodingStyle)
I mean what I wrote: your patch contained coding style violations; one of these was that indentation was NOT done by TABs.
I resolve some coding style violations.
Then please also remove the remaining ones now (trailing white space in common/cmd_jffs2.c) and resubmit again.
Best regards,
Wolfgang Denk

Then please also remove the remaining ones now (trailing white space in common/cmd_jffs2.c) and resubmit again.
I checked all files on trailing white space. I don't see them.
Best regards Michal Simek
[microblaze@monstr u-boot]$ patch -p1 < ../romfs3.patch patching file Makefile patching file common/cmd_jffs2.c patching file fs/Makefile patching file fs/romfs/Makefile patching file fs/romfs/romfs.c [microblaze@monstr u-boot]$ cat Makefile | grep " $" [microblaze@monstr u-boot]$ cat common/cmd_jffs2.c | grep " $" [microblaze@monstr u-boot]$ cat fs/Makefile | grep " $" [microblaze@monstr u-boot]$ cat fs/romfs/Makefile | grep " $" [microblaze@monstr u-boot]$ cat fs/romfs/romfs.c | grep " $" [microblaze@monstr u-boot]$
ROMFS: Add support for ROMFS filesystem based on MTD system. signed-off-by: Michal Simek monstr@monstr.eu

Hello,
in message 2563.4065-19092-1374891071-1182588014@seznam.cz you wrote:
Then please also remove the remaining ones now (trailing white space in common/cmd_jffs2.c) and resubmit again.
I checked all files on trailing white space. I don't see them.
I know. That's the problem with white space - you don't see it. Printing characters are better visible ;-)
[microblaze@monstr u-boot]$ patch -p1 < ../romfs3.patch patching file Makefile patching file common/cmd_jffs2.c patching file fs/Makefile patching file fs/romfs/Makefile patching file fs/romfs/romfs.c [microblaze@monstr u-boot]$ cat Makefile | grep " $" [microblaze@monstr u-boot]$ cat common/cmd_jffs2.c | grep " $" [microblaze@monstr u-boot]$ cat fs/Makefile | grep " $" [microblaze@monstr u-boot]$ cat fs/romfs/Makefile | grep " $" [microblaze@monstr u-boot]$ cat fs/romfs/romfs.c | grep " $"
This gives you 5 UUOCA in a row, whichis kind of a record, but it does not help much - for example, you don't find any trailing TABs that way.
... diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c index 7fd1fa3..6da6470 100644 ... @@ -1961,13 +1975,18 @@ int do_jffs2_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) if ((part = jffs2_part_info(current_dev, current_partnum))){
/* check partition type for cramfs */
fsname = (cramfs_check(part) ? "CRAMFS" : "JFFS2");
printf("### filesystem type is %s\n", fsname);
puts("### filesystem type is ");
if (cramfs_check(part)) {
puts("CRAMFS\n"); ret = cramfs_info (part);
vi's "l" command shows this line as "+^I^I^I$", i. e. 3 trailing TABs.
Best regards,
Wolfgang Denk

I know. That's the problem with white space - you don't see it. Printing characters are better visible ;-)
yes, you are right. Some characters are really better visible :-)
This gives you 5 UUOCA in a row, whichis kind of a record, but it does not help much - for example, you don't find any trailing TABs that way. vi's "l" command shows this line as "+^I^I^I$", i. e. 3 trailing TABs.
I know this command (set list).
I hope that 3 TABS in one row was the last fault. :-)
Best regards Michal Simek
ROMFS: Add support for ROMFS filesystem based on MTD system. signed-off-by: Michal Simek monstr@monstr.eu

On Sat, Jun 23, 2007 at 02:34:16PM +0200, Wolfgang Denk wrote:
vi's "l" command shows this line as "+^I^I^I$", i. e. 3 trailing TABs.
and vim's "let c_space_errors=1" will show all such spacing errors in red (beware, some u-boot's files will really burn your eyes ;-))
Best regards, ladis

On Sat, Jun 23, 2007 at 02:34:16PM +0200, Wolfgang Denk wrote:
vi's "l" command shows this line as "+^I^I^I$", i. e. 3 trailing TABs.
and vim's "let c_space_errors=1" will show all such spacing errors in red (beware, some u-boot's files will really burn your eyes ;-))
Thanks.
Vim can find all trailing white spaces with commands "/\t$| $".
Best regards Michal Simek

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Michal Simek wrote:
On Sat, Jun 23, 2007 at 02:34:16PM +0200, Wolfgang Denk wrote:
vi's "l" command shows this line as "+^I^I^I$", i. e. 3 trailing TABs.
and vim's "let c_space_errors=1" will show all such spacing errors in red (beware, some u-boot's files will really burn your eyes ;-))
Thanks.
Vim can find all trailing white spaces with commands "/\t$| $".
Or just "%s/\s+$//" and be done with it...
- -Cory
- -- Cory T. Tusar Embedded Systems Engineer Videon Central, Inc. 2171 Sandy Drive State College, PA 16801 (814) 235-1111 x316 (814) 235-1118 fax
"There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies." --Sir Charles Anthony Richard Hoare

On 6/23/07, Monstr@seznam.cz Monstr@seznam.cz wrote:
Then please also remove the remaining ones now (trailing white space in common/cmd_jffs2.c) and resubmit again.
I checked all files on trailing white space. I don't see them.
FWIW, I like to run all my code through scripts/Lindent (in the Linux kernel tree) before submitting. It takes care of all that fiddly stuff so I don't have to go searching for things.
Cheers, g.

FWIW, I like to run all my code through scripts/Lindent (in the Linux kernel tree) before submitting. It takes care of all that fiddly stuff so I don't have to go searching for things.
Lindent skript is good but it is without checking long of comment and intend create lot of coding style violations
I use liuboot. (Lindent with -pcs - http://www.denx.de/wiki/UBoot/CodingStyle) [microblaze@monstr common]$ cat /home/uboot/liuboot #!/bin/sh indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs -pcs "$@"
You can try it on common/cmd_jffs2.c [microblaze@monstr common]$ liuboot cmd_jffs2.c [microblaze@monstr common]$
And check.
Without checking long of comment- Is it a problem longer row than 80 character? lines 56, 64, 69, 557
Check the lines 477, 681, 721, 819, 1307, 1402, etc.- consist of some white space (Do not add more than 2 empty lines to source files - it is violation)
I think Lindent with -pcs (or liuboot) is great but brings up many problems.
Best regards Michal Simek

On 6/20/07, Michal Simek monstr@seznam.cz wrote:
ROMFS: Add support for ROMFS filesystem based on MTD system.
signed-off-by: Michal Simek monstr@monstr.eu
Patch is in attachement.
Please send your patches inline. It is harder to comment on patches that are attachments because I cannot hit 'reply' and start typing. Patches that don't get reviewed are harder to get merged. (git-send-email is your friend here)
I needed to cut and paste to write this email, but here are some comments.
Also, it's looking more and more like there needs to be an abstraction between filesystems and block devices. (More of a general comment than a comment on your patch) Overriding cmd_jffs2 to do more and more filesystems just smells wrong.
Otherwise, it's a good looking driver.
Cheers, g.
Best regards, Michal Simek
diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c index 7fd1fa3..92bd898 100644 --- a/common/cmd_jffs2.c +++ b/common/cmd_jffs2.c @@ -85,7 +85,7 @@ */
/*
- JFFS2/CRAMFS support
- JFFS2/CRAMFS/ROMFS support
Hmmm, perhaps the filename cmd_jffs2.c needs to be changed.
*/ #include <common.h> #include <command.h> @@ -175,6 +175,11 @@ extern int cramfs_load (char *loadoffset, struct part_info *info, char *filename extern int cramfs_ls (struct part_info *info, char *filename); extern int cramfs_info (struct part_info *info);
+extern int romfs_check (struct part_info *info); +extern int romfs_load (char *loadoffset, struct part_info *info, char *filename); +extern int romfs_ls (struct part_info *info, char *filename); +extern int romfs_info (struct part_info *info);
static struct part_info* jffs2_part_info(struct mtd_device *dev, unsigned int part_num);
/* command line only routines */ @@ -1874,14 +1879,22 @@ int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if ((part = jffs2_part_info(current_dev, current_partnum))){
/* check partition type for cramfs */
fsname = (cramfs_check(part) ? "CRAMFS" : "JFFS2");
/* check partition type for JFFS2, cramfs, romfs */
if (cramfs_check(part)) {
fsname = "CRAMFS";
} else if (romfs_check(part)) {
fsname = "ROMFS";
} else {
fsname = "JFFS2";
}
printf("### %s loading '%s' to 0x%lx\n", fsname, filename, offset);
if (cramfs_check(part)) { size = cramfs_load ((char *) offset, part, filename);
} else if (romfs_check(part)){
size = romfs_load ((char *) offset, part, filename);
} else {
/* if this is not cramfs assume jffs2 */
}/* if this is not cramfs or romfs assume jffs2 */ size = jffs2_1pass_load((char *)offset, part, filename);
@@ -1928,8 +1941,10 @@ int do_jffs2_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) /* check partition type for cramfs */ if (cramfs_check(part)) { ret = cramfs_ls (part, filename);
} else if (romfs_check(part)) {
} else {ret = romfs_ls (part, filename);
/* if this is not cramfs assume jffs2 */
}/* if this is not cramfs or romfs assume jffs2 */ ret = jffs2_1pass_ls(part, filename);
@@ -1951,7 +1966,6 @@ int do_jffs2_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) int do_jffs2_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { struct part_info *part;
char *fsname; int ret;
/* make sure we are in sync with env variables */
@@ -1961,13 +1975,18 @@ int do_jffs2_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) if ((part = jffs2_part_info(current_dev, current_partnum))){
/* check partition type for cramfs */
fsname = (cramfs_check(part) ? "CRAMFS" : "JFFS2");
printf("### filesystem type is %s\n", fsname);
puts("### filesystem type is ");
if (cramfs_check(part)) {
puts("CRAMFS\n"); ret = cramfs_info (part);
} else if (romfs_check(part)) {
puts("ROMFS\n");
ret = romfs_info (part);
} else {
/* if this is not cramfs assume jffs2 */
/* if this is not cramfs or romfs assume jffs2 */
}puts("JFFS2\n"); ret = jffs2_1pass_info(part);
diff --git a/fs/Makefile b/fs/Makefile index 273d90e..118ae78 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -22,7 +22,7 @@ # #
-SUBDIRS := jffs2 cramfs fdos fat reiserfs ext2 +SUBDIRS := romfs jffs2 cramfs fdos fat reiserfs ext2
$(obj).depend all: @for dir in $(SUBDIRS) ; do \ diff --git a/fs/romfs/romfs.c b/fs/romfs/romfs.c index e69de29..1a4b931 100644 --- a/fs/romfs/romfs.c +++ b/fs/romfs/romfs.c @@ -0,0 +1,270 @@ +/*
- (C) Copyright 2007 Michal Simek
- Michal SIMEK monstr@monstr.eu
- See file CREDITS for list of people who contributed to this
- project.
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of
- the License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- MA 02111-1307 USA
- */
+#include <common.h> +#include <malloc.h> +#include <command.h>
+#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
I believe Jon's patches have caused CONFIG_COMMANDS to go away. Also, shouldn't it be gated by a new config value "CONFIG_CMD_ROMFS"?
+static int romfs_list_inode (struct part_info *info, unsigned long offset) +{
- struct romfs_inode *inode =
(struct romfs_inode *)(PART_OFFSET (info) + offset);
- struct romfs_inode *hardlink = NULL;
- char str[3], *data;
+/* mapping spec.info means
- 0 hard link link destination [file header]
- 1 directory first file's header
- 2 regular file unused, must be zero [MBZ]
- 3 symbolic link unused, MBZ (file data is the link content)
- 4 block device 16/16 bits major/minor number
- 5 char device - " -
- 6 socket unused, MBZ
- 7 fifo unused, MBZ */
- switch (inode->next & 0x7) {
- case 0:
str[0] = 'h';
break;
- case 1:
str[0] = 'd';
break;
- case 2:
str[0] = 'f';
break;
- case 3:
str[0] = 'l';
break;
- case 4:
str[0] = 'b';
break;
- case 5:
str[0] = 'c';
break;
- case 6:
str[0] = 's';
break;
- case 7:
str[0] = 'p';
break;
- default:
str[0] = '?';
- }
This can be done in a less verbose way by using an offset into a table or string.
- if (inode->next & 0x8) {
str[1] = 'x';
- } else {
str[1] = '-';
- }
Maybe? str[1] = inode->next & 0x8 ? 'x' : '-';

Grant,
On 6/20/07, Michal Simek monstr@seznam.cz wrote:
ROMFS: Add support for ROMFS filesystem based on MTD system.
signed-off-by: Michal Simek monstr@monstr.eu
Patch is in attachement.
Please send your patches inline. It is harder to comment on patches that are attachments because I cannot hit 'reply' and start typing. Patches that don't get reviewed are harder to get merged. (git-send-email is your friend here)
I needed to cut and paste to write this email, but here are some comments.
OK. Next driver.
Also, it's looking more and more like there needs to be an abstraction between filesystems and block devices. (More of a general comment than a comment on your patch) Overriding cmd_jffs2 to do more and more filesystems just smells wrong.
Otherwise, it's a good looking driver.
Yes. I agree with you. System around block devices and filesystems needs rebuild.
/*
- JFFS2/CRAMFS support
- JFFS2/CRAMFS/ROMFS support
Hmmm, perhaps the filename cmd_jffs2.c needs to be changed.
It's the same design goal as CRAMFS.
- str[0] = 'h';
- break;
- case 1:
- str[0] = 'd';
- break;
- case 2:
- str[0] = 'f';
- break;
- case 3:
- str[0] = 'l';
- break;
- case 4:
- str[0] = 'b';
- break;
- case 5:
- str[0] = 'c';
- break;
- case 6:
- str[0] = 's';
- break;
- case 7:
- str[0] = 'p';
- break;
- default:
- str[0] = '?';
- }
This can be done in a less verbose way by using an offset into a table or string.
Yes, it can be.
- if (inode->next & 0x8) {
- str[1] = 'x';
- } else {
- str[1] = '-';
- }
Maybe? str[1] = inode->next & 0x8 ? 'x' : '-';
It can be accepted.
Michal Simek
participants (6)
-
Cory T. Tusar
-
Grant Likely
-
Ladislav Michl
-
Michal Simek
-
Monstr@seznam.cz
-
Wolfgang Denk