Add --enable-kernel-quiet to configure, delayed quiet after initial boot.

... with the additional twist that the kernel command line option
'quiet' also gets to play.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2015-06-07 16:20:23 +02:00
1 parent f8d608107c
commit 6d3972cca8
4 files changed
+23 -3

No files matched your search

+5 -3
View File
@@ -65,10 +65,12 @@ void parse_kernel_cmdline(void)
if (strstr(line, "finit_debug") || strstr(line, "--debug")) if (strstr(line, "finit_debug") || strstr(line, "--debug"))
debug = 1; debug = 1;
#ifdef KERNEL_QUIET
if (!debug && strstr(line, "quiet")) if (!debug && strstr(line, "quiet"))
verbose = 0; quiet = 1;
else
quiet = 0;
#endif
fclose(fp); fclose(fp);
} }
} }
Vendored
+12
View File
@@ -29,6 +29,7 @@ defaults()
embedded=${embedded:=0} embedded=${embedded:=0}
inetd=${inetd:=1} inetd=${inetd:=1}
verbose=${verbose:=1} verbose=${verbose:=1}
kernel_quiet=${kernel_quiet:=1}
static=${static:=0} static=${static:=0}
disable_plugins=${disable_plugins:=0} disable_plugins=${disable_plugins:=0}
} }
@@ -65,6 +66,11 @@ fi
else else
echo "Quiet Finit : NO, verbose output (default)" echo "Quiet Finit : NO, verbose output (default)"
fi fi
if [ $kernel_quiet -eq 1 ]; then
echo "Kernel Quiet : YES, silent after inital boot (default)"
else
echo "Kernel Quiet : NO"
fi
if [ $static -ne 0 ]; then if [ $static -ne 0 ]; then
echo "Static Finit : YES" echo "Static Finit : YES"
fi fi
@@ -105,6 +111,7 @@ usage()
echo " --enable-embedded Enable embedded defaults, BusBox getty, mdev etc." echo " --enable-embedded Enable embedded defaults, BusBox getty, mdev etc."
echo " --enable-debug Enable debug flags, '-O0, -g'" echo " --enable-debug Enable debug flags, '-O0, -g'"
echo " --enable-quiet Quiet mode, reduce screen output to absolute minimum." echo " --enable-quiet Quiet mode, reduce screen output to absolute minimum."
echo " --enable-kernel-quiet Like quiet, but after boot, using kernel cmdline quiet."
echo " --enable-static Link statically. This disables a few features." echo " --enable-static Link statically. This disables a few features."
echo " --disable-inetd Disable inetd support if not needed." echo " --disable-inetd Disable inetd support if not needed."
echo " --disable-plugins Disable plugins" echo " --disable-plugins Disable plugins"
@@ -182,6 +189,10 @@ while [ "$*" != "" ]; do
verbose=0 verbose=0
;; ;;
enable-kernel-quiet)
kernel_quiet=1
;;
enable-static) enable-static)
static=1 static=1
;; ;;
@@ -275,6 +286,7 @@ if [ x"$heading" != x"" ]; then
fi fi
echo "#define VERBOSE_MODE $verbose" >> config.h echo "#define VERBOSE_MODE $verbose" >> config.h
echo "#define KERNEL_QUIET $kernel_quiet" >> config.h
echo "#define FINIT_FIFO \"$fifo\"" >> config.h echo "#define FINIT_FIFO \"$fifo\"" >> config.h
echo "#define FINIT_CONF \"$config\"" >> config.h echo "#define FINIT_CONF \"$config\"" >> config.h
echo "#define FINIT_RCSD \"$rcsd\"" >> config.h echo "#define FINIT_RCSD \"$rcsd\"" >> config.h
+5
View File
@@ -38,6 +38,7 @@
#include "inetd.h" #include "inetd.h"
int debug = 0; int debug = 0;
int quiet = KERNEL_QUIET; /* Delayed disable of verbose mode. */
int verbose = VERBOSE_MODE; int verbose = VERBOSE_MODE;
int runlevel = 0; /* Bootstrap */ int runlevel = 0; /* Bootstrap */
int cfglevel = RUNLEVEL; /* Fallback if no configured runlevel */ int cfglevel = RUNLEVEL; /* Fallback if no configured runlevel */
@@ -185,6 +186,10 @@ int main(int argc, char* argv[])
/* Start TTYs */ /* Start TTYs */
tty_runlevel(runlevel); tty_runlevel(runlevel);
/* Disable verbose mode, if selected */
if (quiet)
verbose = 0;
/* /*
* Enter main loop to monior /dev/initctl and services * Enter main loop to monior /dev/initctl and services
*/ */
+1
View File
@@ -88,6 +88,7 @@ struct init_request {
}; };
extern int debug; extern int debug;
extern int quiet;
extern int verbose; extern int verbose;
extern int runlevel; extern int runlevel;
extern int cfglevel; extern int cfglevel;