From f8d608107c984465e3bcfc8b77d36f8c1df1b0d2 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 7 Jun 2015 16:06:23 +0200 Subject: [PATCH] Allow quiet mode to disable banner, also simplify default banner. Signed-off-by: Joachim Nilsson --- client.c | 3 ++- finit.c | 10 +++++----- helpers.c | 5 +++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/client.c b/client.c index ef91bef9..72f6bdbb 100644 --- a/client.c +++ b/client.c @@ -100,7 +100,8 @@ static int set_runlevel(int lvl) int show_version(void) { - return banner(); + puts("v" VERSION); + return 0; } static int show_status(void) diff --git a/finit.c b/finit.c index dfb6f045..7a83d3ff 100644 --- a/finit.c +++ b/finit.c @@ -60,11 +60,6 @@ int main(int argc, char* argv[]) if (getpid() != 1) return client(argc, argv); - /* - * Hello world. - */ - banner(); - /* * Initial setup of signals, ignore all until we're up. */ @@ -95,6 +90,11 @@ int main(int argc, char* argv[]) */ parse_kernel_cmdline(); + /* + * Hello world. + */ + banner(); + /* * Populate /dev and prepare for runtime events from kernel. */ diff --git a/helpers.c b/helpers.c index 9507244a..5b7a0e52 100644 --- a/helpers.c +++ b/helpers.c @@ -172,14 +172,15 @@ char *runlevel_string(int levels) */ int banner(void) { - if (getpid() == 1 && !verbose) + if (!verbose) return 0; delline(); #ifdef INIT_HEADING echo("%s", INIT_HEADING); #else - echo("Finit version " VERSION " (" WHOAMI ") " __DATE__ " " __TIME__); + echo("Finit v" VERSION); + echo("==================================================================="); #endif return 0; }