From 3b7f450dced1c5f09844feb50acd953bcbd5f11b Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 22 Sep 2023 12:00:08 +0200 Subject: [PATCH] Update usage and manpage for mkcomposefs Signed-off-by: Alexander Larsson --- man/mkcomposefs.md | 37 +++++++++++++++++++++++++++++++------ tools/mkcomposefs.c | 12 ++++++++++-- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/man/mkcomposefs.md b/man/mkcomposefs.md index aa22228c..51fd6c7a 100644 --- a/man/mkcomposefs.md +++ b/man/mkcomposefs.md @@ -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 @@ -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) diff --git a/tools/mkcomposefs.c b/tools/mkcomposefs.c index ec3fdc95..d39f9fd5 100644 --- a/tools/mkcomposefs.c +++ b/tools/mkcomposefs.c @@ -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