static bool arg_welcome = true;
static bool arg_reset = false;
static ImagePolicy *arg_image_policy = NULL;
+static bool arg_chrome = true;
STATIC_DESTRUCTOR_REGISTER(arg_root, freep);
STATIC_DESTRUCTOR_REGISTER(arg_image, freep);
return;
}
+ (void) terminal_reset_defensive_locked(STDOUT_FILENO, /* flags= */ 0);
+
+ if (arg_chrome)
+ chrome_show("Initial Setup", /* bottom= */ NULL);
+
r = parse_os_release_at(rfd,
"PRETTY_NAME", &pretty_name,
"NAME", &os_name,
pn = os_release_pretty_name(pretty_name, os_name);
ac = isempty(ansi_color) ? "0" : ansi_color;
- (void) terminal_reset_defensive_locked(STDOUT_FILENO, /* flags= */ 0);
-
if (colors_enabled())
- printf("\n"
- ANSI_HIGHLIGHT "Welcome to your new installation of " ANSI_NORMAL "\x1B[%sm%s" ANSI_HIGHLIGHT "!" ANSI_NORMAL "\n", ac, pn);
+ printf(ANSI_HIGHLIGHT "Welcome to your new installation of " ANSI_NORMAL "\x1B[%sm%s" ANSI_HIGHLIGHT "!" ANSI_NORMAL "\n", ac, pn);
else
- printf("\nWelcome to your new installation of %s!\n", pn);
+ printf("Welcome to your new installation of %s!\n", pn);
putchar('\n');
if (emoji_enabled()) {
" --force Overwrite existing files\n"
" --delete-root-password Delete root password\n"
" --welcome=no Disable the welcome text\n"
+ " --chrome=no Don't show color bar at top and bottom of\n"
+ " terminal\n"
" --reset Remove existing files\n"
"\nSee the %s for details.\n",
program_invocation_short_name,
ARG_FORCE,
ARG_DELETE_ROOT_PASSWORD,
ARG_WELCOME,
+ ARG_CHROME,
ARG_RESET,
};
{ "force", no_argument, NULL, ARG_FORCE },
{ "delete-root-password", no_argument, NULL, ARG_DELETE_ROOT_PASSWORD },
{ "welcome", required_argument, NULL, ARG_WELCOME },
+ { "chrome", required_argument, NULL, ARG_CHROME },
{ "reset", no_argument, NULL, ARG_RESET },
{}
};
arg_welcome = r;
break;
+ case ARG_CHROME:
+ r = parse_boolean_argument("--chrome=", optarg, &arg_chrome);
+ if (r < 0)
+ return r;
+
+ break;
+
case ARG_RESET:
arg_reset = true;
break;
}
LOG_SET_PREFIX(arg_image ?: arg_root);
+ DEFER_VOID_CALL(chrome_hide);
/* We check these conditions here instead of in parse_argv() so that we can take the root directory
* into account. */
return 0;
unsigned n = lines();
- if (n < 12) /* Do not bother with the chrom on tiny screens */
+ if (n < 12) /* Do not bother with the chrome on tiny screens */
return 0;
_cleanup_free_ char *b = NULL, *ansi_color_reverse = NULL;
printf("\x1B[%u;1H"
ANSI_NORMAL ANSI_ERASE_TO_END_OF_LINE "\n"
ANSI_NORMAL ANSI_ERASE_TO_END_OF_LINE "\n"
- ANSI_NORMAL ANSI_ERASE_TO_END_OF_LINE ANSI_NORMAL,
+ ANSI_NORMAL ANSI_ERASE_TO_END_OF_LINE,
n - 2);
/* Reset scrolling area (DECSTBM) */