Drop confusing splash cmdline and --enable-progress configure option

This patch reverts back to the progress/status behavior of Finit < v3.0
because this is what most users expect, including the maintainer.  The
resulting code and configure script is a lot simpler to understand and
maintain:

- No more --enable-progress or --enable-progress-classic configure
  flags.  Instead a progress_style variable in helpers.c that can
  be changed at compile time for those that really need it.
- No more 'splash' kernel commnand line option.  This turned out to
  be *very* confusing to many users who believed it was some sort of
  graphical splash screen à la Plymouth.

Also, when Finit debug is enabled we now have a global 'debug' flag
which now alo controls if klogctl() should be called to prevent the
kernel logs to the console or not.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2021-02-14 20:11:08 +01:00
1 parent 13a33d345b
commit 35e4e0d073
13 files changed
+55 -130

No files matched your search

+3 -45
View File
@@ -28,43 +28,24 @@
#include <lite/lite.h>
#include "finit.h"
#include "helpers.h"
#include "log.h"
#include "util.h"
static int up = 0;
static int debug = 0;
static int silent = SILENT_MODE; /* Completely silent, including boot */
static int loglevel = LOG_NOTICE;
static void muffler(void)
{
silent = SILENT_MODE;
/* User override from kernel cmdline */
if (splash)
silent = 0;
}
void log_init(int dbg)
{
if (dbg)
debug = 1;
if (debug)
loglevel = LOG_DEBUG;
else
loglevel = LOG_NOTICE;
muffler();
}
/* If we enabled terse mode at boot, restore to previous setting at shutdown */
void log_exit(void)
{
muffler();
if (!silent)
sched_yield();
/*
* Unless in debug mode at shutdown, Reinitialize screen,
* terminal may have been resized at runtime
@@ -73,6 +54,8 @@ void log_exit(void)
screen_exit();
else
screen_init();
show_progress(1);
}
void log_open(void)
@@ -89,48 +72,23 @@ void log_open(void)
up = 1;
}
void log_silent(void)
{
if (debug)
silent = 0;
else
silent = 1;
}
int log_is_silent(void)
{
return silent;
}
/* Toggle debug mode */
void log_debug(void)
{
debug = !debug;
if (debug) {
silent = 0;
loglevel = LOG_DEBUG;
screen_exit();
} else {
silent = SILENT_MODE;
loglevel = LOG_NOTICE;
screen_init();
}
log_open();
/* Also toggle silent mode (progress) */
log_silent();
logit(LOG_NOTICE, "Debug mode %s", debug ? "enabled" : "disabled");
}
int log_is_debug(void)
{
return debug;
}
/*
* Log to /dev/kmsg until syslogd has started, then openlog()
* and continue logging as a regular daemon.