shared/options: introduce OPTION_COMMON_{ENTRY_TOKEN,MAKE_ENTRY_DIRECTORY}

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-05-14 13:00:11 +02:00
parent 42e7fd40e0
commit 92fbc11f6a
2 changed files with 11 additions and 4 deletions
+2 -4
View File
@@ -554,15 +554,13 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) {
arg_quiet = true;
break;
OPTION_LONG("entry-token", "TOKEN",
"Entry token to use for this installation"
" (machine-id, os-id, os-image-id, auto, literal:…)"):
OPTION_COMMON_ENTRY_TOKEN:
r = parse_boot_entry_token_type(opts.arg, &arg_entry_token_type, &arg_entry_token);
if (r < 0)
return r;
break;
OPTION_LONG("make-entry-directory", "yes|no|auto", "Create $BOOT/ENTRY-TOKEN/ directory"): {}
OPTION_COMMON_MAKE_ENTRY_DIRECTORY: {}
OPTION_LONG("make-machine-id-directory", "BOOL", /* help= */ NULL): /* Compatibility alias */
if (streq(opts.arg, "auto")) /* retained for backwards compatibility */
arg_make_entry_directory = -1; /* yes if machine-id is permanent */
+9
View File
@@ -137,6 +137,15 @@ typedef struct Option {
OPTION_SHORT('j', NULL, \
"Equivalent to --json=pretty (on TTY) or --json=short (otherwise)")
#define OPTION_COMMON_ENTRY_TOKEN \
OPTION_LONG("entry-token", "TOKEN", \
"Entry token to use for this installation " \
"(machine-id, os-id, os-image-id, auto, literal:…)")
#define OPTION_COMMON_MAKE_ENTRY_DIRECTORY \
OPTION_LONG("make-entry-directory", \
"BOOL|auto", "Create $BOOT/ENTRY-TOKEN/ directory")
#define OPTION_COMMON_PRIVATE_KEY(purpose) \
OPTION_LONG("private-key", "PATH|URI", purpose)