firstboot: add option to turn off welcome text display
This commit is contained in:
parent
dcfdd62184
commit
a122502077
|
@ -259,6 +259,14 @@
|
||||||
option should not be used lightly.</para></listitem>
|
option should not be used lightly.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><option>--welcome=</option></term>
|
||||||
|
|
||||||
|
<listitem><para>Takes a boolean argument. By default when prompting the user for configuration
|
||||||
|
options a brief welcome text is shown before the first question is asked. Pass false to this option
|
||||||
|
to turn off the welcome text.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<xi:include href="standard-options.xml" xpointer="help" />
|
<xi:include href="standard-options.xml" xpointer="help" />
|
||||||
<xi:include href="standard-options.xml" xpointer="version" />
|
<xi:include href="standard-options.xml" xpointer="version" />
|
||||||
</variablelist>
|
</variablelist>
|
||||||
|
|
|
@ -62,6 +62,7 @@ static bool arg_copy_root_password = false;
|
||||||
static bool arg_force = false;
|
static bool arg_force = false;
|
||||||
static bool arg_delete_root_password = false;
|
static bool arg_delete_root_password = false;
|
||||||
static bool arg_root_password_is_hashed = false;
|
static bool arg_root_password_is_hashed = false;
|
||||||
|
static bool arg_welcome = true;
|
||||||
|
|
||||||
STATIC_DESTRUCTOR_REGISTER(arg_root, freep);
|
STATIC_DESTRUCTOR_REGISTER(arg_root, freep);
|
||||||
STATIC_DESTRUCTOR_REGISTER(arg_image, freep);
|
STATIC_DESTRUCTOR_REGISTER(arg_image, freep);
|
||||||
|
@ -93,6 +94,9 @@ static void print_welcome(void) {
|
||||||
const char *pn;
|
const char *pn;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
if (!arg_welcome)
|
||||||
|
return;
|
||||||
|
|
||||||
if (done)
|
if (done)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -940,6 +944,7 @@ static int help(void) {
|
||||||
" --setup-machine-id Generate a new random machine ID\n"
|
" --setup-machine-id Generate a new random machine ID\n"
|
||||||
" --force Overwrite existing files\n"
|
" --force Overwrite existing files\n"
|
||||||
" --delete-root-password Delete root password\n"
|
" --delete-root-password Delete root password\n"
|
||||||
|
" --welcome=no Disable the welcome text\n"
|
||||||
"\nSee the %s for details.\n"
|
"\nSee the %s for details.\n"
|
||||||
, program_invocation_short_name
|
, program_invocation_short_name
|
||||||
, link
|
, link
|
||||||
|
@ -978,6 +983,7 @@ static int parse_argv(int argc, char *argv[]) {
|
||||||
ARG_SETUP_MACHINE_ID,
|
ARG_SETUP_MACHINE_ID,
|
||||||
ARG_FORCE,
|
ARG_FORCE,
|
||||||
ARG_DELETE_ROOT_PASSWORD,
|
ARG_DELETE_ROOT_PASSWORD,
|
||||||
|
ARG_WELCOME,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct option options[] = {
|
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 },
|
{ "setup-machine-id", no_argument, NULL, ARG_SETUP_MACHINE_ID },
|
||||||
{ "force", no_argument, NULL, ARG_FORCE },
|
{ "force", no_argument, NULL, ARG_FORCE },
|
||||||
{ "delete-root-password", no_argument, NULL, ARG_DELETE_ROOT_PASSWORD },
|
{ "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;
|
arg_delete_root_password = true;
|
||||||
break;
|
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 '?':
|
case '?':
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue