Use jffs2-formatted initrd from RAM (not Flash)
Sebastian Haag
Sebastian at 7labs.de
Sun Jun 18 06:55:42 EDT 2006
Hi,
I have a minimal linux system which consists of a bzImage (kernel 2.6.16.5) and
a rootfs (initrd). The rootfs is formatted with ext2. The kernel and initrd is
stored on a bootp server and is loaded at system startup into the system RAM.
Kernel gets extracted, mounts the rootfs and executes init.
Everything works fine.
To save memory in RAM, I want to compress the rootfs. I decided to use jffs2 as
filesystem, because its writable.
My kernel supports jffs2 filesystems and mtd devices (I hope so).
What I did:
- mkfs.jffs2 -l -o ../jffs_root.img
- test in qemu:
-----------------------------------
INITRD=jffs_root.img
qemu $INITRD -kernel bzImage -initrd $INITRD -net nic,vlan=0 -net
tap,vlan=0,ifname=tap0 -append "root=/dev/mtdblock0 rw blkmtd_device=/dev/ram0
rootfstype=jffs2"
-----------------------------------
I added the whole "-append thing", but I´m not absolutely sure what I did ;-)
But I´m sure, it doesn´t work...
I get the following messages:
RAMDISK driver initialized: 1 RAM disks of 4096K size 1024 blocksize
blkmtd: version $Revision: 1.27 $
blkmtd: mtd1: [/dev/ram0] erase_size = 128KiB
block2mtd: version $Revision: 1.30 $
...
RAMDISK: Couldn´t find valid RAM disk image starting at 0.
VFS: Mounted root (jffs2 filesystem).
Freeing unused kernel memory: 104k freed
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found. Try passing init= option to kernel.
Do you have an idea which kernel parameters are needed to mount this
jffs2-rootfs properly?
Thanks,
Sebastian
More information about the linux-mtd
mailing list