]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ukify: add basic .profile support
authorLennart Poettering <lennart@poettering.net>
Tue, 2 Jul 2024 07:38:53 +0000 (09:38 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 6 Sep 2024 14:12:03 +0000 (16:12 +0200)
This just allows including .profile sections, but doesn't try to be
smart about it. This alone won't help you much to create valid
multi-profile UKIs.

man/ukify.xml
src/ukify/ukify.py

index bfe54a8f27647429138a1c18b70bd35e50f052e7..1c52c9414b3656eacdb09765b17181ae4c80bd16 100644 (file)
           <xi:include href="version-info.xml" xpointer="v253"/></listitem>
         </varlistentry>
 
+        <varlistentry>
+          <term><varname>Profile=<replaceable>PATH</replaceable></varname></term>
+          <term><option>--profile=<replaceable>PATH</replaceable></option></term>
+
+          <listitem><para>A path to a UKI profile to place in an <literal>.profile</literal> section. This
+          option is useful for creating multi-profile UKIs, and is typically used in combination with
+          <option>--extend=</option>, to extend the specified UKI with an additional profile.</para>
+
+          <xi:include href="version-info.xml" xpointer="v257"/></listitem>
+        </varlistentry>
+
         <varlistentry>
           <term><varname>PCRBanks=<replaceable>PATH</replaceable></varname></term>
           <term><option>--pcr-banks=<replaceable>PATH</replaceable></option></term>
index 3478ff5689886ea50b04594fcefaa6a16df0c3e9..c8b6ce401bbd131cd684786f0fddb8256ffbb101 100755 (executable)
@@ -313,6 +313,7 @@ DEFAULT_SECTIONS_TO_SHOW = {
         '.pcrsig'   : 'text',
         '.sbat'     : 'text',
         '.sbom'     : 'binary',
+        '.profile'  : 'text',
 }
 
 @dataclasses.dataclass
@@ -849,6 +850,7 @@ def make_uki(opts):
 
     sections = [
         # name,      content,         measure?
+        ('.profile', opts.profile,    True ),
         ('.osrel',   opts.os_release, True ),
         ('.cmdline', opts.cmdline,    True ),
         ('.dtb',     opts.devicetree, True ),
@@ -1359,6 +1361,13 @@ CONFIG_ITEMS = [
         help = 'section as name and contents [NAME section] or section to print',
     ),
 
+    ConfigItem(
+        '--profile',
+        metavar='TEST|@PATH',
+        help='Profile information [.profile section]',
+        config_key = 'UKI/Uname',
+    ),
+
     ConfigItem(
         '--efi-arch',
         metavar = 'ARCH',