]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
firstboot: make clear where the full screen console wizards end
authorLennart Poettering <lennart@amutable.com>
Wed, 20 May 2026 21:17:11 +0000 (23:17 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 21 May 2026 00:09:38 +0000 (09:09 +0900)
The three first boot screens are visually separated from the console
output before them via the "chome" and welcome strings and sufficient
whitespace. But so far they weren't from the output after them. This is
sometimes a big confusing. Let's add a bit of a separator between the
end and what comes next, too.

Just cosmetics, nothing else.

src/firstboot/firstboot.c
src/home/homectl.c
src/sysinstall/sysinstall.c

index 60ec63e2daed64fb41a4d02f2d6e82348d2e9197..eac9e7f19bf839fe69ea1b7fb650e2e26659ad48 100644 (file)
@@ -103,9 +103,10 @@ STATIC_DESTRUCTOR_REGISTER(arg_root_shell, freep);
 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;
 
@@ -122,7 +123,7 @@ static void print_welcome(int rfd, sd_varlink **mute_console_link) {
         if (!arg_welcome)
                 return;
 
-        if (done) {
+        if (welcome_done) {
                 putchar('\n'); /* Add some breathing room between multiple prompts */
                 return;
         }
@@ -158,7 +159,7 @@ static void print_welcome(int rfd, sd_varlink **mute_console_link) {
         }
         printf("Please configure the system!\n\n");
 
-        done = true;
+        welcome_done = true;
 }
 
 static int should_configure(int dir_fd, const char *filename) {
@@ -1562,6 +1563,15 @@ static int reload_vconsole(sd_bus **bus) {
         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;
@@ -1627,6 +1637,7 @@ static int run(int argc, char *argv[]) {
         }
 
         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
index 6891475f3780f6f815a032bc1f282319abf5e5a0..a90b517416c0d04aae908b0bdd3e08bb5ba3e757 100644 (file)
@@ -5,6 +5,7 @@
 #include "sd-bus.h"
 #include "sd-varlink.h"
 
+#include "ansi-color.h"
 #include "ask-password-api.h"
 #include "bitfield.h"
 #include "build.h"
@@ -2979,6 +2980,11 @@ static int username_is_ok(const char *name, void *userdata) {
         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;
@@ -2999,6 +3005,7 @@ static int create_interactively(void) {
         if (arg_chrome)
                 chrome_show("Create a User Account", /* bottom= */ NULL);
 
+        DEFER_VOID_CALL(end_marker);
         DEFER_VOID_CALL(chrome_hide);
 
         if (emoji_enabled()) {
index 0092f3f9c8c9220b2ede35738d74606eeddc8400..01e8cd048337dae218e2cc072d23be1ff2e18ba6 100644 (file)
@@ -1249,6 +1249,15 @@ static int settle_definitions(void) {
         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;
 
@@ -1275,6 +1284,7 @@ static int run(int argc, char *argv[]) {
                         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;