1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! Byte-exact EROFS/composefs image writer and fs-verity digest.
//!
//! This crate has no ostree or repository knowledge. It is the composefs
//! counterpart to `ostrya-gvariant`: it takes a tree model -- directories,
//! symlinks, and regular-file entries carrying logical metadata, extended
//! attributes, a backing loose path, and a backing fs-verity digest -- and
//! emits the EROFS image bytes plus the image's fs-verity digest.
//!
//! The output reproduces the composefs project's EROFS layout, format version
//! 0, the format the `ostree` tool writes when it exports a commit with
//! composefs support. The writer reproduces only the metadata subset composefs
//! uses: the superblock, compact and extended inodes, tail-packed directory
//! blocks, inline symlink targets, chunk-based backing files, and the
//! trusted-namespace overlay xattrs (`overlay.redirect`, `overlay.metacopy`,
//! `overlay.opaque`) with the shared-xattr area and the EROFS xattr name
//! filter. There is no EROFS compression, no fragments, and no multi-device
//! support. The image is assembled in a single in-memory buffer, so the crate
//! is synchronous and takes no runtime dependency.
//!
//! The field-level layout is documented in `docs/format-reference.md`,
//! "composefs", and pinned by the golden-image test.
pub use FsVerityHasher;
pub use ;
/// A generated composefs EROFS image and its fs-verity digest.
/// Build the composefs EROFS image for the tree rooted at `root`.
///
/// The writer injects the composefs overlay-whiteout table (256 char-device
/// stubs named `00`..`ff`) into the root directory and marks the root opaque,
/// as the composefs image writer does; those entries are format mechanics and
/// are not part of the caller's tree.