1 <?xml version='
1.0'
?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 This file is part of systemd.
8 Copyright 2014 Lennart Poettering
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 <refentry id=
"systemd-firstboot" conditional='ENABLE_FIRSTBOOT'
25 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
28 <title>systemd-firstboot
</title>
29 <productname>systemd
</productname>
33 <contrib>Developer
</contrib>
34 <firstname>Lennart
</firstname>
35 <surname>Poettering
</surname>
36 <email>lennart@poettering.net
</email>
42 <refentrytitle>systemd-firstboot
</refentrytitle>
43 <manvolnum>1</manvolnum>
47 <refname>systemd-firstboot
</refname>
48 <refname>systemd-firstboot.service
</refname>
49 <refpurpose>Initialize basic system settings on or before the first boot-up of a system
</refpurpose>
54 <command>systemd-firstboot
</command>
55 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
58 <para><filename>systemd-firstboot.service
</filename></para>
62 <title>Description
</title>
64 <para><command>systemd-firstboot
</command> initializes the most
65 basic system settings interactively on the first boot, or
66 optionally non-interactively when a system image is created.
67 The service is started if
<varname>ConditionFirstBoot=yes
</varname>
68 is satisfied. This essentially means that
<filename>/etc
</filename>
70 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
73 <para>The following settings may be set up:
</para>
76 <listitem><para>The system locale, more specifically the two
77 locale variables
<varname>LANG=
</varname> and
78 <varname>LC_MESSAGES
</varname></para></listitem>
80 <listitem><para>The system time zone
</para></listitem>
82 <listitem><para>The system host name
</para></listitem>
84 <listitem><para>The machine ID of the system
</para></listitem>
86 <listitem><para>The root user's password
</para></listitem>
89 <para>Each of the fields may either be queried interactively by
90 users, set non-interactively on the tool's command line, or be
91 copied from a host system that is used to set up the system
94 <para>If a setting is already initialized, it will not be
95 overwritten and the user will not be prompted for the
98 <para>Note that this tool operates directly on the file system and
99 does not involve any running system services, unlike
100 <citerefentry project='man-pages'
><refentrytitle>localectl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
101 <citerefentry><refentrytitle>timedatectl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
103 <citerefentry><refentrytitle>hostnamectl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
104 This allows
<command>systemd-firstboot
</command> to operate on
105 mounted but not booted disk images and in early boot. It is not
106 recommended to use
<command>systemd-firstboot
</command> on the
107 running system while it is up.
</para>
111 <title>Options
</title>
113 <para>The following options are understood:
</para>
117 <term><option>--root=
<replaceable>root
</replaceable></option></term>
118 <listitem><para>Takes a directory path as an argument. All
119 paths will be prefixed with the given alternate
120 <replaceable>root
</replaceable> path, including config search
121 paths. This is useful to operate on a system image mounted to
122 the specified directory instead of the host system itself.
127 <term><option>--locale=
<replaceable>LOCALE
</replaceable></option></term>
128 <term><option>--locale-messages=
<replaceable>LOCALE
</replaceable></option></term>
130 <listitem><para>Sets the system locale, more specifically the
131 <varname>LANG=
</varname> and
<varname>LC_MESSAGES
</varname>
132 settings. The argument should be a valid locale identifier,
133 such as
<literal>de_DE.UTF-
8</literal>. This controls the
134 <citerefentry project='man-pages'
><refentrytitle>locale.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
135 configuration file.
</para></listitem>
139 <term><option>--timezone=
<replaceable>TIMEZONE
</replaceable></option></term>
141 <listitem><para>Sets the system time zone. The argument should
142 be a valid time zone identifier, such as
143 <literal>Europe/Berlin
</literal>. This controls the
144 <citerefentry><refentrytitle>localtime
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
145 symlink.
</para></listitem>
149 <term><option>--hostname=
<replaceable>HOSTNAME
</replaceable></option></term>
151 <listitem><para>Sets the system hostname. The argument should
152 be a host name, compatible with DNS. This controls the
153 <citerefentry><refentrytitle>hostname
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
154 configuration file.
</para></listitem>
158 <term><option>--machine-id=
<replaceable>ID
</replaceable></option></term>
160 <listitem><para>Sets the system's machine ID. This controls
162 <citerefentry><refentrytitle>machine-id
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
163 file.
</para></listitem>
167 <term><option>--root-password=
<replaceable>PASSWORD
</replaceable></option></term>
168 <term><option>--root-password-file=
<replaceable>PATH
</replaceable></option></term>
170 <listitem><para>Sets the password of the system's root user.
172 <citerefentry project='die-net'
><refentrytitle>shadow
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
173 file. This setting exists in two forms:
174 <option>--root-password=
</option> accepts the password to set
175 directly on the command line, and
176 <option>--root-password-file=
</option> reads it from a file.
177 Note that it is not recommended to specify passwords on the
178 command line, as other users might be able to see them simply
180 <citerefentry project='die-net'
><refentrytitle>ps
</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
</para></listitem>
184 <term><option>--prompt-locale
</option></term>
185 <term><option>--prompt-timezone
</option></term>
186 <term><option>--prompt-hostname
</option></term>
187 <term><option>--prompt-root-password
</option></term>
189 <listitem><para>Prompt the user interactively for a specific
190 basic setting. Note that any explicit configuration settings
191 specified on the command line take precedence, and the user is
192 not prompted for it.
</para></listitem>
196 <term><option>--prompt
</option></term>
198 <listitem><para>Query the user for locale, timezone, hostname
199 and root password. This is equivalent to specifying
200 <option>--prompt-locale
</option>,
201 <option>--prompt-timezone
</option>,
202 <option>--prompt-hostname
</option>,
203 <option>--prompt-root-password
</option> in combination.
</para>
208 <term><option>--copy-locale
</option></term>
209 <term><option>--copy-timezone
</option></term>
210 <term><option>--copy-root-password
</option></term>
212 <listitem><para>Copy a specific basic setting from the host.
213 This only works in combination with
<option>--root=
</option>
214 (see above).
</para></listitem>
218 <term><option>--copy
</option></term>
220 <listitem><para>Copy locale, time zone and root password from
221 the host. This is equivalent to specifying
222 <option>--copy-locale
</option>,
223 <option>--copy-timezone
</option>,
224 <option>--copy-root-password
</option> in combination.
</para>
229 <term><option>--setup-machine-id
</option></term>
231 <listitem><para>Initialize the system's machine ID to a random
232 ID. This only works in combination with
233 <option>--root=
</option>.
</para></listitem>
236 <xi:include href=
"standard-options.xml" xpointer=
"help" />
237 <xi:include href=
"standard-options.xml" xpointer=
"version" />
243 <title>Exit status
</title>
245 <para>On success,
0 is returned, a non-zero failure code
250 <title>Kernel Command Line
</title>
252 <variablelist class='kernel-commandline-options'
>
254 <term><varname>systemd.firstboot=
</varname></term>
256 <listitem><para>Takes a boolean argument, defaults to on. If off,
<filename>systemd-firstboot.service
</filename>
257 won't interactively query the user for basic settings at first boot, even if those settings are not
258 initialized yet.
</para></listitem>
264 <title>See Also
</title>
266 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
267 <citerefentry project='man-pages'
><refentrytitle>locale.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
268 <citerefentry><refentrytitle>localtime
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
269 <citerefentry><refentrytitle>hostname
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
270 <citerefentry><refentrytitle>machine-id
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
271 <citerefentry project='die-net'
><refentrytitle>shadow
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
272 <citerefentry><refentrytitle>systemd-machine-id-setup
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
273 <citerefentry project='man-pages'
><refentrytitle>localectl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
274 <citerefentry><refentrytitle>timedatectl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
275 <citerefentry><refentrytitle>hostnamectl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>