static char *arg_image = NULL;
static bool arg_reboot = false;
static int arg_cleanup = -1;
+static SelectMode arg_feature_select = SELECT_EXPLICIT;
static char *arg_component = NULL;
static SelectMode arg_component_select = SELECT_EXPLICIT;
static int arg_verify = -1;
context.offline = arg_offline;
context.cleanup = arg_cleanup;
context.component_select = arg_component_select;
+ context.feature_select = arg_feature_select;
if (strdup_to(&context.definitions, arg_definitions) < 0)
return log_oom();
context.verify = base->verify;
context.offline = base->offline;
context.cleanup = base->cleanup;
+ context.feature_select = base->feature_select;
if (strdup_to(&context.root, base->root) < 0)
return log_oom();
if (r < 0)
return r;
+ if (context.feature_select != SELECT_EXPLICIT)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "--feature-all/--feature-suggested is not supported for '%s'.", argv[0]);
if (context.component_select != SELECT_EXPLICIT)
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "--component-all/--component-suggested currently not supported for '%s'.", argv[0]);
if (r < 0)
return r;
+ if (context.feature_select != SELECT_EXPLICIT)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "--feature-all/--feature-suggested is not supported for '%s'.", argv[0]);
if (context.component_select != SELECT_EXPLICIT)
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "--component-all/--component-suggested currently not supported for '%s'.", argv[0]);
if (r < 0)
return r;
+ if (context.feature_select != SELECT_EXPLICIT)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "--feature-all/--feature-suggested is not supported for '%s'.", argv[0]);
if (context.component_select != SELECT_EXPLICIT)
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "--component-all currently not supported for '%s'.", argv[0]);
if (r < 0)
return r;
+ if (context.feature_select != SELECT_EXPLICIT)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "--feature-all/--feature-suggested is not supported for '%s'.", argv[0]);
if (context.component_select != SELECT_EXPLICIT)
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "--component-all/--component-suggested currently not supported for '%s'.", argv[0]);
if (r < 0)
return r;
+ if (context.feature_select != SELECT_EXPLICIT)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "--feature-all/--feature-suggested is not supported for '%s'.", argv[0]);
if (context.component_select != SELECT_EXPLICIT)
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "--component-all/--component-suggested currently not supported for '%s'.", argv[0]);
if (r < 0)
return r;
+ if (context.feature_select != SELECT_EXPLICIT)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "--feature-all/--feature-suggested is not supported for '%s'.", argv[0]);
if (context.component_select != SELECT_EXPLICIT)
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "--component-all/--component-suggested currently not supported for '%s'.", argv[0]);
if (context.cleanup == 0)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Invocation of 'cleanup' with --cleanup=no is contradictory, refusing.");
+ if (context.feature_select != SELECT_EXPLICIT)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "--feature-all/--feature-suggested is not supported for '%s'.", argv[0]);
if (!IN_SET(context.component_select, SELECT_EXPLICIT, SELECT_ALL))
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "--component-suggested currently not supported for '%s'.", argv[0]);
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"The --root=/--image= switches may not be combined with the '%s' operation.", argv[0]);
+ if (context.feature_select != SELECT_EXPLICIT)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "--feature-all/--feature-suggested is not supported for '%s'.", argv[0]);
if (context.component || context.component_select != SELECT_EXPLICIT)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"The --component=, --component-all and --component-suggested switches may not be combined with the '%s' operation, which only applies to the booted OS version.", argv[0]);
if (r < 0)
return r;
+ if (context.feature_select != SELECT_EXPLICIT)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "--feature-all/--feature-suggested is not supported for '%s'.", argv[0]);
if (context.component_select != SELECT_EXPLICIT)
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "--component-all/--component-suggested currently not supported for '%s'.", argv[0]);
if (context.definitions)
if (r < 0)
return r;
+ if (context.feature_select != SELECT_EXPLICIT)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "--feature-all/--feature-suggested is not supported for '%s'.", argv[0]);
if (context.definitions)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"The --definitions= switch may not be combined with '%s'.", argv[0]);
arg_component_select = SELECT_SUGGESTED;
break;
+ OPTION('a', "feature-all", NULL, "Select all features"):
+ arg_feature_select = SELECT_ALL;
+ break;
+
+ OPTION('s', "feature-suggested", NULL, "Select all suggested features"):
+ arg_feature_select = SELECT_SUGGESTED;
+ break;
+
OPTION_LONG("definitions", "DIR",
"Find transfer definitions in specified directory"):
r = parse_path_argument(opts.arg, /* suppress_root= */ false, &arg_definitions);