| 1 |
<?xml version='1.0'?> <!--*-nxml-*--> |
| 2 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
| 3 |
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> |
| 4 |
<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
| 5 |
|
| 6 |
<refentry id="systemd-sysinstall" conditional='ENABLE_SYSINSTALL' |
| 7 |
xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 8 |
|
| 9 |
<refentryinfo> |
| 10 |
<title>systemd-sysinstall</title> |
| 11 |
<productname>systemd</productname> |
| 12 |
</refentryinfo> |
| 13 |
|
| 14 |
<refmeta> |
| 15 |
<refentrytitle>systemd-sysinstall</refentrytitle> |
| 16 |
<manvolnum>8</manvolnum> |
| 17 |
</refmeta> |
| 18 |
|
| 19 |
<refnamediv> |
| 20 |
<refname>systemd-sysinstall</refname> |
| 21 |
<refname>systemd-sysinstall.service</refname> |
| 22 |
<refpurpose>Simple OS installer</refpurpose> |
| 23 |
</refnamediv> |
| 24 |
|
| 25 |
<refsynopsisdiv> |
| 26 |
<cmdsynopsis> |
| 27 |
<command>systemd-sysinstall</command> |
| 28 |
<arg choice="opt" rep="repeat">OPTIONS</arg> |
| 29 |
<arg choice="opt">BLOCKDEVICE</arg> |
| 30 |
</cmdsynopsis> |
| 31 |
|
| 32 |
<para><filename>systemd-sysinstall.service</filename></para> |
| 33 |
</refsynopsisdiv> |
| 34 |
|
| 35 |
<refsect1> |
| 36 |
<title>Description</title> |
| 37 |
|
| 38 |
<para><command>systemd-sysinstall</command> is a simple terminal and command line based operating system |
| 39 |
installer tool. Its primary use-case is to act as an automatically started interactive interface when |
| 40 |
booting from an installer medium (e.g. a USB stick), in order to install an OS onto a target |
| 41 |
disk. However, it may also be invoked directly from a shell. It executes the following steps:</para> |
| 42 |
|
| 43 |
<orderedlist> |
| 44 |
<listitem><para>It prompts the user for the target disk to install the OS on. (Unless the block device |
| 45 |
is already specified on the command line.)</para></listitem> |
| 46 |
|
| 47 |
<listitem><para>It validates whether the disk is suitable (i.e. large enough, and with enough |
| 48 |
free/unpartitioned space) for an OS installation. If it is generally suitable the user is prompted if they |
| 49 |
want to erase the disk before installation, or if the OS shall be added to the existing partitions on |
| 50 |
the disk (the latter only if enough free/unpartitioned disk space is available).</para></listitem> |
| 51 |
|
| 52 |
<listitem><para>It prompts the user whether to register the newly installed OS with the firmware boot option menu.</para></listitem> |
| 53 |
|
| 54 |
<listitem><para>It requests confirmation from the user, after showing a summary of the planned OS installation.</para></listitem> |
| 55 |
|
| 56 |
<listitem><para>It invokes |
| 57 |
<citerefentry><refentrytitle>systemd-creds</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s |
| 58 |
<command>encrypt</command> command in order to generate encrypted (TPM locked, if available) system |
| 59 |
credential files for a few, very basic system settings of the currently booted system (locale, keymap, |
| 60 |
timezone), which it will install on the target disk, parameterizing the invoked kernel. (Or in other |
| 61 |
words, it prepares that some settings already in effect on the installer system are propagated securely |
| 62 |
onto the new installation.)</para></listitem> |
| 63 |
|
| 64 |
<listitem><para>It invokes |
| 65 |
<citerefentry><refentrytitle>systemd-repart</refentrytitle><manvolnum>8</manvolnum></citerefentry> with |
| 66 |
a definitions directory of <filename>/usr/lib/repart.sysinstall.d/</filename> (only if populated – if |
| 67 |
not will use the default of <filename>/usr/lib/repart.d/</filename>). This is supposed to set up the |
| 68 |
basic OS partition structure on the target disk and copies in basic OS partitions (most importantly the |
| 69 |
<filename>/usr/</filename> hierarchy).</para></listitem> |
| 70 |
|
| 71 |
<listitem><para>It invokes |
| 72 |
<citerefentry><refentrytitle>bootctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s |
| 73 |
<command>link</command> command to install an OS kernel image onto the target disk's ESP/XBOOTLDR, |
| 74 |
together with the credential files prepared earlier.</para></listitem> |
| 75 |
|
| 76 |
<listitem><para>It invokes |
| 77 |
<citerefentry><refentrytitle>bootctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s |
| 78 |
<command>install</command> command to install the |
| 79 |
<citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry> boot |
| 80 |
loader onto the target disk's ESP.</para></listitem> |
| 81 |
|
| 82 |
<listitem><para>After confirmation, it reboots the system.</para></listitem> |
| 83 |
</orderedlist> |
| 84 |
|
| 85 |
<para>Note that the prompts/confirmation may be disabled via the command line, enabling fully automatic, |
| 86 |
non-interactive installation. See below.</para> |
| 87 |
|
| 88 |
<para>Note this tool does not interactively query the user for a user to create or a root password to be |
| 89 |
set on the target system, under the assumption these questions are better prompted from within the newly |
| 90 |
installed system's first boot process, for example via the |
| 91 |
<citerefentry><refentrytitle>systemd-firstboot</refentrytitle><manvolnum>1</manvolnum></citerefentry> or |
| 92 |
<filename>systemd-homed-firstboot.service</filename> components. Note that if required such settings |
| 93 |
may be propagated explicitly via the <option>--load-credential=</option> switch below.</para> |
| 94 |
</refsect1> |
| 95 |
|
| 96 |
<refsect1> |
| 97 |
<title>Options</title> |
| 98 |
|
| 99 |
<para>The following options are understood:</para> |
| 100 |
|
| 101 |
<variablelist> |
| 102 |
|
| 103 |
<varlistentry> |
| 104 |
<term><option>--definitions=</option></term> |
| 105 |
|
| 106 |
<listitem><para>Overrides the directory where <command>systemd-repart</command> shall read its |
| 107 |
partition definitions from, in place of the default of |
| 108 |
<filename>/usr/lib/repart.sysinstall.d/</filename>.</para> |
| 109 |
|
| 110 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 111 |
</varlistentry> |
| 112 |
|
| 113 |
<varlistentry> |
| 114 |
<term><option>--welcome=</option></term> |
| 115 |
|
| 116 |
<listitem><para>Takes a boolean argument. Controls whether to show the brief welcome text normally |
| 117 |
displayed at the beginning of the installation. Defaults to true.</para> |
| 118 |
|
| 119 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 120 |
</varlistentry> |
| 121 |
|
| 122 |
<varlistentry> |
| 123 |
<term><option>--chrome=</option></term> |
| 124 |
|
| 125 |
<listitem><para>Takes a boolean argument. Controls whether to show the colored bars at the top and |
| 126 |
bottom of the terminal interface. Defaults to true.</para> |
| 127 |
|
| 128 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 129 |
</varlistentry> |
| 130 |
|
| 131 |
<varlistentry> |
| 132 |
<term><option>--erase=</option></term> |
| 133 |
|
| 134 |
<listitem><para>Takes a boolean argument. Controls whether to erase the current contents of the |
| 135 |
target disk. If this switch is not used the user is prompted.</para> |
| 136 |
|
| 137 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 138 |
</varlistentry> |
| 139 |
|
| 140 |
<varlistentry> |
| 141 |
<term><option>--confirm=</option></term> |
| 142 |
|
| 143 |
<listitem><para>Takes a boolean argument. Controls whether to interactively query the user for |
| 144 |
confirmation before initiating the OS installation. Defaults to true.</para> |
| 145 |
|
| 146 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 147 |
</varlistentry> |
| 148 |
|
| 149 |
<varlistentry> |
| 150 |
<term><option>--reboot=</option></term> |
| 151 |
|
| 152 |
<listitem><para>Takes a boolean argument. Controls whether to reboot the system after completing the |
| 153 |
installation. Defaults to false.</para> |
| 154 |
|
| 155 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 156 |
</varlistentry> |
| 157 |
|
| 158 |
<varlistentry> |
| 159 |
<term><option>--variables=</option></term> |
| 160 |
|
| 161 |
<listitem><para>Takes a boolean argument. Controls whether to register the installed boot loader in |
| 162 |
the firmware's boot options database. If not specified the user will be prompted.</para> |
| 163 |
|
| 164 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 165 |
</varlistentry> |
| 166 |
|
| 167 |
<varlistentry> |
| 168 |
<term><option>--summary=</option></term> |
| 169 |
|
| 170 |
<listitem><para>Takes a boolean argument. Controls whether to show a summary of the choices made |
| 171 |
before asking for confirmation to proceed with the OS installation. Defaults to true.</para> |
| 172 |
|
| 173 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 174 |
</varlistentry> |
| 175 |
|
| 176 |
<varlistentry> |
| 177 |
<term><option>--kernel=</option></term> |
| 178 |
|
| 179 |
<listitem><para>Takes a path to a unified kernel image (UKI). Explicitly selects the kernel image to |
| 180 |
install on the target disk. If unspecified the currently booted kernel image is installed on the |
| 181 |
target disk.</para> |
| 182 |
|
| 183 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 184 |
</varlistentry> |
| 185 |
|
| 186 |
<varlistentry> |
| 187 |
<term><option>--set-credential=<replaceable>id</replaceable>:<replaceable>value</replaceable></option></term> |
| 188 |
|
| 189 |
<listitem><para>Accepts an additional system credential to encrypt (with a key generated on the local |
| 190 |
TPM, if available, and the null key otherwise) and place next to the installed kernel image in the |
| 191 |
ESP. This may be used to parameterize the installed kernel with arbitrary system credentials. Do not |
| 192 |
use this switch for sensitive data (such as passwords), use <option>--load-credential=</option> |
| 193 |
instead, see below. May be used multiple times to configure multiple credentials.</para> |
| 194 |
|
| 195 |
<para>Note that three system credentials are propagated in similar fashion to the target system: |
| 196 |
the locale, keymap and timezone. This may be controlled by the relevant |
| 197 |
<option>--copy-locale=</option>, <option>--copy-keymap=</option> and <option>--copy-timezone=</option> |
| 198 |
options below.</para> |
| 199 |
|
| 200 |
<para>See |
| 201 |
<citerefentry><refentrytitle>systemd.system-credentials</refentrytitle><manvolnum>7</manvolnum></citerefentry> |
| 202 |
for a list of well-known system credentials that may be propagated this way. (Note that you may pass |
| 203 |
arbitrary additional credentials this way, that can be consumed by any service of your |
| 204 |
choice, via the usual system credentials logic.)</para> |
| 205 |
|
| 206 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 207 |
</varlistentry> |
| 208 |
|
| 209 |
<varlistentry> |
| 210 |
<term><option>--load-credential=<replaceable>id</replaceable>:<replaceable>path</replaceable></option></term> |
| 211 |
|
| 212 |
<listitem><para>Similar to <option>--set-credential=</option> but reads the credential value from a |
| 213 |
file on disk or an <constant>AF_UNIX</constant> socket in the file system. This is generally |
| 214 |
preferable for sensitive data, such as passwords.</para> |
| 215 |
|
| 216 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 217 |
</varlistentry> |
| 218 |
|
| 219 |
<varlistentry> |
| 220 |
<term><option>--copy-locale=</option></term> |
| 221 |
<term><option>--copy-keymap=</option></term> |
| 222 |
<term><option>--copy-timezone=</option></term> |
| 223 |
|
| 224 |
<listitem><para>These options take boolean parameters. They control whether the indicated system |
| 225 |
settings shall be propagated from the currently running system into the new target OS |
| 226 |
installation. These options default to true.</para> |
| 227 |
|
| 228 |
<para>Typically, these three settings are the minimal settings that need to be configured during early |
| 229 |
boot of an installer medium in order to make the installer tool accessible to the user. The |
| 230 |
<citerefentry><refentrytitle>systemd-firstboot</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
| 231 |
tool may be used to query the user interactively when the OS install medium is booted for these |
| 232 |
properties. By propagating these settings to the target installation via system credentials they do |
| 233 |
not need to be queried again on first boot of the new installation.</para> |
| 234 |
|
| 235 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 236 |
</varlistentry> |
| 237 |
|
| 238 |
<varlistentry> |
| 239 |
<term><option>--mute-console=</option></term> |
| 240 |
|
| 241 |
<listitem><para>Takes a boolean argument. Controls whether to disable kernel and service manager log |
| 242 |
output to the console the installer is invoked on temporarily while running, in order to avoid |
| 243 |
interleaved output. Defaults to false.</para> |
| 244 |
|
| 245 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 246 |
</varlistentry> |
| 247 |
|
| 248 |
<xi:include href="standard-options.xml" xpointer="help" /> |
| 249 |
<xi:include href="standard-options.xml" xpointer="version" /> |
| 250 |
</variablelist> |
| 251 |
</refsect1> |
| 252 |
|
| 253 |
<refsect1> |
| 254 |
<title>Exit status</title> |
| 255 |
|
| 256 |
<para>On success, 0 is returned, and a non-zero failure code otherwise.</para> |
| 257 |
</refsect1> |
| 258 |
|
| 259 |
<refsect1> |
| 260 |
<title>Example</title> |
| 261 |
|
| 262 |
<example> |
| 263 |
<title>Invoke the tool for a fully automatic non-interactive OS installation</title> |
| 264 |
|
| 265 |
<programlisting>systemd-sysinstall \ |
| 266 |
/dev/disk/by-id/nvme-Micron_MTFDKBA1T0TFH_214532D0CDA5 \ |
| 267 |
--erase=yes \ |
| 268 |
--confirm=no \ |
| 269 |
--variables=yes \ |
| 270 |
--load-credential=ssh.authorized_keys.root:my-ssh-key |
| 271 |
</programlisting> |
| 272 |
|
| 273 |
<para>This installs the OS on the selected disk, erasing any previous contents, without confirmation, |
| 274 |
registers it in the firmware, and drops in the SSH key for the root user, read from the |
| 275 |
<filename>my-ssh-key</filename> file in the current directory.</para> |
| 276 |
</example> |
| 277 |
</refsect1> |
| 278 |
|
| 279 |
<refsect1> |
| 280 |
<title>See Also</title> |
| 281 |
<para><simplelist type="inline"> |
| 282 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 283 |
<member><citerefentry><refentrytitle>systemd-creds</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 284 |
<member><citerefentry><refentrytitle>systemd-repart</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 285 |
<member><citerefentry><refentrytitle>bootctl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 286 |
<member><citerefentry><refentrytitle>systemd-firstboot</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 287 |
<member><citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry></member> |
| 288 |
<member><citerefentry><refentrytitle>systemd.system-credentials</refentrytitle><manvolnum>7</manvolnum></citerefentry></member> |
| 289 |
</simplelist></para> |
| 290 |
</refsect1> |
| 291 |
|
| 292 |
</refentry> |