Compat kernel command line debug option --verbose

Check for "--verbose", as well as "finit_debug", on kernel command
line to enable debugging of finit.  The former is a compatibility
option with upstart, see http://upstart.ubuntu.com/wiki/Debugging

Add the following to the kernel command line to enable:

    "init=/sbin/finit --verbose"

Without the quote characters.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2012-09-17 11:09:35 +02:00
1 parent 5da4f4cfc3
commit 2f527215d0
1 file changed
+5 -1
+5 -1
View File
@@ -87,14 +87,18 @@ int main(void)
*/ */
if ((f = fopen("/proc/cmdline", "r")) != NULL) { if ((f = fopen("/proc/cmdline", "r")) != NULL) {
fgets(line, LINE_SIZE, f); fgets(line, LINE_SIZE, f);
if ((strstr(line, "finit_debug"))) {
if (strstr(line, "finit_debug") ||
strstr(line, "--verbose")) {
debug = 1; debug = 1;
} }
if (strstr(line, "quiet")) { if (strstr(line, "quiet")) {
close(0); close(0);
close(1); close(1);
close(2); close(2);
} }
fclose(f); fclose(f);
} }