Skip to content

Commit

Permalink
mount.composefs: Add tryverity option
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Larsson <[email protected]>
  • Loading branch information
alexlarsson committed Jan 29, 2024
1 parent 15bdcd6 commit 4e5883b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/mountcomposefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ static void usage(const char *argv0)
" basedir=PATH[:PATH] Specify location of basedir(s)\n"
" digest=DIGEST Specify required image digest\n"
" verity Require all files to have specified and valid fs-verity digests\n"
" tryverity If supported by kernel, require fs-verity\n"
" ro Read only\n"
" rw Read/write\n"
" upperdir Overlayfs upperdir\n"
Expand Down Expand Up @@ -118,6 +119,7 @@ int main(int argc, char **argv)
const char *opt_upperdir = NULL;
const char *opt_workdir = NULL;
bool opt_verity = false;
bool opt_tryverity = false;
bool opt_ro = false;
int opt, fd, res, userns_fd;

Expand Down Expand Up @@ -173,6 +175,8 @@ int main(int argc, char **argv)
opt_digest = value;
} else if (strcmp("verity", key) == 0) {
opt_verity = true;
} else if (strcmp("tryverity", key) == 0) {
opt_tryverity = true;
} else if (strcmp("upperdir", key) == 0) {
if (value == NULL)
errx(EXIT_FAILURE,
Expand Down Expand Up @@ -236,6 +240,8 @@ int main(int argc, char **argv)

if (opt_verity || opt_digest != NULL)
options.flags |= LCFS_MOUNT_FLAGS_REQUIRE_VERITY;
else if (opt_tryverity)
options.flags |= LCFS_MOUNT_FLAGS_TRY_VERITY;
if (opt_ro)
options.flags |= LCFS_MOUNT_FLAGS_READONLY;

Expand Down

0 comments on commit 4e5883b

Please sign in to comment.