From: Lennart Poettering Date: Wed, 17 Jul 2024 13:07:29 +0000 (+0200) Subject: main: show different welcome msg in initrd than on the host X-Git-Tag: v257-rc1~890 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f499191c2e8b47f6d5f9a4989772d1620842a244;p=thirdparty%2Fsystemd.git main: show different welcome msg in initrd than on the host It has bugged me for a while that we show the exact same welcome message at boot twice: once in the initrd, and once after the initrd→host transition. That's very confusing. Let's change the text a bit, and tone down the initrd message a bit (by removing the empty line before and after it), because it is the less relevant one. --- diff --git a/src/core/main.c b/src/core/main.c index ed28102781b..1b78cd652fc 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1399,17 +1399,27 @@ static int os_release_status(void) { "Failed to read os-release file, ignoring: %m"); const char *label = os_release_pretty_name(pretty_name, name); + const char *color = empty_to_null(ansi_color) ?: "1"; if (show_status_on(arg_show_status)) { - if (log_get_show_color()) - status_printf(NULL, 0, - "\nWelcome to \x1B[%sm%s\x1B[0m!\n", - empty_to_null(ansi_color) ?: "1", - label); - else - status_printf(NULL, 0, - "\nWelcome to %s!\n", - label); + if (in_initrd()) { + if (log_get_show_color()) + status_printf(NULL, 0, + ANSI_HIGHLIGHT "Booting initrd of " ANSI_NORMAL "\x1B[%sm%s" ANSI_NORMAL ANSI_HIGHLIGHT "." ANSI_NORMAL, + color, label); + else + status_printf(NULL, 0, + "Booting initrd of %s...", label); + } else { + if (log_get_show_color()) + status_printf(NULL, 0, + "\n" ANSI_HIGHLIGHT "Welcome to " ANSI_NORMAL "\x1B[%sm%s" ANSI_NORMAL ANSI_HIGHLIGHT "!" ANSI_NORMAL "\n", + color, label); + else + status_printf(NULL, 0, + "\nWelcome to %s!\n", + label); + } } if (support_end && os_release_support_ended(support_end, /* quiet */ false, NULL) > 0)