Skip to main content

lamfold_cramfs/
lib.rs

1//! # lamfold-cramfs — the cramfs frontend of the lamfold read-only media stack.
2//!
3//! Clean-room reader for cramfs (the Compressed ROM filesystem): the small,
4//! per-page-zlib read-only format long used for embedded firmware and rescue
5//! images. Like squashfs it compresses, but with a far terser structure — a
6//! 12-byte bitfield inode and a flat per-page block index — which is exactly why
7//! it stays useful where squashfs is too heavy.
8//!
9//! Reads over a lamfold [`lamfold::BlockSource`] and implements
10//! [`lamfold::FoldFrontend`]; every compressed page is inflated through the
11//! shared substrate codec (`Codec::Zlib`), so this frontend carries only the
12//! on-disk structure.
13//!
14//! Scope: little-endian classic cramfs — superblock, the 12-byte bitfield inode,
15//! directory records, the per-page zlib block index (with hole/zero-fill), and
16//! symlinks. Big-endian images and the `EXT_BLOCK_POINTERS` extension are
17//! rejected cleanly (`Unsupported`) rather than mis-read.
18//!
19//! Derived only from the public format (kernel
20//! `Documentation/filesystems/cramfs.rst` + `cramfs_fs.h`); the GPL-2
21//! `fs/cramfs` driver is fenced off. The upstream `cramfs` crate is unbuildable,
22//! so there was nothing permissive to reuse.
23
24#![cfg_attr(not(any(test, feature = "std")), no_std)]
25#![forbid(unsafe_code)]
26
27extern crate alloc;
28
29mod cramfs;
30
31pub use cramfs::Cramfs;