Add support for single (S) user mode from kernel cmdline

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-12-30 21:20:06 +01:00
1 parent 5b3df3654c
commit eaa82377c4
3 files changed
+9

No files matched your search

+7
View File
@@ -81,6 +81,9 @@ void conf_parse_cmdline(void)
if (string_compare(tok, "rescue") || string_compare(tok, "recover"))
rescue = 1;
if (string_compare(tok, "single") || string_compare(tok, "S"))
single = 1;
}
fclose(fp);
@@ -628,6 +631,10 @@ done:
/* Drop record of all .conf changes */
drop_changes();
/* Override configured runlevel, user said 'S' on /proc/cmdline */
if (BOOTSTRAP && single)
cfglevel = 1;
/*
* Set host name, from %DEFHOST, *.conf or /etc/hostname. The
* latter wins, if neither exists we default to "noname"