]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
firstboot: add kernel cmdline option to disable firstboot wizard
authorLennart Poettering <lennart@poettering.net>
Fri, 9 Dec 2016 00:11:42 +0000 (01:11 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 20 Dec 2016 19:00:09 +0000 (20:00 +0100)
If booting with systemd.firstboot=0 the wizard will be skipped.

man/kernel-command-line.xml
man/systemd-firstboot.xml
src/firstboot/firstboot.c

index 1fa31a14b7bfd949760a92fe0edb69a451925355..c86e45265fe946b126202e92fe1b4401c1a04904 100644 (file)
           <citerefentry><refentrytitle>systemd-hibernate-resume-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
         </listitem>
       </varlistentry>
+
+      <varlistentry>
+        <term><varname>systemd.firstboot=</varname></term>
+
+        <listitem><para>Takes a boolean argument, defaults to on. If off,
+        <citerefentry><refentrytitle>systemd-firstboot.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+        will not query the user for basic system settings, even if the system boots up for the first time and the
+        relevant settings are not initialized yet.</para></listitem>
+      </varlistentry>
     </variablelist>
 
   </refsect1>
         <citerefentry><refentrytitle>systemd-modules-load.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
         <citerefentry><refentrytitle>systemd-backlight@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
         <citerefentry><refentrytitle>systemd-rfkill.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
-        <citerefentry><refentrytitle>systemd-hibernate-resume-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+        <citerefentry><refentrytitle>systemd-hibernate-resume-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+        <citerefentry><refentrytitle>systemd-firstboot.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
       </para>
   </refsect1>
 
index b269e4811352b08fbbcbde35066ead30f245545e..4e3b1a3a8149595073ab575bad12d74e0f297907 100644 (file)
     otherwise.</para>
   </refsect1>
 
+  <refsect1>
+    <title>Kernel Command Line</title>
+
+    <variablelist class='kernel-commandline-options'>
+      <varlistentry>
+        <term><varname>systemd.firstboot=</varname></term>
+
+        <listitem><para>Takes a boolean argument, defaults to on. If off <filename>systemd-firstboot.service</filename>
+        won't interactively query the user for basic settings at first boot, even if if the settings are not
+        initialized yet.</para></listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+
   <refsect1>
     <title>See Also</title>
     <para>
index c9e8e54ee38f00b0d8f234eda830691526a2afd9..7c615abbc581f0ba3d95823a28c860c9a5e2e160 100644 (file)
@@ -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;