Skip to main content

Module mkcomposefs

Module mkcomposefs 

Source
Expand description

mkcomposefs - Create composefs images from directories or dumpfiles.

This is a Rust reimplementation of the C mkcomposefs tool, providing compatible command-line interface and output format.

ยงCompatibility status

See https://github.com/composefs/composefs/discussions/423 for context.

Implemented and tested (byte-for-byte match with C mkcomposefs):

  • --from-file, --print-digest, --print-digest-only
  • --skip-devices, --skip-xattrs, --user-xattrs
  • --min-version / --max-version (V1 compact inodes, BFS ordering, whiteout table)
  • --digest-store (C-compatible flat XX/digest layout via [FlatDigestStore])
  • --threads (controls tokio worker threads and verity-computation concurrency)
  • Source from directory or dumpfile, output to file or stdout

Bit-for-bit compatible with the C mkcomposefs by default; use --hardlinks to enable host hard-link deduplication (shared EROFS inodes, i_nlink > 1).

Structsยง

Args ๐Ÿ”’
Create a composefs image from a source directory or dumpfile.

Functionsยง

apply_transformations ๐Ÿ”’
Apply filesystem transformations based on command-line flags.
compute_fsverity_digest ๐Ÿ”’
Compute the fsverity digest of the image.
read_directory ๐Ÿ”’
Read a filesystem tree from a directory path.
read_dumpfile ๐Ÿ”’
Read and parse a dumpfile from the given source.
remove_device_nodes ๐Ÿ”’
Remove all device nodes (block and character devices) from the filesystem.
run
Entry point for the mkcomposefs multi-call mode.
run_from_args
Entry point when invoked as a hidden cfsctl mkcomposefs subcommand.
run_with_args ๐Ÿ”’
set_all_mtimes_to_epoch ๐Ÿ”’
Set all modification times in the filesystem to Unix epoch (0).
write_image ๐Ÿ”’
Write the image to the specified path (or stdout if -).