Skip to contentSkip to conversation

Strange! Cannot use JFFS2 as root

DISCUSSION colin 2 participants 3 messages Oct 20, 2004 – Oct 21, 2004

lore
Share & tools
lore

colin

author
#0 lore raw

Hi all,
I had booted up Linux with nfs root, and write a JFFS2 image to /dev/mtd1. Here is my cmdline for Kernel:

     go 0x80305018 root=/dev/nfs rw nfsroot=172.19.26.145:/nfs/rootfs

ip=172.19.27.193::172.19.27.254:255.255.254.0:::
mtdparts=maltaflash:1536k(ldr),2048k(root)

After writing the JFFS2 image to /dev/mtd1, I can mount /dev/mtdblcok1 to some directory.
mount -t jffs2 /dev/mtdblock1 /mnt

Next, I hope to boot up Linux with JFFS2 root, and try to give this cmdline to Kernel:

    go 0x80305018 rootfstype=jffs2

mtdparts=maltaflash:1536k(ldr),2048k(root) root=/dev/mtdblock1

and the Kernel would complain me about no root:
VFS: Unable to mount root fs via NFS, trying floppy. Kernel panic: VFS: Unable to mount root fs on unknown-block(2,0)

I traced the code and found that when passing "/dev/mtdblock1" to name_to_dev_t() in do_mounts.c, it would return 0 at every try_name(), which will fail at open() with the path "/sys/block/%s/dev".

What's the problem? Could anyone tell me?

Thanks and regards,
Colin

#1 lore raw
Quoted 5 lines

I traced the code and found that when passing "/dev/mtdblock1" to name_to_dev_t() in do_mounts.c, it would return 0 at every try_name(), which will fail at open() with the path "/sys/block/%s/dev".

What's the problem? Could anyone tell me?

If I remember correctly you need to pass the root in as the major and minor numbers for jffs2 on 2.6. For example my 2.6 command line is

	root=31:03 rootfstype=jffs2 ro console=ttyS0,115200

rather that root=/dev/mtdblock3.

I can't remember why this is the case though.

Ian.

Signature · 4 lines
Ian Campbell, Senior Design Engineer
                                        Web: http://www.arcom.com
Arcom, Clifton Road, 			Direct: +44 (0)1223 403 465
Cambridge CB1 7EA, United Kingdom	Phone:  +44 (0)1223 411 200
author
#2 lore raw

Hi Ian,
Thank you. It works by your way.
I had already tried "root=1f:01" and it didn't work, and then I spent whole day to test it... :-(
It seems that "root=1f01" and "root=31:01" are both acceptable.

Thanks and regards,
Colin

----- Original Message -----
From: "Ian Campbell" <[email protected]>
To: "colin" <[email protected]>
Cc: <[email protected]>
Sent: Wednesday, October 20, 2004 10:29 PM
Subject: [*VIP*] Re: Strange! Cannot use JFFS2 as root

Quoted 2 lines
Quoted 2 lines

I traced the code and found that when passing "/dev/mtdblock1" to name_to_dev_t() in do_mounts.c, it would return 0 at every try_name(),

which

Quoted 18 lines
Quoted 3 lines

will fail at open() with the path "/sys/block/%s/dev".

What's the problem? Could anyone tell me?

If I remember correctly you need to pass the root in as the major and minor numbers for jffs2 on 2.6. For example my 2.6 command line is root=31:03 rootfstype=jffs2 ro console=ttyS0,115200
rather that root=/dev/mtdblock3.

I can't remember why this is the case though.

Ian.

Signature · 4 lines
Ian Campbell, Senior Design Engineer
                                        Web: http://www.arcom.com
Arcom, Clifton Road, Direct: +44 (0)1223 403 465
Cambridge CB1 7EA, United Kingdom Phone:  +44 (0)1223 411 200