AnsweredAssumed Answered

How do you move the rootfs to flash?

Question asked by skstrobel on Jan 25, 2013
Latest reply on Jan 27, 2013 by Aaronwu

The Blackfin uClinux projects I have worked on have always loaded the kernel and rootfs into an initramfs or similar, then run everything from RAM.  This has at least two drawbacks;  it takes about 7 seconds for U-Boot to copy the combined image from SPI flash into RAM on startup (longer than we would like) and it uses RAM to store even files that aren't being used.  So I am looking at moving the rootfs to JFFS2 on the SPI flash.  It isn't very clear to me what steps are needed to make that work.  It seems like they would include:

  • Use U-Boot to store the kernel image in flash (vmImage?  vmlinux?  some other file?).
  • Use U-Boot to store the JFFS2 rootfs to flash (rootfs.initframfs.gz?)
  • Modify the target's board file to split the MTD partition into two pieces, one for the kernel and one for the rootfs.
  • Change the kernel args supplied by U-Boot to tell the kernel where to find the rootfs.
  • Anything else?


Looking through the online docs about fast booting from SPI flash, I noticed that the rc file sets up ramfs for /var and tmpfs for /tmp.  Could someone point me to an explanation for why they use different filesystems?


Thanks for any pointers.