Open Source › LamBoot filesystem crates › lamfold-erofs

lamfold-erofs

EROFS, compressed and uncompressed, with fs-verity checks on every data block.

Reads EROFS | v0.1.3 | MIT OR Apache-2.0 | Rust 1.87+ | no_std | 1 required dependency
OVERVIEW

What lamfold-erofs is for

EROFS is the forward standard for immutable images: composefs builds on it for content-addressed OS images (bootc, Silverblue) and OCI images. lamfold-erofs reads the metadata and anchors trust in the substrate's fs-verity Merkle verifier, so tampered media fails to read instead of booting.

Basis: Clean-room EROFS.

Part of lamfold: A thin frontend over the lamfold substrate (v0.1.5), which supplies its codecs, block cache, bounded parsing and integrity checks.

INSTALL

Add it to your crate

# Cargo.toml
[dependencies]
lamfold-erofs = { version = "0.1", features = ["zstd"] }

Or cargo add lamfold-erofs. On Debian unstable or testing, the packaged crate is librust-lamfold-erofs-dev (rust-lamfold-erofs).

CAPABILITIES

What it reads

FeatureStatus
Superblock, compact and extended inodes, directories, symlinksRead
FLAT_PLAIN and FLAT_INLINE dataRead
Compressed files (full and compact indexes, big pclusters)Read with lz4, lzma (custom lc/lp/pb too), deflate and zstd, each behind a feature
Block sizes from 512 bytes to 4 KiBRead
Chunk-based files with a block map, holes as zerosRead (0.1.3)
fs-verityEvery data block read is checked; tampered media fails with VerifyFailed

What it refuses

  • At open: fragments and all-fragments (Fedora's live images), compressed directories, the 48-bit layout, metabox, extra devices, unknown incompat features
  • Per file: ztailpacking, interlaced pclusters, 8-byte chunk indexes, Linux 7.2's hole pclusters

Nothing on the list is misread: The image fails to open, or the file fails to read, with a typed error.

DEPENDENCIES

What it depends on, and what it doesn't

Avoids: Everything but the lamfold substrate.

Always

Only with a feature

None.

Cargo features

FeatureDefaultWhat it adds
verityYesfs-verity checks
lz4Yeslz4
lzma, deflate, zstdNoEach further codec
stdYesstd support
TESTING

How it's tested

Images from erofs-utils 1.8.6 and 1.9.4 covering every option above, including a tree of real executables, inline xattrs on a 32-byte boundary, and small blocks.

WHY IT EXISTS

No GPL drivers in the boot path

Until 2026 LamBoot read most Linux filesystems through about a dozen prebuilt UEFI filesystem driver binaries from the EfiFs (GPL-3.0) and rEFInd (GPL-2.0) projects. Three things ruled them out at once. Debian's free-software guidelines and Fedora's packaging rules reject a prebuilt .efi blob that isn't built from source in the archive. Microsoft doesn't sign GPLv3 code for Secure Boot, and loading a separate UEFI driver binary removes the ShimLock protocol that shim 15.8 relies on. And GPL binaries sit badly beside a permissively licensed loader. These crates replace those drivers with readers compiled into LamBoot itself. The whole family · LamBoot