1SYSTEMD-FIRSTBOOT(1) systemd-firstboot SYSTEMD-FIRSTBOOT(1)
2
3
4
6 systemd-firstboot, systemd-firstboot.service - Initialize basic system
7 settings on or before the first boot-up of a system
8
10 systemd-firstboot [OPTIONS...]
11
12 systemd-firstboot.service
13
15 systemd-firstboot initializes the most basic system settings
16 interactively on the first boot, or optionally non-interactively when a
17 system image is created. The service is started if
18 ConditionFirstBoot=yes is satisfied. This essentially means that /etc
19 is empty, see systemd.unit(5) for details.
20
21 The following settings may be set up:
22
23 · The system locale, more specifically the two locale variables LANG=
24 and LC_MESSAGES
25
26 · The system keyboard map
27
28 · The system time zone
29
30 · The system hostname
31
32 · The machine ID of the system
33
34 · The root user's password
35
36 Each of the fields may either be queried interactively by users, set
37 non-interactively on the tool's command line, or be copied from a host
38 system that is used to set up the system image.
39
40 If a setting is already initialized, it will not be overwritten and the
41 user will not be prompted for the setting.
42
43 Note that this tool operates directly on the file system and does not
44 involve any running system services, unlike localectl(1),
45 timedatectl(1) or hostnamectl(1). This allows systemd-firstboot to
46 operate on mounted but not booted disk images and in early boot. It is
47 not recommended to use systemd-firstboot on the running system while it
48 is up.
49
51 The following options are understood:
52
53 --root=root
54 Takes a directory path as an argument. All paths will be prefixed
55 with the given alternate root path, including config search paths.
56 This is useful to operate on a system image mounted to the
57 specified directory instead of the host system itself.
58
59 --image=path
60 Takes a path to a disk image file or block device node. If
61 specified all operations are applied to file system in the
62 indicated disk image. This is similar to --root= but operates on
63 file systems stored in disk images or block devices. The disk image
64 should either contain just a file system or a set of file systems
65 within a GPT partition table, following the Discoverable Partitions
66 Specification[1]. For further information on supported disk images,
67 see systemd-nspawn(1)'s switch of the same name.
68
69 --locale=LOCALE, --locale-messages=LOCALE
70 Sets the system locale, more specifically the LANG= and LC_MESSAGES
71 settings. The argument should be a valid locale identifier, such as
72 "de_DE.UTF-8". This controls the locale.conf(5) configuration file.
73
74 --keymap=KEYMAP
75 Sets the system keyboard layout. The argument should be a valid
76 keyboard map, such as "de-latin1". This controls the "KEYMAP" entry
77 in the vconsole.conf(5) configuration file.
78
79 --timezone=TIMEZONE
80 Sets the system time zone. The argument should be a valid time zone
81 identifier, such as "Europe/Berlin". This controls the localtime(5)
82 symlink.
83
84 --hostname=HOSTNAME
85 Sets the system hostname. The argument should be a hostname,
86 compatible with DNS. This controls the hostname(5) configuration
87 file.
88
89 --machine-id=ID
90 Sets the system's machine ID. This controls the machine-id(5) file.
91
92 --root-password=PASSWORD, --root-password-file=PATH,
93 --root-password-hashed=HASHED_PASSWORD
94 Sets the password of the system's root user. This creates/modifies
95 the passwd(5) and shadow(5) files. This setting exists in three
96 forms: --root-password= accepts the password to set directly on the
97 command line, --root-password-file= reads it from a file and
98 --root-password-hashed= accepts an already hashed password on the
99 command line. See shadow(5) for more information on the format of
100 the hashed password. Note that it is not recommended to specify
101 plaintext passwords on the command line, as other users might be
102 able to see them simply by invoking ps(1).
103
104 --root-shell=SHELL
105 Sets the shell of the system's root user. This creates/modifies the
106 passwd(5) file.
107
108 --kernel-command-line=CMDLINE
109 Sets the system's kernel command line. This controls the
110 /etc/kernel/cmdline file which is used by kernel-install(8).
111
112 --prompt-locale, --prompt-keymap, --prompt-timezone, --prompt-hostname,
113 --prompt-root-password, --prompt-root-shell
114 Prompt the user interactively for a specific basic setting. Note
115 that any explicit configuration settings specified on the command
116 line take precedence, and the user is not prompted for it.
117
118 --prompt
119 Query the user for locale, keymap, timezone, hostname and root
120 password. This is equivalent to specifying --prompt-locale,
121 --prompt-keymap, --prompt-timezone, --prompt-hostname,
122 --prompt-root-password, --prompt-root-shell in combination.
123
124 --copy-locale, --copy-keymap, --copy-timezone, --copy-root-password,
125 --copy-root-shell
126 Copy a specific basic setting from the host. This only works in
127 combination with --root= (see above).
128
129 --copy
130 Copy locale, keymap, time zone and root password from the host.
131 This is equivalent to specifying --copy-locale, --copy-keymap,
132 --copy-timezone, --copy-root-password, --copy-root-shell in
133 combination.
134
135 --setup-machine-id
136 Initialize the system's machine ID to a random ID. This only works
137 in combination with --root=.
138
139 --force
140 systemd-firstboot doesn't modify existing files unless --force is
141 specified. For modifications to /etc/passwd and /etc/shadow,
142 systemd-firstboot only modifies the entry of the "root" user
143 instead of overwriting the entire file.
144
145 --delete-root-password
146 Removes the password of the system's root user, enabling login as
147 root without a password unless the root account is locked. Note
148 that this is extremely insecure and hence this option should not be
149 used lightly.
150
151 --welcome=
152 Takes a boolean argument. By default when prompting the user for
153 configuration options a brief welcome text is shown before the
154 first question is asked. Pass false to this option to turn off the
155 welcome text.
156
157 -h, --help
158 Print a short help text and exit.
159
160 --version
161 Print a short version string and exit.
162
164 On success, 0 is returned, a non-zero failure code otherwise.
165
167 systemd.firstboot=
168 Takes a boolean argument, defaults to on. If off,
169 systemd-firstboot.service won't interactively query the user for
170 basic settings at first boot, even if those settings are not
171 initialized yet.
172
174 systemd(1), locale.conf(5), vconsole.conf(5), localtime(5),
175 hostname(5), machine-id(5), shadow(5), systemd-machine-id-setup(1),
176 localectl(1), timedatectl(1), hostnamectl(1)
177
179 1. Discoverable Partitions Specification
180 https://systemd.io/DISCOVERABLE_PARTITIONS
181
182
183
184systemd 246 SYSTEMD-FIRSTBOOT(1)