diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-10-01 14:30:15 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-10-04 11:36:25 +0200 |
commit | 16020c3324215e0fc1bd8621d69dab33730bec77 (patch) | |
tree | 9a13d5713f0a29ffce8c91b3320a1b14698310c8 /man | |
parent | ukify: Fix Profile config setting (diff) | |
download | systemd-16020c3324215e0fc1bd8621d69dab33730bec77.tar.xz systemd-16020c3324215e0fc1bd8621d69dab33730bec77.zip |
ukify: Rework multi-profile UKIs
The API introduced in https://github.com/systemd/systemd/pull/34295
is less than ideal:
- It doesn't consider signing at all (ukify can't sign separately yet)
- Measurement is completely broken (all profile sections are marked to
not be measured)
- It focuses on a very niche use case of extending existing UKIs and makes
the more common use case of building a UKI with several profiles included
much harder than needed.
Let's instead rework the API to focus on the primary use case of building
a UKI with multiple profiles added to it immediately. We require the profiles
to be built upfront as separate PE binaries with UKI. There's no need to sign
or measure these, they're solely vehicles for profile sections. This saves us
from having to complicate the command line and config parsing to support defining
multiple profiles.
To add the profiles when building a UKI, we introduce the new --add-profile
switch which takes a path to a PE binary describing a profile. The required
sections are read from each PE binary, measured and added as a profile.
The integration test is disabled until the new API is merged and exposed in
mkosi so that building a UKI with profiles can be left to mkosi and the integration
test will only test the switching between profiles and not the building of UKIs
with profiles.
Diffstat (limited to 'man')
-rw-r--r-- | man/ukify.xml | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/man/ukify.xml b/man/ukify.xml index 35a2018120..c78a12ada0 100644 --- a/man/ukify.xml +++ b/man/ukify.xml @@ -229,6 +229,19 @@ </varlistentry> <varlistentry> + <term><option>--join-profile=<replaceable>PATH</replaceable></option></term> + + <listitem><para>Takes a path to an existing PE file containing an additional profile to add to the + unified kernel image. The profile can be generated beforehand with <command>ukify</command>. The + profile does not need to be signed or contain PCR measurements. All UKI PE sections of the + specified PE file are copied into the generated UKI. This is useful for generating multi-profile + UKIs. Note that this only copies PE sections that are defined by the UKI specification, and ignores + any other, for example <literal>.text</literal> or similar.</para> + + <xi:include href="version-info.xml" xpointer="v257"/></listitem> + </varlistentry> + + <varlistentry> <term><option>--tools=<replaceable>DIRS</replaceable></option></term> <listitem><para>Specify one or more directories with helper tools. <command>ukify</command> will @@ -703,6 +716,50 @@ Writing public key for PCR signing to /etc/systemd/tpm2-pcr-public-key-system.pe by default, so after this file has been created, installations of kernels that create a UKI on the local machine using <command>kernel-install</command> will perform signing using this config.</para> </example> + + <example> + <title>Multi-Profile UKI</title> + + <para>First, create a few profiles:</para> + + <programlisting>$ ukify build \ + --profile='TITLE=Base' \ + --output=profile0.efi + </programlisting> + + <para>Add a second profile (@1):</para> + + <programlisting>$ ukify build \ + --profile='TITLE=Boot into Storage Target Mode +ID=storagetm' \ + --cmdline='quiet rw rd.systemd.unit=stroage-target-mode.target' \ + --output=profile1.efi + </programlisting> + + <para>Add a third profile (@2):</para> + + <programlisting>$ ukify build \ + --profile='TITLE=Factory Reset +ID=factory-reset' \ + --cmdline='quiet rw systemd.unit=factory-reset.target' \ + --output=profile2.efi + </programlisting> + + <para>Then, create a UKI and include all the generated profiles:</para> + + <programlisting>$ ukify build \ + --linux=/lib/modules/6.0.9-300.fc37.x86_64/vmlinuz \ + --initrd=/some/path/initramfs-6.0.9-300.fc37.x86_64.img \ + --cmdline='quiet rw' \ + --join-profile=profile0.efi \ + --join-profile=profile1.efi \ + --join-profile=profile2.efi \ + --output=base.efi + </programlisting> + + <para>The resulting UKI <filename>base-with-profile-0-1-2.efi</filename> will now contain three profiles.</para> + </example> + </refsect1> <refsect1> |