summaryrefslogtreecommitdiff
path: root/src/firstboot
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-12-09 01:11:42 +0100
committerLennart Poettering <lennart@poettering.net>2016-12-20 20:00:09 +0100
commitf582cbca0029d3867620dfa7df86534d2a241275 (patch)
treefb4125bbbb485b1f35685206106aa6bb52b0e201 /src/firstboot
parent710028b473c39446954b72c0d9dadb76cc7f81f8 (diff)
firstboot: add kernel cmdline option to disable firstboot wizard
If booting with systemd.firstboot=0 the wizard will be skipped.
Diffstat (limited to 'src/firstboot')
-rw-r--r--src/firstboot/firstboot.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c
index c9e8e54ee3..7c615abbc5 100644
--- a/src/firstboot/firstboot.c
+++ b/src/firstboot/firstboot.c
@@ -33,6 +33,7 @@
#include "mkdir.h"
#include "parse-util.h"
#include "path-util.h"
+#include "proc-cmdline.h"
#include "random-util.h"
#include "string-util.h"
#include "strv.h"
@@ -825,6 +826,7 @@ static int parse_argv(int argc, char *argv[]) {
}
int main(int argc, char *argv[]) {
+ _cleanup_free_ char *enabled = NULL;
int r;
r = parse_argv(argc, argv);
@@ -837,6 +839,17 @@ int main(int argc, char *argv[]) {
umask(0022);
+ r = get_proc_cmdline_key("systemd.firstboot=", &enabled);
+ if (r < 0)
+ return r;
+ if (r > 0) {
+ r = parse_boolean(enabled);
+ if (r == 0)
+ goto finish;
+ if (r < 0)
+ log_warning_errno(r, "Failed to parse systemd.firstboot= kernel command line argument, ignoring: %s", enabled);
+ }
+
r = process_locale();
if (r < 0)
goto finish;