diff --git a/man/mkcomposefs.md b/man/mkcomposefs.md index b903e28..bb3d145 100644 --- a/man/mkcomposefs.md +++ b/man/mkcomposefs.md @@ -70,6 +70,9 @@ will be a mountable composefs image. actual image format version used will be adjusted upwards if that is beneficial for the image, up to the max version. +**\-\-threads** +: Number of threads to be used to calculate the file digests and copy. + # FORMAT VERSIONING Composefs images are binary reproduceable, meaning that for a given diff --git a/tools/mkcomposefs.c b/tools/mkcomposefs.c index 21b051b..e322956 100644 --- a/tools/mkcomposefs.c +++ b/tools/mkcomposefs.c @@ -1201,7 +1201,7 @@ static void usage(const char *argv0) " --from-file The source is a dump file, not a directory\n" " --min-version=N Use this minimal format version (default=%d)\n" " --max-version=N Use this maxium format version (default=%d)\n" - " --threads=N Use this to calculate digest and copy files in threads (default=%d)\n", + " --threads=N Use this to calculate digest and copy files in threads (default=%d)\n", bin, LCFS_DEFAULT_VERSION_MIN, LCFS_DEFAULT_VERSION_MAX, 1); } @@ -1352,6 +1352,10 @@ int main(int argc, char **argv) fprintf(stderr, "Invalid threads count %s\n", optarg); exit(EXIT_FAILURE); } + if (threads <= 0) { + fprintf(stderr, "Invalid threads count %d\n", threads); + exit(EXIT_FAILURE); + } break; case ':': fprintf(stderr, "option needs a value\n");