mirror of
https://github.com/troglobit/finit.git
synced 2026-12-04 21:58:19 +00:00
Make sure log_exit() restores progress output on shutdown/reboot
This patch builds on top of the recently introduced "silent by default" and support for kernel cmdline `splash` to disable silent operation. At shutdown/reboot `log_exit()` is called, the intention is to re-enable progress output so the user can see what's going on. So, we need to re- set `silent` to the same setting as log_init() started with, hence the new `muffler()`. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
112ab2c22f
commit
71915e0e14
1 file changed
+11
-4
@@ -35,6 +35,15 @@ static int debug = 0;
|
|||||||
static int silent = SILENT_MODE; /* Completely silent, including boot */
|
static int silent = SILENT_MODE; /* Completely silent, including boot */
|
||||||
static int loglevel = LOG_NOTICE;
|
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)
|
void log_init(int dbg)
|
||||||
{
|
{
|
||||||
if (dbg)
|
if (dbg)
|
||||||
@@ -45,15 +54,13 @@ void log_init(int dbg)
|
|||||||
else
|
else
|
||||||
loglevel = LOG_NOTICE;
|
loglevel = LOG_NOTICE;
|
||||||
|
|
||||||
/* User override from kernel cmdline */
|
muffler();
|
||||||
if (splash)
|
|
||||||
silent = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we enabled terse mode at boot, restore to previous setting at shutdown */
|
/* If we enabled terse mode at boot, restore to previous setting at shutdown */
|
||||||
void log_exit(void)
|
void log_exit(void)
|
||||||
{
|
{
|
||||||
silent = SILENT_MODE;
|
muffler();
|
||||||
if (!silent) {
|
if (!silent) {
|
||||||
sched_yield();
|
sched_yield();
|
||||||
fputs("\n", stderr);
|
fputs("\n", stderr);
|
||||||
|
|||||||
Reference in new issue
Block a user