STATIC_DESTRUCTOR_REGISTER(arg_kernel_cmdline, freep);
STATIC_DESTRUCTOR_REGISTER(arg_image_policy, image_policy_freep);
+static bool welcome_done = false;
+
static void print_welcome(int rfd, sd_varlink **mute_console_link) {
_cleanup_free_ char *pretty_name = NULL, *os_name = NULL, *ansi_color = NULL, *fancy_name = NULL;
- static bool done = false;
const char *pn, *ac;
int r;
if (!arg_welcome)
return;
- if (done) {
+ if (welcome_done) {
putchar('\n'); /* Add some breathing room between multiple prompts */
return;
}
}
printf("Please configure the system!\n\n");
- done = true;
+ welcome_done = true;
}
static int should_configure(int dir_fd, const char *filename) {
return 0;
}
+static void end_marker(void) {
+
+ if (!welcome_done)
+ return;
+
+ printf("\n%sExiting first boot settings tool.%s\n\n", ansi_grey(), ansi_normal());
+ fflush(stdout);
+}
+
static int run(int argc, char *argv[]) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
_cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL;
}
LOG_SET_PREFIX(arg_image ?: arg_root);
+ DEFER_VOID_CALL(end_marker);
DEFER_VOID_CALL(chrome_hide);
/* We check these conditions here instead of in parse_argv() so that we can take the root directory
#include "sd-bus.h"
#include "sd-varlink.h"
+#include "ansi-color.h"
#include "ask-password-api.h"
#include "bitfield.h"
#include "build.h"
return false;
}
+static void end_marker(void) {
+ printf("\n%sExiting user account creation tool.%s\n\n", ansi_grey(), ansi_normal());
+ fflush(stdout);
+}
+
static int create_interactively(void) {
_cleanup_free_ char *username = NULL;
int r;
if (arg_chrome)
chrome_show("Create a User Account", /* bottom= */ NULL);
+ DEFER_VOID_CALL(end_marker);
DEFER_VOID_CALL(chrome_hide);
if (emoji_enabled()) {
return 0;
}
+static void end_marker(void) {
+
+ if (!arg_welcome)
+ return;
+
+ printf("\n%sExiting first boot settings tool.%s\n\n", ansi_grey(), ansi_normal());
+ fflush(stdout);
+}
+
static int run(int argc, char *argv[]) {
int r;
chrome_show("Operating System Installer", /* bottom= */ NULL);
}
+ DEFER_VOID_CALL(end_marker);
DEFER_VOID_CALL(chrome_hide);
_cleanup_(sd_varlink_flush_close_unrefp) sd_varlink *repart_link = NULL;