Enhanced Read-Only File System (EROFS) lands in Yocto
Usually when one wants a compressed read-only filesystem for Linux, squashfs is a good choice. It has been around since almost two decades and offers a wide range if different compression algorithms.
Starting with version 5.4, Linux supports a new filesystem that is optimized for compression and read-only storage, EROFS. Compared to squashfs it offers novel techniques such as fixed output size compression and avoids usage of buffer heads. This yields better read throughput with comparable compression ratio. We will post another write-up soon which compares squashfs and EROFS in detail.
EROFS currently supports three compression algorithms, none, lz4 and lz4hc.
When EROFS is used as target filesystem in Yocto, one of these has to be selected, just like for squashfs.
Just extend the
IMAGE_FSTYPES variable with either
The resulting filesystem image file can be used just like a squashfs image on top of any block device.
Don’t forget to enable EROFS in your kernel config, though!
Set at least
CONFIG_EROFS_FS_ZIP in your kernel