Expand description
§composefs: The reliability of disk images, the flexibility of files
composefs combines several Linux kernel features to provide read-only mountable filesystem trees that stack on top of a conventional “lower” filesystem.
§Interfaces
composefs offers two programmatic interfaces:
- Rust API — this crate and its siblings (
composefs-oci,composefs-boot, etc.), usable as regular Cargo dependencies. - Varlink API — a varlink RPC interface
exposed by
cfsctl varlinkover a Unix socket, accessible from any language. See thevarlinkmodule for examples.
Neither interface is declared stable yet. Both may change across releases while the project is under active development.
§Key technologies
- overlayfs — the kernel mount interface that exposes the composed tree
- EROFS — an in-kernel read-only filesystem for the metadata tree (directories, symlinks, permissions, xattrs) with no file data
- fs-verity (optional) — per-file integrity verification on the backing store, validated by overlayfs at access time
§Design
composefs produces an EROFS image containing only metadata. Non-empty
data files live in a content-addressed backing store, with
trusted.overlay.redirect xattrs telling overlayfs where to find them.
Identical files across images are stored once on disk and shared in the
Linux page cache.
See the repository_format module for the on-disk layout.
Re-exports§
pub use repository::ImageNotFound;
Modules§
- digest
- Cryptographic hash digest wrappers backed by OpenSSL.
- dumpfile
- Reading and writing composefs dumpfile format.
- dumpfile_
parse - Parsing and generating composefs dump file entry
- erofs
- EROFS (Enhanced Read-Only File System) format support for composefs.
- erofs_
format - composefs EROFS image format
- filesystem_
ops - High-level filesystem operations for composefs trees.
- fs
- Reading and writing filesystem trees to/from disk.
- fsverity
- Linux fs-verity support for integrity verification.
- generic_
tree - A generic metadata-only filesystem tree where regular files can be stored however the caller wants.
- mount
- Modern Linux mount API support for composefs.
- mountcompat
- Compatibility helpers for older Linux kernel mount APIs.
- progress
- Progress reporting API for pull and download operations.
- repository
- Content-addressable repository for composefs objects.
- repository_
format - composefs repository design
- splitstream
- Split Stream file format implementation.
- splitstream_
format - Splitstream
- tree
- A filesystem tree which stores regular files using the composefs strategy of inlining small files, and having an external fsverity reference for larger ones.
- util
- Utility functions and types used throughout the composefs crate.
- varlink
- Varlink API
Constants§
- INLINE_
CONTENT_ MAX_ V0 - Files with this many bytes or fewer are stored inline in the erofs image (and in splitstreams). Files above this threshold are written to object storage and referenced via overlay metacopy xattrs.
- MAX_
INLINE_ CONTENT - Maximum inline content size accepted when parsing untrusted input (dumpfiles, EROFS images in composefs-restricted mode).
- SYMLINK_
MAX - Maximum symlink target length in bytes.