[Buildroot] Boot from CRAMFS partition on an emmc

Arnout Vandecappelle arnout at mind.be
Fri Apr 30 19:18:26 UTC 2021


 Hi Marko,

On 29/04/2021 17:50, Marko Stanisic wrote:
> Hello everyone,
> 
> Have someone worked extensively with cramfs rootfs?

 Unlikely. AFAIK, cramfs is pretty much deprecated and replaced with squashfs.
Perhaps for extremely small filesystems (like, less than 100KB) cramfs would
perform better than squashfs, but even then I kind of doubt it. squashfs also
has much better compression options like zstd which is both faster and smaller
than gzip.


> I created an emmc.img file in buildroot 2020.11.1.
> 
> (several partitions with two same rootfs.cramfs partitions, but loading from one
> of them at a time)
> 
> 
> I have created two rootfs partitions in that image file , which are both defined as
> 
> a CRAM Filesystem. (have zImage and device tree inside a rootfs.cramfs in the
> folder /boot)
> 
> 
> My f*irst problem* is that i have no clue how to handle these two partition from
> U-boot (2016)
> 
> I have following commands:
> 
>    - cramfsls (should show directory from an image??) and
> 
>    - cramfsload   (have to set environment variable cramfsaddr, from where the
> cramfs is loaded plus offset )

 U-Boot *used* to only support loading cramfs from MTD devices, so not from
eMMC. Perhaps there's a way to copy the partition into memory first and read it
from there, but don't hold your breath.

> *Second problem* is that with *mmc part*  the rootfs.cramfs partitions are not
> visible, but both defined as bootable.

 That's... weird. Is U-Boot built with support for whatever partition table
format is used in the image?

 Note that "bootable" is a DOSism that lost its meaning decades ago.


 Regards,
 Arnout


> But i know startadress and number of sectors from every partition
> 
> (got from fdisk -l on my host pc inspecting the emmc.img)
> 
> 
> Maybe i have some missunderstanding how to handle that, but have someone an idea
> here?
> 
> Thanks for every help i get!!
> 
> 
> PS: I dont want ramdisks as these are regularly used with cramfs
> 
> 
> 
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 



More information about the buildroot mailing list