diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-06-28 11:59:00 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-07-07 11:20:42 +0200 |
commit | a122502077357cab66fed19b32a9b3be4320c064 (patch) | |
tree | 363f6158b674f9ea47774681c56977ee64553840 /src/firstboot/firstboot.c | |
parent | dcfdd6218469ab2b116712980a875c8b4c963c8f (diff) | |
download | systemd-a122502077357cab66fed19b32a9b3be4320c064.tar.gz |
firstboot: add option to turn off welcome text display
Diffstat (limited to 'src/firstboot/firstboot.c')
-rw-r--r-- | src/firstboot/firstboot.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index 6d22fbc081..5c9ee779ca 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -62,6 +62,7 @@ static bool arg_copy_root_password = false; static bool arg_force = false; static bool arg_delete_root_password = false; static bool arg_root_password_is_hashed = false; +static bool arg_welcome = true; STATIC_DESTRUCTOR_REGISTER(arg_root, freep); STATIC_DESTRUCTOR_REGISTER(arg_image, freep); @@ -93,6 +94,9 @@ static void print_welcome(void) { const char *pn; int r; + if (!arg_welcome) + return; + if (done) return; @@ -940,6 +944,7 @@ static int help(void) { " --setup-machine-id Generate a new random machine ID\n" " --force Overwrite existing files\n" " --delete-root-password Delete root password\n" + " --welcome=no Disable the welcome text\n" "\nSee the %s for details.\n" , program_invocation_short_name , link @@ -978,6 +983,7 @@ static int parse_argv(int argc, char *argv[]) { ARG_SETUP_MACHINE_ID, ARG_FORCE, ARG_DELETE_ROOT_PASSWORD, + ARG_WELCOME, }; static const struct option options[] = { @@ -1009,6 +1015,7 @@ static int parse_argv(int argc, char *argv[]) { { "setup-machine-id", no_argument, NULL, ARG_SETUP_MACHINE_ID }, { "force", no_argument, NULL, ARG_FORCE }, { "delete-root-password", no_argument, NULL, ARG_DELETE_ROOT_PASSWORD }, + { "welcome", required_argument, NULL, ARG_WELCOME }, {} }; @@ -1186,6 +1193,14 @@ static int parse_argv(int argc, char *argv[]) { arg_delete_root_password = true; break; + case ARG_WELCOME: + r = parse_boolean(optarg); + if (r < 0) + return log_error_errno(r, "Failed to parse --welcome= argument: %s", optarg); + + arg_welcome = r; + break; + case '?': return -EINVAL; |