Debian Codegraph @

man/systemd-factory-reset.xml

raw
1 <?xml version="1.0"?>
2 <!--*-nxml-*-->
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
4 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
5 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id="systemd-factory-reset"
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8
9 <refentryinfo>
10 <title>systemd-factory-reset</title>
11 <productname>systemd</productname>
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>systemd-factory-reset</refentrytitle>
16 <manvolnum>8</manvolnum>
17 </refmeta>
18
19 <refnamediv>
20 <refname>systemd-factory-reset</refname>
21 <refname>systemd-factory-reset-request.service</refname>
22 <refname>systemd-factory-reset-complete.service</refname>
23 <refname>systemd-factory-reset.socket</refname>
24 <refname>[email protected]</refname>
25 <refpurpose>Request or complete a factory reset operation, or query current factory reset mode</refpurpose>
26 </refnamediv>
27
28 <refsynopsisdiv>
29 <para><filename>/usr/lib/systemd/systemd-factory-reset</filename></para>
30 <para><filename>systemd-factory-reset-request.service</filename></para>
31 <para><filename>systemd-factory-reset-complete.service</filename></para>
32 <para><filename>systemd-factory-reset.socket</filename></para>
33 <para><filename>[email protected]</filename></para>
34 </refsynopsisdiv>
35
36 <refsect1>
37 <title>Description</title>
38
39 <para><filename>systemd-factory-reset</filename> is a tool that can query the current factory reset
40 state, request factory request operations or complete them.</para>
41
42 <para>Some of the functionality is also available via the
43 <filename>/run/systemd/io.systemd.FactoryReset</filename> Varlink service (implemented via the
44 <filename>systemd-factory-reset.socket</filename>/<filename>[email protected]</filename>
45 units).</para>
46
47 <para>See <ulink url="https://systemd.io/FACTORY_RESET">Factory Reset</ulink> for an overview of the
48 factory reset logic.</para>
49 </refsect1>
50
51 <refsect1>
52 <title>Commands</title>
53
54 <para>The <filename>/usr/lib/systemd/systemd-factory-reset</filename> executable may also be invoked from the
55 command line, taking one of the following command arguments:</para>
56
57 <variablelist>
58 <varlistentry>
59 <term><option>status</option></term>
60
61 <listitem><para>Report current factory reset state. Reports one of <literal>unsupported</literal> (if
62 the OS does not support a factory reset logic), <literal>unspecified</literal> (if no factory reset
63 was requested, but it wasn't turned off explicitly either), <literal>off</literal> (if the factory
64 reset logic was explicitly turned off via the kernel command line option), <literal>on</literal> (if
65 the factory reset is currently enabled and executed), <literal>complete</literal> (if the factory
66 reset logic ran during the current boot but is complete now), <literal>pending</literal> (if a
67 factory reset has been requested for the next boot).</para>
68
69 <para>Returns with an exit status of 0 if the factory reset mechanism is currently not in effect, 10
70 if a factory reset is currently being executed, or 11 if it is pending for the next boot.</para>
71
72 <xi:include href="version-info.xml" xpointer="v258"/></listitem>
73 </varlistentry>
74
75 <varlistentry>
76 <term><option>request</option></term>
77
78 <listitem><para>Request a factory reset operation to be executed on next boot.</para>
79
80 <para>Note that this is a relatively low-level operation. The primary interface for requesting a
81 factory reset operation is by starting the <filename>factory-reset.target</filename>
82 unit.</para>
83
84 <para>This sets the <varname>FactoryResetRequest</varname> EFI variable, see below.</para>
85
86 <para>This operation is executed when the <filename>systemd-factory-reset-request.service</filename>
87 unit is started (which is typically one of the services hooked into
88 and ordered before <filename>factory-reset.target</filename>).</para>
89
90 <xi:include href="version-info.xml" xpointer="v258"/></listitem>
91 </varlistentry>
92
93 <varlistentry>
94 <term><option>cancel</option></term>
95
96 <listitem><para>Cancel any previously requested (but not yet executed) factory reset
97 operation.</para>
98
99 <xi:include href="version-info.xml" xpointer="v258"/></listitem>
100 </varlistentry>
101
102 <varlistentry>
103 <term><option>complete</option></term>
104
105 <listitem><para>Mark an ongoing factory reset operation as complete.</para>
106
107 <para>This operation is executed when the <filename>systemd-factory-reset-complete.service</filename>
108 unit is started (which is typically one of the services hooked into and ordered after
109 <filename>factory-reset-now.target</filename>).</para>
110
111 <xi:include href="version-info.xml" xpointer="v258"/></listitem>
112 </varlistentry>
113 </variablelist>
114 </refsect1>
115
116 <refsect1>
117 <title>Options</title>
118
119 <para>The following options are understood:</para>
120
121 <variablelist>
122 <varlistentry>
123 <term><option>--retrigger</option></term>
124
125 <listitem><para>When used with the <command>complete</command> command retriggers all block devices,
126 which might result in auto-discovered devices being usable that previously weren't because the factory
127 reset logic was in place.</para>
128
129 <xi:include href="version-info.xml" xpointer="v258"/></listitem>
130 </varlistentry>
131
132 <varlistentry>
133 <term><option>--quiet</option></term>
134 <term><option>-q</option></term>
135
136 <listitem><para>Suppresses the state output of <command>status</command>, but still sets the exit
137 status as documented.</para>
138
139 <xi:include href="version-info.xml" xpointer="v258"/></listitem>
140 </varlistentry>
141
142 <xi:include href="standard-options.xml" xpointer="help" />
143 <xi:include href="standard-options.xml" xpointer="version" />
144 </variablelist>
145 </refsect1>
146
147 <refsect1>
148 <title>EFI Variables</title>
149
150 <para>The following EFI variable is set and read by <command>systemd-factory-reset</command>, under the
151 vendor UUID <literal>8cf2644b-4b0b-428f-9387-6d876050dc67</literal>, for communication between this boot
152 and the next.</para>
153
154 <variablelist class='efi-variables'>
155 <varlistentry>
156 <term><varname>FactoryResetRequest</varname></term>
157
158 <listitem><para>Set whenever a factory reset is requested from the next boot, deleted once the
159 factory reset is complete. Contains JSON data describing the requesting OS, in order to avoid
160 confusion in multi-boot systems.</para>
161
162 <xi:include href="version-info.xml" xpointer="v258"/></listitem>
163 </varlistentry>
164 </variablelist>
165 </refsect1>
166
167 <refsect1>
168 <title>See Also</title>
169 <para><simplelist type="inline">
170 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
171 <member><citerefentry><refentrytitle>systemd-factory-reset-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
172 <member><citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
173 <member><ulink url="https://systemd.io/FACTORY_RESET">Factory Reset</ulink></member>
174 </simplelist></para>
175 </refsect1>
176 </refentry>