Help with using JFFS2 as root filesystem

Hi all,

I have been trying to get the JFFS2 working on Linux kernel 2.4.20 that is implemented on ppc. I have used Ramdisk based filesystem with no problem. However, I need a filesystem that can preserve all changes after reboot. I have problem with configuring the kernel to enable the support for JFFS2. I have enabled the following options on the kernel configuration:

- Memory Technology Device (MTD) support

- Debugging (debugging verbosity = 3)

- MTD partitioning support

- Command line partition table parsing

- Direct char device access to MTD devices

- Caching block device access to MTD devices

- NFTL support (write support to NFTL)

- RAM/ROM/Flash chip device: Detect Flash chip by CFI probe Support for AMD/Fujitsu flash chips I also modified the Initial Kernel command string to:

- console=ttl0,9600 noinitrd rw ip=off root=/dev/mtdblock3 rootfstype=jffs2

I re-compiled the kernel, programmed it to flash. I still use the same ramdisk image that I use for ramdisk-based filesystem. After Linux is started on the board, I can see the following nodes being created: /dev/mtd /dev/mtdblock , and the following entry in /proc: /proc/mtd When I did # cat /proc/mtd, the partition list was empty. I know it's supposed to show where the bootloader, kernel, and filesystem is mounted on /dev/mtd*. I programmed the files for bootloader, kernel, and filesystem to specific Flash locations separately by using Xilinx XPS. By now, I have only enabled the support of JFFS2 filesystem on the kernel. Is there any extra steps I should do to configure the partition? I expected that the /dev/mtdblock0, /dev/mtdblock1, etc, are created automatically once I enabled the support, but apparently they didn't. What did I do wrong? Any suggestion will be greatly appreciated. Thanks.

Shirley

Reply to
smayadewi
Loading thread data ...

Why not boot like you already do and use JFF2 as another file system sitting on MTD for an unused area of the flash chip.

-Michael

Reply to
Michael Schnell

Hi Michael,

If I want to use JFFS2 as another file system in addition to the Ramdisk based file system, how do I link to it once the Linux is started? Or does it have to be done during the kernel configuration? Thanks.

Shirley

Reply to
smayadewi

You can either link the jff2 driver statically in the Kernel or link it dynamically with insmod or modprobed.

I don't know if the mtd driver can be linked dynamically, but I suppose it can.

-Michael

Reply to
Michael Schnell

You need to create a mount point in the rout file system to access the jff2 (supposedly in 2.6 the driver can do this in the proc file system automatically if configured to do so).

Now you need to mount jff2 into a directory of the root file system, of course.

-Michael

Reply to
Michael Schnell

Hi Michael,

Thanks for your replies. I really appreciate it.

I have enabled the support for both MTD and JFFS2 when I compiled the kernel. Now I suppose I don't need to load the drivers separately. I have tried creating the mount point (/tmp) and mounting the /dev/ mtdblock to it, it didn't work. Before I mounted the /dev/mtdblock*, I actually have to copy the JFFS2 image to the /dev/mtd* node. But when I tried to copy my JFFS2 image to the /dev/mtd node, it gave me error message :"block device required". The same error message appeared when I tried to copy to /dev/mtdblock. Then, I manually created the following nodes: # mknod /dev/mtd0 c 90 0 # mknod /dev/mtdblock0 b 31 0 I tried to copy the JFFS2 image to the /dev/mtd0 again, and it gave me message: "no such device".

FYI: when I enabled CFI Flash device on physical memory map, I expected an extended menu would show up containing the option for specifying the start, length, and the bus width as in the uClinux. But nothing else appeared. I am using Montavista linux. I wonder if this is the reason why the mtd and mtdblock do not get mounted properly. If not, I wonder how can I partition the flash manually? Do I have to modify the driver for the flash?

Shirley

Reply to
smayadewi

Up till now I did not use MTD, so I don't know how to link jff2 to MTD.

-Michael

Reply to
Michael Schnell

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.