Skip to content

Add support for Android EROFS (Enhanced Read-Only File System) #1156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
qkaiser opened this issue Mar 28, 2025 · 0 comments · Fixed by #1163
Closed

Add support for Android EROFS (Enhanced Read-Only File System) #1156

qkaiser opened this issue Mar 28, 2025 · 0 comments · Fixed by #1163
Labels
format:filesystem format request Format support request by 3rd party.

Comments

@qkaiser
Copy link
Contributor

qkaiser commented Mar 28, 2025

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.erofs and mount.erofs for validation and comparison.

References

@qkaiser qkaiser added format request Format support request by 3rd party. format:filesystem labels Mar 28, 2025
@qkaiser qkaiser added this to the Internship 2025 milestone Mar 28, 2025
@qkaiser qkaiser linked a pull request Apr 4, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format:filesystem format request Format support request by 3rd party.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant