Skip to contentSkip to conversation

Integrating new MTD/jffs2 into 2.4.18 kernel

DISCUSSION Steven Hein 3 participants 5 messages Jul 25, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello,

I am running on an ARM platform using the 2.4.18 kernel with 2.4.18-rmk7 patch. I'm using the MTD NAND flash support, and I'm having problems running a jffs2 filesystem on a NAND flash device (not a root filesystem,
just a writable "scratch" directory).

Using a snapshot from yesterday, I tried to integrate the jffs2 from the snapshot into my kernel. But there were a few issues:
- include/linux/crc32.h but expected by the files in fs/jffs2
- zlib.[ch] were not in the jffs2 dir as they were previously

I tried fixing these, but still ended up missing the zlib_deflate* functions.....

So my question is: is there a place I can grab the MTD/jffs2 stuff
to drop directly into a 2.4.18-rmk7 kernel? Or, is there a
procedure somewhere describing how to integrate the latest MTD from CVS (especially jffs2) into the latest 2.4.x kernel?

Thanks in advance!

Steve

Signature · 6 lines
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Steve Hein ([email protected])              Engineering Diagnostics/Software
Silicon Graphics, Inc.                          
1168 Industrial Blvd.                 Phone: (715) 726-8410
Chippewa Falls, WI 54729              Fax:   (715) 726-6715
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#1 lore raw
Quoted 11 lines · Steven Hein

I am running on an ARM platform using the 2.4.18 kernel with 2.4.18-rmk7 patch. I'm using the MTD NAND flash support, and I'm having problems running a jffs2 filesystem on a NAND flash device (not a root filesystem,
just a writable "scratch" directory).

Using a snapshot from yesterday, I tried to integrate the jffs2 from the snapshot into my kernel. But there were a few issues:
- include/linux/crc32.h but expected by the files in fs/jffs2
- zlib.[ch] were not in the jffs2 dir as they were previously

Quoted 7 lines

I tried fixing these, but still ended up missing the zlib_deflate* functions.....

So my question is: is there a place I can grab the MTD/jffs2 stuff
to drop directly into a 2.4.18-rmk7 kernel? Or, is there a
procedure somewhere describing how to integrate the latest MTD from CVS (especially jffs2) into the latest 2.4.x kernel?

You might want to take a look at a current -ac kernel. I had the same problems (and more), merging with a modified 2.4.2 kernel. Basically, whenever there was something missing, I took a look into the -ac kernel, modified mine accordingly, and went on to the next problem.

My guess is that you need the zlib stuff in the kernel lib, you should have linux/lib/zlib_inflate and linux/lib/zlib_deflate in your source plus some modifications in arch/<yours>/config.in, lib/Makefile and include/linux/zlib.h. Roughly.

Joern

#2 lore raw
Quoted 4 lines · [email protected] said:

My guess is that you need the zlib stuff in the kernel lib, you
should have linux/lib/zlib_inflate and linux/lib/zlib_deflate in your source plus some modifications in arch/<yours>/config.in, lib/Makefile and include/linux/zlib.h. Roughly.

ftp://ftp.??.kernel.org/pub/linux/kernel/people/dwmw2/shared-zlib/linux-2.4.19-pre10-shared-zlib.bz2

And I think you may need to copy fs/jffs2/crc32.h to include/linux/crc32.h or something similar.

--
dwmw2

#3 lore raw

David, Joern,

Thanks for the help! My jffs2 filesystem is now working in NAND flash!

For the benefit of others, here's a summary of what I needed to do to get this going.

Here's generally what I needed to do.

1) apply the patch ftp://ftp.kernel.org/pub/linux/kernel/people/dwmw2/shared-zliblinux-2.4.19-pre10-shared-zlib.bz2

NOTE: I am running linux-2.4.18 + linux-2.4.18-rmk7 ARM patch,
which already contains some parts of the above patch. So, I had to go through the patch and grab the parts I needed. If this is the case for you.....

a) copy CVS:mtd/lib/zlib_inflate and CVS:mtd/lib/zlib_deflate to linux/lib
b) modify linux/lib Makefile as indicated in the above patch
c) remove linux/fs/inflate_fs
e) modify linux/fs/Makefile and linux/fs/cramfs/uncompress.c as indicated in the above patch
f) add the line "source lib/Config.in" to arch/<yours>/Config.in (as is done in the above patch)
*) I think that's all I needed....basically I went through the above
patch and applied everything in it by hand.

2) remove linux/fs/jffs2

3) copy CVS:mtd/fs/jffs2 to linux/fs/jffs2

4) copy fs/jffs2/crc32.h to linux/include/linux/crc32.h

5) in linux/fs/jffs2/file.c, there is a reference to PageUptodate()
that must be changed to Page_Uptodate() (looks like this syntax
changed from 2.4 to 2.5 kernel....)

6) apply the following patch to linux/fs/Config.in:

fs/Config.in Thu Jul 25 10:05:41 2002 renamed from fs/Config.in Mon Feb 25 13:38:07 2002 +1 -0
diff -uNr linux/fs/Config.in linux.new_jffs2/fs/Config.in
@@ -42,6 +42,7 @@
 dep_tristate 'Journalling Flash File System v2 (JFFS2) support' CONFIG_JFFS2_FS $CONFIG_MTD
 if [ "$CONFIG_JFFS2_FS" = "y" -o "$CONFIG_JFFS2_FS" = "m" ] ; then
    int 'JFFS2 debugging verbosity (0 = quiet, 2 = noisy)' CONFIG_JFFS2_FS_DEBUG 0
+   dep_bool '  JFFS2 support for NAND flash (EXPERIMENTAL)' CONFIG_JFFS2_FS_NAND $CONFIG_EXPERIMENTAL
 fi
 tristate 'Compressed ROM file system support' CONFIG_CRAMFS
 bool 'Virtual memory file system support (former shm fs)' CONFIG_TMPFS

Once I did that, I had a working, writable JFFS2 filesystem running on NAND flash.

Thanks again for the help!!

Steve

Quoted 18 lines · David Woodhouse
Quoted 4 lines · [email protected] said:

My guess is that you need the zlib stuff in the kernel lib, you
should have linux/lib/zlib_inflate and linux/lib/zlib_deflate in your source plus some modifications in arch/<yours>/config.in, lib/Makefile and include/linux/zlib.h. Roughly.

ftp://ftp.??.kernel.org/pub/linux/kernel/people/dwmw2/shared-zlib/linux-2.4.19-pre10-shared-zlib.bz2

And I think you may need to copy fs/jffs2/crc32.h to include/linux/crc32.h or something similar.

--
dwmw2

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

Signature · 6 lines
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Steve Hein ([email protected])              Engineering Diagnostics/Software
Silicon Graphics, Inc.                          
1168 Industrial Blvd.                 Phone: (715) 726-8410
Chippewa Falls, WI 54729              Fax:   (715) 726-6715
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#4 lore raw
Quoted 3 lines · [email protected] said:

5) in linux/fs/jffs2/file.c, there is a reference to PageUptodate()
that must be changed to Page_Uptodate() (looks like this syntax
changed from 2.4 to 2.5 kernel....)

Copy CVS:mtd/include/linux/mtd/compatmac.h to linux/include/mtd/compatmac.h

--
dwmw2