]>
Commit | Line | Data |
---|---|---|
08b04ec7 GP |
1 | <?xml version="1.0"?> |
2 | <!--*-nxml-*--> | |
3 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" | |
eea10b26 | 4 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> |
08b04ec7 GP |
5 | <!-- |
6 | SPDX-License-Identifier: LGPL-2.1-or-later | |
7 | ||
8 | This is based on crypttab(5). | |
9 | ||
10 | --> | |
11 | <refentry id="veritytab" conditional='HAVE_LIBCRYPTSETUP' xmlns:xi="http://www.w3.org/2001/XInclude"> | |
12 | ||
13 | <refentryinfo> | |
14 | <title>veritytab</title> | |
15 | <productname>systemd</productname> | |
16 | </refentryinfo> | |
17 | ||
18 | <refmeta> | |
19 | <refentrytitle>veritytab</refentrytitle> | |
20 | <manvolnum>5</manvolnum> | |
21 | </refmeta> | |
22 | ||
23 | <refnamediv> | |
24 | <refname>veritytab</refname> | |
25 | <refpurpose>Configuration for verity block devices</refpurpose> | |
26 | </refnamediv> | |
27 | ||
28 | <refsynopsisdiv> | |
29 | <para><filename>/etc/veritytab</filename></para> | |
30 | </refsynopsisdiv> | |
31 | ||
32 | <refsect1> | |
33 | <title>Description</title> | |
34 | ||
35 | <para>The <filename>/etc/veritytab</filename> file describes | |
9a2a6ec4 | 36 | verity protected block devices that are set up during |
08b04ec7 GP |
37 | system boot.</para> |
38 | ||
39 | <para>Empty lines and lines starting with the <literal>#</literal> | |
40 | character are ignored. Each of the remaining lines describes one | |
9a2a6ec4 | 41 | verity protected block device. Fields are delimited by |
08b04ec7 GP |
42 | white space.</para> |
43 | ||
ee5bf48f | 44 | <para>Each line is in the form<programlisting><replaceable>volume-name</replaceable> <replaceable>data-device</replaceable> <replaceable>hash-device</replaceable> <replaceable>roothash</replaceable> <optional><replaceable>options</replaceable></optional></programlisting> |
08b04ec7 GP |
45 | The first four fields are mandatory, the remaining one is optional.</para> |
46 | ||
47 | <para>The first field contains the name of the resulting verity volume; its block device is set up | |
48 | below <filename>/dev/mapper/</filename>.</para> | |
49 | ||
50 | <para>The second field contains a path to the underlying block data device, or a specification of a block device via | |
ee5bf48f | 51 | <varname>UUID=</varname> followed by the <replaceable>UUID</replaceable>.</para> |
08b04ec7 GP |
52 | |
53 | <para>The third field contains a path to the underlying block hash device, or a specification of a block device via | |
ee5bf48f | 54 | <varname>UUID=</varname> followed by the <replaceable>UUID</replaceable>.</para> |
08b04ec7 | 55 | |
28ed1ba9 | 56 | <para>The fourth field is the <replaceable>roothash</replaceable> in hexadecimal.</para> |
08b04ec7 GP |
57 | |
58 | <para>The fifth field, if present, is a comma-delimited list of options. The following options are | |
59 | recognized:</para> | |
60 | ||
61 | <variablelist class='fstab-options'> | |
62 | ||
0bbf7a84 GP |
63 | <varlistentry> |
64 | <term><option>superblock=<replaceable>BOOL</replaceable></option></term> | |
65 | ||
ec07c3c8 AK |
66 | <listitem><para>Use dm-verity with or without permanent on-disk superblock.</para> |
67 | ||
68 | <xi:include href="version-info.xml" xpointer="v254"/></listitem> | |
0bbf7a84 GP |
69 | </varlistentry> |
70 | ||
71 | <varlistentry> | |
72 | <term><option>format=<replaceable>NUMBER</replaceable></option></term> | |
73 | ||
ee5bf48f | 74 | <listitem><para>Specifies the hash version type. Format type <literal>0</literal> is original Chrome OS version. Format type <literal>1</literal> is |
ec07c3c8 AK |
75 | modern version.</para> |
76 | ||
77 | <xi:include href="version-info.xml" xpointer="v254"/></listitem> | |
0bbf7a84 GP |
78 | </varlistentry> |
79 | ||
80 | <varlistentry> | |
81 | <term><option>data-block-size=<replaceable>BYTES</replaceable></option></term> | |
82 | ||
83 | <listitem><para>Used block size for the data device. (Note kernel supports only page-size as maximum | |
ec07c3c8 AK |
84 | here; Multiples of 512 bytes.) </para> |
85 | ||
86 | <xi:include href="version-info.xml" xpointer="v254"/></listitem> | |
0bbf7a84 GP |
87 | </varlistentry> |
88 | ||
89 | <varlistentry> | |
90 | <term><option>hash-block-size=<replaceable>BYTES</replaceable></option></term> | |
91 | ||
92 | <listitem><para>Used block size for the hash device. (Note kernel supports only page-size as maximum | |
ec07c3c8 AK |
93 | here; Multiples of 512 bytes.)</para> |
94 | ||
95 | <xi:include href="version-info.xml" xpointer="v254"/></listitem> | |
0bbf7a84 GP |
96 | </varlistentry> |
97 | ||
98 | <varlistentry> | |
99 | <term><option>data-blocks=<replaceable>BLOCKS</replaceable></option></term> | |
100 | ||
101 | <listitem><para>Number of blocks of data device used in verification. If not specified, the whole device is | |
ec07c3c8 AK |
102 | used.</para> |
103 | ||
104 | <xi:include href="version-info.xml" xpointer="v254"/></listitem> | |
0bbf7a84 GP |
105 | </varlistentry> |
106 | ||
14de7ef9 GP |
107 | <varlistentry> |
108 | <term><option>hash-offset=<replaceable>BYTES</replaceable></option></term> | |
109 | ||
110 | <listitem><para>Offset of hash area/superblock on <literal>hash-device</literal>. (Multiples of 512 bytes.) | |
ec07c3c8 AK |
111 | </para> |
112 | ||
113 | <xi:include href="version-info.xml" xpointer="v254"/></listitem> | |
14de7ef9 GP |
114 | </varlistentry> |
115 | ||
0bbf7a84 GP |
116 | <varlistentry> |
117 | <term><option>salt=<replaceable>HEX</replaceable></option></term> | |
118 | ||
119 | <listitem><para>Salt used for format or verification. Format is a hexadecimal string; 256 bytes long maximum; | |
f37841c0 | 120 | <literal>-</literal> is the special value for empty.</para> |
ec07c3c8 AK |
121 | |
122 | <xi:include href="version-info.xml" xpointer="v254"/></listitem> | |
0bbf7a84 GP |
123 | </varlistentry> |
124 | ||
125 | <varlistentry> | |
126 | <term><option>uuid=<replaceable>UUID</replaceable></option></term> | |
127 | ||
ee5bf48f DT |
128 | <listitem><para>Use the provided <replaceable>UUID</replaceable> for format command instead of generating new one. The <replaceable>UUID</replaceable> must be |
129 | provided in standard <acronym>UUID</acronym> format, e.g. <literal>12345678-1234-1234-1234-123456789abc</literal>.</para> | |
ec07c3c8 AK |
130 | |
131 | <xi:include href="version-info.xml" xpointer="v254"/></listitem> | |
0bbf7a84 GP |
132 | </varlistentry> |
133 | ||
08b04ec7 GP |
134 | <varlistentry> |
135 | <term><option>ignore-corruption</option></term> | |
136 | <term><option>restart-on-corruption</option></term> | |
137 | <term><option>panic-on-corruption</option></term> | |
138 | ||
9a2a6ec4 | 139 | <listitem><para>Defines what to do if a data verity problem is detected (data corruption). Without these |
ee5bf48f | 140 | options kernel fails the <acronym>IO</acronym> operation with <acronym>I/O</acronym> error. With <option>--ignore-corruption</option> option the |
28ed1ba9 DT |
141 | corruption is only logged. With <option>--restart-on-corruption</option> or |
142 | <option>--panic-on-corruption</option> the kernel is restarted (panicked) immediately. | |
08b04ec7 | 143 | |
ec07c3c8 AK |
144 | (You have to provide way how to avoid restart loops.)</para> |
145 | ||
146 | <xi:include href="version-info.xml" xpointer="v248"/></listitem> | |
08b04ec7 GP |
147 | </varlistentry> |
148 | ||
149 | <varlistentry> | |
150 | <term><option>ignore-zero-blocks</option></term> | |
151 | ||
152 | <listitem><para>Instruct kernel to not verify blocks that are expected to contain zeroes and always directly | |
617b85d1 | 153 | return zeroes instead.</para> |
08b04ec7 | 154 | |
617b85d1 DT |
155 | <warning> |
156 | <para>Use this option only in very specific cases. This option is available since Linux kernel version 4.5.</para> | |
157 | </warning> | |
ec07c3c8 AK |
158 | |
159 | <xi:include href="version-info.xml" xpointer="v248"/></listitem> | |
08b04ec7 GP |
160 | </varlistentry> |
161 | ||
162 | <varlistentry> | |
163 | <term><option>check-at-most-once</option></term> | |
164 | ||
165 | <listitem><para>Instruct kernel to verify blocks only the first time they are read from the data device, rather | |
617b85d1 | 166 | than every time.</para> |
08b04ec7 | 167 | |
617b85d1 DT |
168 | <warning> |
169 | <para>It provides a reduced level of security because only offline tampering of the data device's content | |
170 | will be detected, not online tampering. This option is available since Linux kernel version 4.17.</para> | |
171 | </warning> | |
ec07c3c8 AK |
172 | |
173 | <xi:include href="version-info.xml" xpointer="v248"/></listitem> | |
08b04ec7 GP |
174 | </varlistentry> |
175 | ||
0bbf7a84 GP |
176 | <varlistentry> |
177 | <term><option>hash=<replaceable>HASH</replaceable></option></term> | |
178 | ||
179 | <listitem><para>Hash algorithm for dm-verity. This should be the name of the algorithm, like "sha1". For default | |
ec07c3c8 AK |
180 | see <command>veritysetup --help</command>.</para> |
181 | ||
182 | <xi:include href="version-info.xml" xpointer="v254"/></listitem> | |
0bbf7a84 GP |
183 | </varlistentry> |
184 | ||
21c60c76 GP |
185 | <varlistentry> |
186 | <term><option>fec-device=<replaceable>PATH</replaceable></option></term> | |
187 | ||
ee5bf48f | 188 | <listitem><para>Use forward error correction (<acronym>FEC</acronym>) to recover from corruption if hash verification fails. Use |
21c60c76 GP |
189 | encoding data from the specified device. The fec device argument can be block device or file image. For format, |
190 | if fec device path doesn't exist, it will be created as file. Note: block sizes for data and hash devices must | |
ec07c3c8 AK |
191 | match. Also, if the verity data_device is encrypted the fec_device should be too.</para> |
192 | ||
193 | <xi:include href="version-info.xml" xpointer="v254"/></listitem> | |
21c60c76 GP |
194 | </varlistentry> |
195 | ||
196 | <varlistentry> | |
197 | <term><option>fec-offset=<replaceable>BYTES</replaceable></option></term> | |
198 | ||
ee5bf48f | 199 | <listitem><para>This is the offset, in bytes, from the start of the <acronym>FEC</acronym> device to the beginning of the encoding |
ec07c3c8 AK |
200 | data. (Aligned on 512 bytes.)</para> |
201 | ||
202 | <xi:include href="version-info.xml" xpointer="v254"/></listitem> | |
21c60c76 GP |
203 | </varlistentry> |
204 | ||
205 | <varlistentry> | |
206 | <term><option>fec-roots=<replaceable>NUM</replaceable></option></term> | |
207 | ||
208 | <listitem><para>Number of generator roots. This equals to the number of parity bytes in the encoding data. In | |
209 | RS(M, N) encoding, the number of roots is M-N. M is 255 and M-N is between 2 and 24 (including).</para> | |
ec07c3c8 AK |
210 | |
211 | <xi:include href="version-info.xml" xpointer="v254"/> | |
21c60c76 GP |
212 | </listitem> |
213 | </varlistentry> | |
214 | ||
08b04ec7 | 215 | <varlistentry> |
e502940b | 216 | <term><option>root-hash-signature=<replaceable>PATH</replaceable>|base64:<replaceable>HEX</replaceable></option></term> |
08b04ec7 GP |
217 | |
218 | <listitem><para>A base64 string encoding the root hash signature prefixed by <literal>base64:</literal> or a | |
219 | path to roothash signature file used to verify the root hash (in kernel). This feature requires Linux kernel | |
ec07c3c8 AK |
220 | version 5.4 or more recent.</para> |
221 | ||
aefdc112 | 222 | <xi:include href="version-info.xml" xpointer="v248"/></listitem> |
08b04ec7 GP |
223 | </varlistentry> |
224 | ||
225 | <varlistentry> | |
226 | <term><option>_netdev</option></term> | |
227 | ||
228 | <listitem><para>Marks this veritysetup device as requiring network. It will be | |
229 | started after the network is available, similarly to | |
230 | <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
231 | units marked with <option>_netdev</option>. The service unit to set up this device | |
232 | will be ordered between <filename>remote-fs-pre.target</filename> and | |
233 | <filename>remote-veritysetup.target</filename>, instead of | |
234 | <filename>veritysetup-pre.target</filename> and | |
235 | <filename>veritysetup.target</filename>.</para> | |
236 | ||
237 | <para>Hint: if this device is used for a mount point that is specified in | |
238 | <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
239 | the <option>_netdev</option> option should also be used for the mount | |
240 | point. Otherwise, a dependency loop might be created where the mount point | |
241 | will be pulled in by <filename>local-fs.target</filename>, while the | |
242 | service to configure the network is usually only started <emphasis>after</emphasis> | |
243 | the local file system has been mounted.</para> | |
ec07c3c8 AK |
244 | |
245 | <xi:include href="version-info.xml" xpointer="v248"/> | |
08b04ec7 GP |
246 | </listitem> |
247 | </varlistentry> | |
248 | ||
249 | <varlistentry> | |
250 | <term><option>noauto</option></term> | |
251 | ||
252 | <listitem><para>This device will not be added to <filename>veritysetup.target</filename>. | |
253 | This means that it will not be automatically enabled on boot, unless something else pulls | |
254 | it in. In particular, if the device is used for a mount point, it'll be enabled | |
255 | automatically during boot, unless the mount point itself is also disabled with | |
ec07c3c8 AK |
256 | <option>noauto</option>.</para> |
257 | ||
258 | <xi:include href="version-info.xml" xpointer="v248"/></listitem> | |
08b04ec7 GP |
259 | </varlistentry> |
260 | ||
261 | <varlistentry> | |
262 | <term><option>nofail</option></term> | |
263 | ||
264 | <listitem><para>This device will not be a hard dependency of | |
265 | <filename>veritysetup.target</filename>. It'll still be pulled in and started, but the system | |
266 | will not wait for the device to show up and be enabled, and boot will not fail if this is | |
267 | unsuccessful. Note that other units that depend on the enabled device may still fail. In | |
268 | particular, if the device is used for a mount point, the mount point itself also needs to | |
269 | have the <option>nofail</option> option, or the boot will fail if the device is not enabled | |
ec07c3c8 AK |
270 | successfully.</para> |
271 | ||
272 | <xi:include href="version-info.xml" xpointer="v248"/></listitem> | |
08b04ec7 GP |
273 | </varlistentry> |
274 | ||
275 | <varlistentry> | |
276 | <term><option>x-initrd.attach</option></term> | |
277 | ||
32e27670 | 278 | <listitem><para>Setup this verity protected block device in the initrd, similarly to |
08b04ec7 GP |
279 | <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
280 | units marked with <option>x-initrd.mount</option>.</para> | |
281 | ||
282 | <para>Although it's not necessary to mark the mount entry for the root file system with | |
283 | <option>x-initrd.mount</option>, <option>x-initrd.attach</option> is still recommended with | |
9a2a6ec4 | 284 | the verity protected block device containing the root file system as otherwise systemd |
08b04ec7 GP |
285 | will attempt to detach the device during the regular system shutdown while it's still in |
286 | use. With this option the device will still be detached but later after the root file | |
287 | system is unmounted.</para> | |
288 | ||
32e27670 LP |
289 | <para>All other verity protected block devices that contain file systems mounted in the initrd should |
290 | use this option.</para> | |
ec07c3c8 AK |
291 | |
292 | <xi:include href="version-info.xml" xpointer="v248"/> | |
08b04ec7 GP |
293 | </listitem> |
294 | </varlistentry> | |
295 | ||
296 | </variablelist> | |
297 | ||
298 | <para>At early boot and when the system manager configuration is | |
299 | reloaded, this file is translated into native systemd units by | |
300 | <citerefentry><refentrytitle>systemd-veritysetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para> | |
301 | </refsect1> | |
302 | ||
303 | <refsect1> | |
304 | <title>Examples</title> | |
305 | <example> | |
306 | <title>/etc/veritytab example</title> | |
9a2a6ec4 | 307 | <para>Set up two verity protected block devices. One using device blocks, another using files.</para> |
08b04ec7 GP |
308 | |
309 | <programlisting>usr PARTUUID=783e45ae-7aa3-484a-beef-a80ff9c19cbb PARTUUID=21dc1dfe-4c33-8b48-98a9-918a22eb3e37 36e3f740ad502e2c25e2a23d9c7c17bf0fdad2300b7580842d4b7ec1fb0fa263 auto | |
310 | data /etc/data /etc/hash a5ee4b42f70ae1f46a08a7c92c2e0a20672ad2f514792730f5d49d7606ab8fdf auto | |
311 | </programlisting> | |
312 | </example> | |
313 | </refsect1> | |
314 | ||
315 | <refsect1> | |
316 | <title>See Also</title> | |
13a69c12 DT |
317 | <para><simplelist type="inline"> |
318 | <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> | |
319 | <member><citerefentry><refentrytitle>systemd-veritysetup@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> | |
320 | <member><citerefentry><refentrytitle>systemd-veritysetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> | |
321 | <member><citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> | |
322 | <member><citerefentry project='die-net'><refentrytitle>veritysetup</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> | |
323 | </simplelist></para> | |
08b04ec7 GP |
324 | </refsect1> |
325 | ||
326 | </refentry> |