Hi,

I build 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 my system RAM, I want to compress the rootfs. I
donīt use any flash memory! I decided to use jffs2 as filesystem type
for the rootfs, because its writable.
I didnīt find any hints on using jffs2 and mtd in system RAM.

My kernel supports jffs2 filesystems and memory tech. devices (see
appended kernel config). I use vanilla kernel version 2.6.16.5.

I created the rootfs with mkfs.jffs2:
mkfs.jffs2 -l -o ../jffs_root.img

Then I tested it in qemu using the following parameters:

qemu jffs_root.img -kernel bzImage -initrd jffs_root.img -append
"root=/dev/mtdblock0 rw blkmtd_device=/dev/ram0 rootfstype=jffs2
init=/sbin/init"

I appended 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 when i start qemu:

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.
Failed to execute /sbin/init. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option to
kernel.



Which parameters do I have to pass to the kernel?
Is it possible to use JFFS2 with initrd in system RAM at all?

Any help is appreciated!
Thanks in advance.

Sebastian


mtd part of the kernel config:
----------------------------------------------------------------------------

# Memory Technology Devices (MTD)
#
CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set
# CONFIG_MTD_CONCAT is not set
CONFIG_MTD_PARTITIONS=y
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_CMDLINE_PARTS is not set

# User Modules And Translation Layers

CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set
# CONFIG_RFD_FTL is not set

# RAM/ROM/Flash chip drivers
#
# CONFIG_MTD_CFI is not set
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
CONFIG_MTD_RAM=y
CONFIG_MTD_ROM=y
CONFIG_MTD_ABSENT=y
CONFIG_MTD_OBSOLETE_CHIPS=y
# CONFIG_MTD_SHARP is not set

# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_TS5500 is not set
CONFIG_MTD_PLATRAM=y

# Self-contained MTD device drivers
#
# CONFIG_MTD_PMC551 is not set
CONFIG_MTD_SLRAM=y
CONFIG_MTD_PHRAM=y
CONFIG_MTD_MTDRAM=y
CONFIG_MTDRAM_TOTAL_SIZE=4096
CONFIG_MTDRAM_ERASE_SIZE=128
CONFIG_MTDRAM_ABS_POS=0
CONFIG_MTD_BLKMTD=y
CONFIG_MTD_BLOCK2MTD=y

# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set

# NAND Flash Device Drivers
#
# CONFIG_MTD_NAND is not set

# OneNAND Flash Device Drivers
#
# CONFIG_MTD_ONENAND is not set