From: Lennart Poettering Date: Fri, 19 Sep 2025 08:18:29 +0000 (+0200) Subject: homectl: show blue 'chrome' bar in first boot mode X-Git-Tag: v259-rc1~402^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b128c31f46e8990d16588e80dcd82ce8787c5024;p=thirdparty%2Fsystemd.git homectl: show blue 'chrome' bar in first boot mode --- diff --git a/man/homectl.xml b/man/homectl.xml index d57001ab03a..961266aea3d 100644 --- a/man/homectl.xml +++ b/man/homectl.xml @@ -234,6 +234,17 @@ + + + + Takes a boolean argument. By default the interactive user creation via + firstboot --prompt-new-user screen will show reverse color "chrome" bars at the + top and and the bottom of the terminal screen, which may be disabled by setting this option to + false. + + + + diff --git a/src/home/homectl.c b/src/home/homectl.c index 69771972d0d..22665eae45f 100644 --- a/src/home/homectl.c +++ b/src/home/homectl.c @@ -49,6 +49,7 @@ #include "pretty-print.h" #include "proc-cmdline.h" #include "process-util.h" +#include "prompt-util.h" #include "recurse-dir.h" #include "rlimit-util.h" #include "runtime-scope.h" @@ -110,6 +111,7 @@ static bool arg_seize = true; static bool arg_prompt_new_user = false; static bool arg_prompt_shell = true; static bool arg_prompt_groups = true; +static bool arg_chrome = true; STATIC_DESTRUCTOR_REGISTER(arg_identity_extra, sd_json_variant_unrefp); STATIC_DESTRUCTOR_REGISTER(arg_identity_extra_this_machine, sd_json_variant_unrefp); @@ -2837,7 +2839,13 @@ static int create_interactively(void) { return 0; } - putchar('\n'); + (void) terminal_reset_defensive_locked(STDOUT_FILENO, /* flags= */ 0); + + if (arg_chrome) + chrome_show("Create a User Account", /* bottom= */ NULL); + + DEFER_VOID_CALL(chrome_hide); + if (emoji_enabled()) { fputs(glyph(GLYPH_HOME), stdout); putchar(' '); @@ -2849,8 +2857,6 @@ static int create_interactively(void) { return 0; } - (void) terminal_reset_defensive_locked(STDOUT_FILENO, /* flags= */ 0); - for (;;) { username = mfree(username); @@ -3069,6 +3075,8 @@ static int help(int argc, char *argv[], void *userdata) { " --prompt-groups=no In first-boot mode, don't prompt for auxiliary\n" " group memberships\n" " --prompt-shell=no In first-boot mode, don't prompt for shells\n" + " --chrome=no In first-boot mode, don't show colour bar at top\n" + " and bottom of terminal\n" "\n%4$sGeneral User Record Properties:%5$s\n" " -c --real-name=REALNAME Real name for user\n" " --realm=REALM Realm to create user in\n" @@ -3307,6 +3315,7 @@ static int parse_argv(int argc, char *argv[]) { ARG_MATCH, ARG_PROMPT_SHELL, ARG_PROMPT_GROUPS, + ARG_CHROME, }; static const struct option options[] = { @@ -3415,6 +3424,7 @@ static int parse_argv(int argc, char *argv[]) { { "match", required_argument, NULL, ARG_MATCH }, { "prompt-shell", required_argument, NULL, ARG_PROMPT_SHELL }, { "prompt-groups", required_argument, NULL, ARG_PROMPT_GROUPS }, + { "chrome", required_argument, NULL, ARG_CHROME }, {} }; @@ -4988,6 +4998,13 @@ static int parse_argv(int argc, char *argv[]) { break; + case ARG_CHROME: + r = parse_boolean_argument("--chrome=", optarg, &arg_chrome); + if (r < 0) + return r; + + break; + case '?': return -EINVAL;