static bool arg_all = false;
static uid_t arg_uid_base = UID_INVALID;
static bool arg_quiet = false;
+static ImageFilter *arg_image_filter = NULL;
STATIC_DESTRUCTOR_REGISTER(arg_image, freep);
STATIC_DESTRUCTOR_REGISTER(arg_root, freep);
STATIC_DESTRUCTOR_REGISTER(arg_argv, strv_freep);
STATIC_DESTRUCTOR_REGISTER(arg_loop_ref, freep);
STATIC_DESTRUCTOR_REGISTER(arg_image_policy, image_policy_freep);
+STATIC_DESTRUCTOR_REGISTER(arg_image_filter, image_filter_freep);
static int help(void) {
_cleanup_free_ char *link = NULL;
" not embedded in IMAGE\n"
" --image-policy=POLICY\n"
" Specify image dissection policy\n"
+ " --image-filter=FILTER\n"
+ " Specify image dissection filter\n"
" --json=pretty|short|off\n"
" Generate JSON output\n"
" --loop-ref=NAME Set reference string for loopback device\n"
ARG_SYSTEM,
ARG_USER,
ARG_ALL,
+ ARG_IMAGE_FILTER,
};
static const struct option options[] = {
{ "user", no_argument, NULL, ARG_USER },
{ "all", no_argument, NULL, ARG_ALL },
{ "quiet", no_argument, NULL, 'q' },
+ { "image-filter", required_argument, NULL, ARG_IMAGE_FILTER },
{}
};
arg_quiet = true;
break;
+ case ARG_IMAGE_FILTER: {
+ _cleanup_(image_filter_freep) ImageFilter *f = NULL;
+ r = image_filter_parse(optarg, &f);
+ if (r < 0)
+ return log_error_errno(r, "Failed to parse image filter expression: %s", optarg);
+
+ image_filter_free(arg_image_filter);
+ arg_image_filter = TAKE_PTR(f);
+ break;
+ }
+
case '?':
return -EINVAL;
&arg_verity_settings,
/* mount_options= */ NULL,
arg_image_policy,
- /* image_filter= */ NULL,
+ arg_image_filter,
arg_flags,
/* ret= */ NULL);
if (r < 0)
&arg_verity_settings,
/* mount_options= */ NULL,
arg_image_policy,
- /* image_filter= */ NULL,
+ arg_image_filter,
arg_flags,
&m);
if (r < 0)