IMX6 - booting to a roofts on ramdisk (Boundary Sabre-lite)?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX6 - booting to a roofts on ramdisk (Boundary Sabre-lite)?

Jump to solution
22,276 Views
TomMorrison
Contributor III

I am wondering if anyone has booted into a rootfs on a ramdisk.

What u-boot options did you use? How big was your rootfs?

Further, in our own design, we are considering booting from NAND Flash

for booting and perhaps running rootfs from (or extracting the rootfs

image and putting that into a ramdisk)?

Anybody have any comments help on this front too?

Tom

Labels (1)
0 Kudos
1 Solution
6,459 Views
EricNelson
Senior Contributor II

Hi Tom,

This issue is due to the kernel config. I assume you're using the Freescale-supplied kernel, which doesn't have RAM disk support built-in:

     https://github.com/boundarydevices/linux-imx6/blob/boundary-L3.0.35_12.09.01_GA/arch/arm/configs/imx...

These couple of kernel config variables are needed:

  • CONFIG_BLK_DEV_INITRD=y
  • CONFIG_RD_GZIP=y

See this link for an example:

     linux-imx6/arch/arm/configs/imx6_defconfig at boundary-L3.0.35_12.09.01_GA · boundarydevices/linux-i...

You can also use 'menuconfig' to select it. Choose 'General Setup' on the first page:

select-initrd.png

View solution in original post

0 Kudos
6 Replies
6,453 Views
EricNelson
Senior Contributor II

Hi Tom,


We've done this lots of times with everything from a minimal Buildroot/uclibc image to the latest one, a 100M+ Android NFS image). The latter took a while to boot, but it ran really fast!. It also had the benefit of allowing operation on a single-partition FAT32 SD card, so our Windows users are able to create the image with no special tools (even the sales people can do it).


We put up some notes on hacking (creating, extracting) RAM disks in this blog post:

    http://boundarydevices.com/hacking-ram-disks/

We're in the process of putting together one of these for SABRE Lite/Nitrogen6X that contains our production test image. This will have the benefit of allowing immediate power-off (and speed the production test).

Regards,


Eric

0 Kudos
6,453 Views
TomMorrison
Contributor III

Hi Eric/all,

I have seen the 'hacking-ram-disks', but I do not have a ramdisk to hack. I need

to create one. Can I just use the NFS root tarball - and go through your re-packing

procedure (the 'find | cpio | gzip > ramdisk.cpi.gz' & mkimage)

I did this, but it crashes ~I am still having troubles. I am thinking I had something wrong

with the bootargs and/or bootcmd.

Here is the crash:

>> IP-Config: Complete:

>>   device=eth0, addr=10.160.8.180, mask=255.255.255.0, gw=10.160.8.1,

>>   host=10.160.8.180, domain=endo.san, nis-domain=(none),

>>   bootserver=0.0.0.0, rootserver=0.0.0.0, rootpath=

>>VFS: Unable to mount root fs via NFS, trying floppy.

>>VFS: Cannot open root device "ram0" or unknown-block(2,0)

yes, I have a /dev/ram0 in this image!

FYI - I am using the following bootargs

   console=ttymxc1,115200 ip=dhcp root=/dev/ram0 rw

My ramdisk is ~24Meg - and I am downloading this ramdisk to 0x1100_0000, so my bootm:

   bootm 0x10800000 0x11000000

Can somebody help me?

Tom

Message was edited by: Thomas Morrison (adding the u-boot command)

0 Kudos
6,452 Views
EricNelson
Senior Contributor II

Hi Tom,

You don't need the root=/dev/ram0 if you use the two-argument form of bootm.

The kernel will pick this up directly and this should boot.

Regards,


Eric

0 Kudos
6,452 Views
TomMorrison
Contributor III

Hi Eric,

Sorry - but I tried it without - but it is still crashing - same type of thing

a) Built  a minimalistic (initramfs) image in the Freescale 12-09 LTIB

    (initramfs.cpio.gz ~38MB, 139MB uncompressed).

b) mkimage (initramfs.cpio.gz)

c) use minimum bootargs:

   >> Kernel command line: console=ttymxc1,115200 video=mxcfb0:dev=hdmi,1920x1080M@60 ip=dhcp

d) used bootm 0x10800000 0x11000000


and I got this (looks like something VFS is looking for something to mount):

>> Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

What could I be doing wrong (it looks like from everything I can tell that this should work)?

Tom

0 Kudos
6,460 Views
EricNelson
Senior Contributor II

Hi Tom,

This issue is due to the kernel config. I assume you're using the Freescale-supplied kernel, which doesn't have RAM disk support built-in:

     https://github.com/boundarydevices/linux-imx6/blob/boundary-L3.0.35_12.09.01_GA/arch/arm/configs/imx...

These couple of kernel config variables are needed:

  • CONFIG_BLK_DEV_INITRD=y
  • CONFIG_RD_GZIP=y

See this link for an example:

     linux-imx6/arch/arm/configs/imx6_defconfig at boundary-L3.0.35_12.09.01_GA · boundarydevices/linux-i...

You can also use 'menuconfig' to select it. Choose 'General Setup' on the first page:

select-initrd.png

0 Kudos
6,452 Views
TomMorrison
Contributor III

OK that worked....now to hack the cpio.gz...:-). Its too bad the mfw_v4lsrc is BROKEN (HELP Freescale)...

0 Kudos