-
Notifications
You must be signed in to change notification settings - Fork 90
Labels
format requestFormat support request by 3rd party.Format support request by 3rd party.format:filesystem
Milestone
Description
Summary
Android has adopted EROFS (Enhanced Read-Only File System) as the default read-only filesystem format for system partitions starting from Android 10. To improve unblob’s ability to extract and analyze Android firmware images, we should add support for EROFS.
Format Summary
EROFS is a high-performance read-only filesystem originally developed by Huawei and now used extensively in AOSP. It offers features like compression (LZ4, LZMA), inline data, and reduced storage overhead, making it ideal for read-only system images.
Key characteristics:
- Read-only, block-based filesystem
- Supports transparent compression (LZ4, LZMA)
- Used in Android system, vendor, and product partitions
- Magic:
0xE0F5E1E2
Implementation Hints
- Detection: EROFS images can be identified by the magic number EROFS_SUPER_MAGIC_V1 = 0xE0F5E1E2 at offset 0x400. The superblock starts at that offset.
- Parsing: The superblock structure is defined in include/uapi/linux/erofs_fs.h.
- Decompression: LZ4 and LZMA are supported. Likely need to use external tools or Python libraries (lz4.frame, pylzma) for decompression.
Tools for reference testing:
- erofs-utils: Use
dump.erofsand mount.erofs for validation and comparison.
References
- Official Linux kernel documentation: https://www.kernel.org/doc/html/latest/filesystems/erofs.html
- mkfs.erofs source (userland tooling): https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git
- Magic number and structures: https://github.com/torvalds/linux/blob/master/fs/erofs/internal.h, https://elixir.bootlin.com/linux/latest/source/fs/erofs/super.c
Metadata
Metadata
Assignees
Labels
format requestFormat support request by 3rd party.Format support request by 3rd party.format:filesystem