Open Source › LamBoot filesystem crates › lamfold-cramfs
lamfold-cramfs
cramfs, the per-page-zlib format for embedded firmware and rescue images.
forbid(unsafe_code)
|
1 required dependency
What lamfold-cramfs is for
cramfs is compressed like SquashFS but with a far terser structure, for where SquashFS is too heavy. lamfold-cramfs inflates every page through the substrate's shared zlib codec.
Basis: Derived only from the kernel's cramfs format documentation; the GPL-2 fs/cramfs driver is fenced off. The existing cramfs crate doesn't build, so there was nothing permissive to reuse.
Part of lamfold: A thin frontend over the lamfold substrate (v0.1.5), which supplies its codecs, block cache, bounded parsing and integrity checks.
Add it to your crate
[dependencies]
lamfold-cramfs = "0.1"
Or cargo add lamfold-cramfs. On Debian unstable or testing, the packaged crate is librust-lamfold-cramfs-dev (rust-lamfold-cramfs).
What it reads
| Feature | Status |
|---|---|
| Superblock and root inode | Read |
| 12-byte bitfield inodes and directory records | Read |
| Per-page zlib block index, holes as zeros | Read |
| Symlinks | Read |
What it refuses
- Big-endian images
- The EXT_BLOCK_POINTERS extension
What it depends on, and what it doesn't
Avoids: The GPL-2 kernel driver. Its only dependency is the lamfold substrate.
Always
- lamfold 0.1: The substrate
Only with a feature
None.
Cargo features
| Feature | Default | What it adds |
|---|---|---|
| std | Yes | std support |
How it's tested
A real mkcramfs image cross-checked with cramfsck: a 300 KB file across 74 pages, a nested directory and a symlink.
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
The lamfold stack
Disk filesystems: lamxfs · lambutter · lamlvm · lamzfs · lamexfat · lamfat