diff --git a/tools/mkcomposefs.c b/tools/mkcomposefs.c index 7fb7487a..1712e91a 100644 --- a/tools/mkcomposefs.c +++ b/tools/mkcomposefs.c @@ -323,7 +323,8 @@ static int fill_payload(struct lcfs_node_s *node, const char *path, size_t len, ret = lcfs_node_set_payload(node, target); if (ret < 0) return ret; - } else if ((lcfs_node_get_mode(node) & S_IFMT) == S_IFREG) { + } else if ((lcfs_node_get_mode(node) & S_IFMT) == S_IFREG && + lcfs_node_get_content(node) == NULL) { const uint8_t *digest = NULL; if (by_digest) @@ -354,7 +355,7 @@ static int fill_payload(struct lcfs_node_s *node, const char *path, size_t len, static void usage(const char *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", + "usage: %s [--use-epoch] [--skip-xattrs] [--absolute] [--no-inline] [--by-digest] [--digest-store=path] [--print-digest] [--print-digest-only] [--skip-devices] [--compute-digest] SOURCEDIR IMAGE\n", argv0); } @@ -368,6 +369,7 @@ static void usage(const char *argv0) #define OPT_PRINT_DIGEST 109 #define OPT_FORMAT 110 #define OPT_PRINT_DIGEST_ONLY 111 +#define OPT_NO_INLINE 112 static ssize_t write_cb(void *_file, void *buf, size_t count) { @@ -409,6 +411,12 @@ int main(int argc, char **argv) flag: NULL, val: OPT_COMPUTE_DIGEST }, + { + name: "no-inline", + has_arg: no_argument, + flag: NULL, + val: OPT_NO_INLINE + }, { name: "by-digest", has_arg: no_argument, @@ -460,6 +468,7 @@ int main(int argc, char **argv) FILE *out_file; char *failed_path; + buildflags = LCFS_BUILD_INLINE_SMALL; while ((opt = getopt_long(argc, argv, ":CR", longopts, NULL)) != -1) { switch (opt) { case OPT_USE_EPOCH: @@ -474,6 +483,9 @@ int main(int argc, char **argv) case OPT_COMPUTE_DIGEST: buildflags |= LCFS_BUILD_COMPUTE_DIGEST; break; + case OPT_NO_INLINE: + buildflags &= ~LCFS_BUILD_INLINE_SMALL; + break; case OPT_ABSOLUTE: absolute_path = true; break;