Skip to content

Commit aa5502b

Browse files
authored
Merge pull request systemd#16444 from oniko/luks-detached-header
Add support for detached LUKS header on kernel cmd line
2 parents af918c4 + 13445d9 commit aa5502b

File tree

3 files changed

+295
-73
lines changed

3 files changed

+295
-73
lines changed

man/crypttab.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,12 @@
112112
relevant for LUKS devices. See
113113
<citerefentry project='die-net'><refentrytitle>cryptsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry>
114114
for possible values and the default value of this
115-
option.</para></listitem>
115+
option.</para>
116+
117+
<para>Optionally, the path may be followed by <literal>:</literal> and an fstab device specification
118+
(e.g. starting with <literal>UUID=</literal> or similar); in which case, the path is relative to the
119+
device file system root. The device gets mounted automatically for LUKS device activation duration only.
120+
</para></listitem>
116121
</varlistentry>
117122

118123
<varlistentry>

man/systemd-cryptsetup-generator.xml

Lines changed: 67 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,27 +105,40 @@
105105
LUKS device given by the UUID appear under the provided
106106
name.</para>
107107

108+
<para>This parameter is the analogue of the first <citerefentry><refentrytitle>crypttab</refentrytitle>
109+
<manvolnum>5</manvolnum></citerefentry> field <replaceable>volume-name</replaceable>.</para>
110+
108111
<para><varname>rd.luks.name=</varname> is honored only by
109112
initial RAM disk (initrd) while <varname>luks.name=</varname>
110113
is honored by both the main system and the initrd.</para>
111114
</listitem>
112115
</varlistentry>
113116

114117
<varlistentry>
115-
<term><varname>luks.options=</varname></term>
116-
<term><varname>rd.luks.options=</varname></term>
118+
<term><varname>luks.data=</varname></term>
119+
<term><varname>rd.luks.data=</varname></term>
117120

118-
<listitem><para>Takes a LUKS super block UUID followed by an
119-
<literal>=</literal> and a string of options separated by
120-
commas as argument. This will override the options for the
121-
given UUID.</para>
122-
<para>If only a list of options, without an UUID, is
123-
specified, they apply to any UUIDs not specified elsewhere,
124-
and without an entry in
125-
<filename>/etc/crypttab</filename>.</para><para>
126-
<varname>rd.luks.options=</varname> is honored only by initial
127-
RAM disk (initrd) while <varname>luks.options=</varname> is
128-
honored by both the main system and the initrd.</para>
121+
<listitem><para>Takes a LUKS super block UUID followed by a <literal>=</literal> and a block device
122+
specification for device hosting encrypted data.</para>
123+
124+
<para>For those entries specified with <varname>rd.luks.uuid=</varname> or
125+
<varname>luks.uuid=</varname>, the data device will be set to the one specified by
126+
<varname>rd.luks.data=</varname> or <varname>luks.data=</varname> of the corresponding UUID.</para>
127+
128+
<para>LUKS data device parameter is usefull for specifying encrypted data devices with detached headers specified in
129+
<varname>luks.options</varname> entry containing <literal>header=</literal> argument. For example,
130+
<varname>rd.luks.uuid=</varname>b40f1abf-2a53-400a-889a-2eccc27eaa40
131+
<varname>rd.luks.options=</varname>b40f1abf-2a53-400a-889a-2eccc27eaa40=header=/path/to/luks.hdr
132+
<varname>rd.luks.data=</varname>b40f1abf-2a53-400a-889a-2eccc27eaa40=/dev/sdx.
133+
Hence, in this case, we will attempt to unlock LUKS device assembled from data device <literal>/dev/sdx</literal>
134+
and LUKS header (metadata) put in <literal>/path/to/luks.hdr</literal> file. This syntax is for now
135+
only supported on a per-device basis, i.e. you have to specify LUKS device UUID.</para>
136+
137+
<para>This parameter is the analogue of the second <citerefentry><refentrytitle>crypttab</refentrytitle>
138+
<manvolnum>5</manvolnum></citerefentry> field <replaceable>encrypted-device</replaceable>.</para>
139+
140+
<para><varname>rd.luks.data=</varname> is honored only by initial RAM disk (initrd) while
141+
<varname>luks.data=</varname> is honored by both the main system and the initrd.</para>
129142
</listitem>
130143
</varlistentry>
131144

@@ -157,6 +170,9 @@
157170
This syntax is for now only supported on a per-device basis,
158171
i.e. you have to specify LUKS device UUID.</para>
159172

173+
<para>This parameter is the analogue of the third <citerefentry><refentrytitle>crypttab</refentrytitle>
174+
<manvolnum>5</manvolnum></citerefentry> field <replaceable>key-file</replaceable>.</para>
175+
160176
<para><varname>rd.luks.key=</varname>
161177
is honored only by initial RAM disk
162178
(initrd) while
@@ -165,6 +181,44 @@
165181
the initrd.</para>
166182
</listitem>
167183
</varlistentry>
184+
185+
<varlistentry>
186+
<term><varname>luks.options=</varname></term>
187+
<term><varname>rd.luks.options=</varname></term>
188+
189+
<listitem><para>Takes a LUKS super block UUID followed by an
190+
<literal>=</literal> and a string of options separated by
191+
commas as argument. This will override the options for the
192+
given UUID.</para>
193+
<para>If only a list of options, without an UUID, is
194+
specified, they apply to any UUIDs not specified elsewhere,
195+
and without an entry in
196+
<filename>/etc/crypttab</filename>.</para>
197+
198+
<para>This parameter is the analogue of the fourth <citerefentry><refentrytitle>crypttab</refentrytitle>
199+
<manvolnum>5</manvolnum></citerefentry> field <replaceable>options</replaceable>.</para>
200+
201+
<para>It is possible to specify an external device which
202+
should be mounted before we attempt to unlock the LUKS device.
203+
systemd-cryptsetup will assemble LUKS device by combining
204+
data device specified in <varname>luks.data</varname> with
205+
detached LUKS header found in <literal>header=</literal>
206+
argument. For example,
207+
<varname>rd.luks.uuid=</varname>b40f1abf-2a53-400a-889a-2eccc27eaa40
208+
<varname>rd.luks.options=</varname>b40f1abf-2a53-400a-889a-2eccc27eaa40=header=/luks.hdr:LABEL=hdrdev
209+
<varname>rd.luks.data=</varname>b40f1abf-2a53-400a-889a-2eccc27eaa40=/dev/sdx.
210+
Hence, in this case, we will attempt to mount file system
211+
residing on the block device with label <literal>hdrdev</literal>, and look
212+
for <literal>luks.hdr</literal> on that file system. Said header will be used
213+
to unlock (decrypt) encrypted data stored on /dev/sdx.
214+
This syntax is for now only supported on a per-device basis,
215+
i.e. you have to specify LUKS device UUID.</para>
216+
217+
<para><varname>rd.luks.options=</varname> is honored only by initial
218+
RAM disk (initrd) while <varname>luks.options=</varname> is
219+
honored by both the main system and the initrd.</para>
220+
</listitem>
221+
</varlistentry>
168222
</variablelist>
169223
</refsect1>
170224

0 commit comments

Comments
 (0)