0

Task: to load kernel and rootfs image and execute into the ram without storing onto the spi flash

I loaded flashable image (zimage at 0x200000) and flashable rootfs (jffs2 at 0x200000+offset)

tftp zimage 0x200000 tftp jffs2 0x200000+offset bootm 0x200000 0x200000+offset

It is giving me this error:

Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "ram0" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00        256 mtdblock0 (driver?)
1f01        256 mtdblock1 (driver?)
1f02       2048 mtdblock2 (driver?)
1f03      13824 mtdblock3 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

And sometimes : Bad Magic Number

Any help will be appreciated

Mathieu
  • 8,840
  • 7
  • 32
  • 45
Nayeem
  • 91
  • 14
  • Write here your bootargs and bootcmd makros – Liran Ben Haim Apr 25 '16 at 14:56
  • *"I loaded ... flashable rootfs (jffs2 ... "* -- A JFFS2 image cannot be used in RAM as if it were an initrd or initramfs; it has to be accessed from a MTD device. The error message you posted, *"Root-NFS: No NFS server available..."* does not agree with your stated goal, i.e. you must have configured for something else. – sawdust Apr 26 '16 at 01:55
  • bootargs : root=/dev/ram0 rootfstype=jffs2 rw console=ttyMCS mem=64M@0x0 – Nayeem Apr 26 '16 at 09:37
  • - sawdust, NFS support was enabled during kernel build, it does searches through and then revert back to the RAM0 device, still the same issue : Bad Magic Number – Nayeem Apr 26 '16 at 09:43
  • *"root=/dev/ram0 rootfstype=jffs2"* -- **These kernel parameters are incompatible.** As I already wrote, JFFS2 has to be accessed from a MTD device. According to [this site](http://wiki.buici.com/xwiki/bin/view/Embedded+Linux/Mounting+JFFS2+Images+in+RAM), there is a MTD driver that is usable as a ramdisk. – sawdust Apr 27 '16 at 06:30

2 Answers2

1

@sawdust, you were right. jffs2 cannot be used in RAM as if it were an initrd or initramfs.

i successfully loaded both images onto the ram and executed onto the ram itself based on EXT2 filesystem.

Bootargs: setenv bootargs root=/dev/ram0 console=ttyMCS mem=64M@0x0 init=/bin/sh

Nayeem
  • 91
  • 14
0

As per your bootargs provided in comment use

root=/dev/ram0 rootfstype=jffs2 rw initrd=0x200000+offset,16M console=ttyMCS mem=64M@0x0

here XM is the size of initrd, if it is 8 MB give 8M

You haven't provided the offset of initrd in boot command, because of that kernel couldn't find the ramdisk image and gives not syncing: VFS:. Just add initrd=0x200000+offset,16M as above.

Samrat Das
  • 1,781
  • 1
  • 21
  • 33