JFFS2 filesystem with QEMU

1 283 visualizações
Ir para a primeira mensagem não lida

Vincent BENOIT

não lida,
06/10/2011, 08:45:5906/10/11
para mini...@googlegroups.com
Hi all,

I'm trying to use QEMU (git version : http://repo.or.cz/w/qemu/mini2440.git) to emulate my mini2440 with a jffs2 filesystem,
but I already have the same error :

VFS: Mounted root (jffs2 filesystem) on device 31:0.
Freeing init memory: 120K
Failed to execute /sbin/init.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
[<c002b180>] (unwind_backtrace+0x0/0xf0) from [<c0307428>] (panic+0x54/0x188)
[<c0307428>] (panic+0x54/0x188) from [<c0026584>] (init_post+0xa0/0xc4)
[<c0026584>] (init_post+0xa0/0xc4) from [<c00083fc>] (kernel_init+0x100/0x138)
[<c00083fc>] (kernel_init+0x100/0x138) from [<c00277d0>] (kernel_thread_exit+0x0/0x8)

this is the method I used to create my NAND Flash :

dd of=mini2440_nand_flash.img bs=528 count=128k if=/dev/zero
dd of=mini2440_nand_flash.img bs=528 conv=notrunc if=rootfs.jffs2

I have only one partition configured in my "Flash"

after I use the mini2440_start.sh script to launch qemu.

This is the kernel boot args configured in my u-boot :
bootargs=root=/dev/mtdblock0 rootfstype=jffs2 console=ttySAC0,115200 init=/sbin/init

I verify that /sbin/init exists in my filesystem and it points to /bin/busybox

Anyone succeeds to use QEMU with JFFS2 filesystem ?

Best regards

M P

não lida,
07/10/2011, 04:20:4807/10/11
para mini...@googlegroups.com

I don't think you /can/ use jffs2 by "blasting" it onto the correct
block size as you do, jffs2 uses some of the ECC to store metadata,
and thats why you have special flash commands for it in u-boot... Nit
only that but not having the ECC on will make the kernel cry a river
and overload your console with the result...

Unless you /really/ want to test jffs2 itself, I'd suggest you use a
SD card image, I use that all the time and it works pretty well...

Michael

Vincent BENOIT

não lida,
07/10/2011, 05:24:2707/10/11
para mini...@googlegroups.com
M P,

OK, I'll try to use the SD card with the tutorial : http://code.google.com/p/mini2440/wiki/QEmuSDCardImage
but I don't understand the end of this tutorial to set the rootfs (in jffs2 format) on the sd card.
Tell me what's wrong :
I must create a jff2 partition on the sd card with the command :

sudo mkfs.jffs2 /dev/mapper/nbd0p2

and put the rootfs.jffs2 onto the partition ?


Can you tell me how can you use jffs2 filesystem with sd card ?

Sincerely

Sinseman44

2011/10/7 M P <buse...@gmail.com>

M P

não lida,
07/10/2011, 05:51:1307/10/11
para mini...@googlegroups.com
On Fri, Oct 7, 2011 at 10:24 AM, Vincent BENOIT <sinse...@gmail.com> wrote:
> M P,
>
> OK, I'll try to use the SD card with the tutorial :
> http://code.google.com/p/mini2440/wiki/QEmuSDCardImage
> but I don't understand the end of this tutorial to set the rootfs (in jffs2
> format) on the sd card.
> Tell me what's wrong :
> I must create a jff2 partition on the sd card with the command :
>
> sudo mkfs.jffs2 /dev/mapper/nbd0p2
>
> and put the rootfs.jffs2 onto the partition ?
>
> Can you tell me how can you use jffs2 filesystem with sd card ?
>
> Sincerely
>
> Sinseman44

You can't use jffs2 on a SD card, you need to use a disk filesystem,
like fat, ext2/3/4, btrfs etc. jffs2 is limited to be installed on
nand chip...
The alternative is ubifs (which is almost unusable, being so heavy)
and logfs (which seems to be abandoned, unfortunately ?)

Personaly I gave up on using the NAND entirely for filesystem, a SD
card is a MUCH easier to replace...

Michael

Vincent BENOIT

não lida,
07/10/2011, 08:57:3607/10/11
para mini...@googlegroups.com
M P,
I follow your advise and I use a ext3 partition on my SD card simulated.
I put all my rootfs (constructed with buildroot in output/target/) on the ext3 partition

I run qemu and set env var in u-boot with this commands :

# setenv bootcmd 'mmcinit ; fatload mmc 0:1 0x31000000 uimage ; bootm 0x31000000'
# setenv bootargs 'noinitrd rootdelay=3 root=/dev/mmcblk0p2 console=ttySAC0,115200 rootwait'
# saveenv
# boot

after the kernel has booted, The ext3 rootfs seems to be mounted but it blocks when starting network

mmcblk0: p1 p2
s3c-rtc s3c2410-rtc: setting system clock to 2011-10-07 12:38:44 UTC (1317991124)
Waiting 3sec before mounting root device...
usb 1-2: new full speed USB device number 2 using s3c2410-ohci
input: QEMU 0.10.50 QEMU USB Mouse as /devices/platform/s3c2410-ohci/usb1/1-2/1-2:1.0/input/input1
generic-usb 0003:0627:0001.0001: input,hidraw0: USB HID v0.01 Mouse [QEMU 0.10.50 QEMU USB Mouse] on usb-s3c24xx-2/input0
usb 1-3: new full speed USB device number 3 using s3c2410-ohci
input: QEMU 0.10.50 QEMU USB Keyboard as /devices/platform/s3c2410-ohci/usb1/1-3/1-3:1.0/input/input2
generic-usb 0003:0627:0001.0002: input,hidraw1: USB HID v1.11 Keyboard [QEMU 0.10.50 QEMU USB Keyboard] on usb-s3c24xx-3/input0
EXT3-fs: barriers not enabled
kjournald starting.  Commit interval 5 seconds
EXT3-fs (mmcblk0p2): using internal journal
EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
VFS: Mounted root (ext3 filesystem) on device 179:2.
Freeing init memory: 120K
Starting logging: OK
Starting network...

I must kill qemu application ...

Do you have an idea ?

antuan

não lida,
07/10/2012, 14:09:3707/10/12
para mini...@googlegroups.com
Hi all,
I'm also getting blocked at starting network stage while booting my mini2440.
I'm using buildroot-2012.05 with linux 3.3.7.
I wrote the rootfs.jffs2 and uImage to NAND using u-boot command 'write.jffs2 and write'.
Thanks.
Responder a todos
Responder ao autor
Reencaminhar
0 mensagens novas