Skip to content

Commit

Permalink
Update usage and manpage for mkcomposefs
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Larsson <[email protected]>
  • Loading branch information
alexlarsson committed Sep 22, 2023
1 parent cf6368d commit 3b7f450
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
37 changes: 31 additions & 6 deletions man/mkcomposefs.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ mkcomposefs - create a composefs filesystem image

# DESCRIPTION

The composefs project uses EROFS to store metadata, and a distinct
underlying backing store for regular files.
The composefs project uses EROFS image file to store metadata, and one
or more separate directories containing content-addressed backing data
for regular files.

**mkcomposefs** constructs the mountable "composefs image" using the
source directory as input.
source directory as input. It can also create the backing store
directory.

# OPTIONS

Expand All @@ -23,14 +25,37 @@ will be a mountable composefs image.

**mkcomposefs** accepts the following options:


**\-\-digest-store**=*PATH*
: This path will become a composefs "object store". Non-empty regular files
in the *SOURCEDIR* will be copied (reflinked if possible) into this target
directory, named after their fsverity digest.
: This path will become a composefs "object store". Non-empty
regular files in the *SOURCEDIR* will be copied (reflinked if
possible) into this target directory, named after their fsverity
digest. If possible, the added files will have fs-verity enabled.

This directory should be passed to the basedir option when you
mount the image.

**\-\-print-digest**
: Print the fsverity digest of the composefs metadata file.

**\-\-print-digest-only**
: Print the fsverity digest of the composefs metadata file, but
don't write the image. If this is passed, the *IMAGE* argument should
be left out.

**\-\-use-epoch**
: Use a zero time (unix epoch) as the modification time for all files.

**\-\-skip-devices**
: Don't add device nodes to the image.

**\-\-skip-xattrs**
: Don't add xattrs to files in the image.

**\-\-user-xattrs**
: Only add xattrs with the "user." prefix to files in the image.


# SEE ALSO

- [composefs upstream](https://github.com/containers/composefs)
12 changes: 10 additions & 2 deletions tools/mkcomposefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,17 @@ static int fill_store(struct lcfs_node_s *node, const char *path,

static void usage(const char *argv0)
{
const char *bin = basename(argv0);
fprintf(stderr,
"usage: %s [--use-epoch] [--skip-xattrs] [--absolute] [--by-digest] [--digest-store=path] [--print-digest] [--print-digest-only] [--skip-devices] [--compute-digest] SOURCEDIR IMAGE\n",
argv0);
"Usage: %s [OPTIONS] SOURCEDIR IMAGE\n"
"Options:\n"
" --digest-store=PATH Store content files in this directory\n"
" --use-epoch Make all mtimes zero\n"
" --skip-xattrs Don't store file xattrs\n"
" --user-xattrs Only store user.* xattrs\n"
" --print-digest Print the digest of the image\n"
" --print-digest-only Print the digest of the image, don't write image\n",
bin);
}

#define OPT_SKIP_XATTRS 102
Expand Down

0 comments on commit 3b7f450

Please sign in to comment.