]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ukify: Add support for .ucode UKI section 31872/head
authorTobias Fleig <tfleig@meta.com>
Tue, 2 Apr 2024 11:00:10 +0000 (04:00 -0700)
committerTobias Fleig <tfleig@meta.com>
Fri, 19 Apr 2024 13:28:47 +0000 (06:28 -0700)
This commit teaches ukify how to build a .ucode section into UKIs. This
section is functionally an initrd, intended for microcode updates.

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

index a81cbcb47b5df358bb1b0b2e8eb41fe7ac445c7d..a9034bc51114a5581fbb3102327a18522ff26bea 100644 (file)
@@ -67,6 +67,7 @@
 
       <para>Additional sections will be inserted into the UKI, either automatically or only if a specific
       option is provided. See the discussions of
+      <varname>Microcode=</varname>/<option>--microcode=</option>,
       <varname>Cmdline=</varname>/<option>--cmdline=</option>,
       <varname>OSRelease=</varname>/<option>--os-release=</option>,
       <varname>DeviceTree=</varname>/<option>--devicetree=</option>,
           <xi:include href="version-info.xml" xpointer="v254"/></listitem>
         </varlistentry>
 
+        <varlistentry>
+          <term><varname>Microcode=<replaceable>UCODE</replaceable></varname></term>
+          <term><option>--microcode=<replaceable>UCODE</replaceable></option></term>
+
+          <listitem><para>Path to initrd containing microcode updates. If not specified, the section
+          will not be present.</para>
+
+          <xi:include href="version-info.xml" xpointer="v256"/></listitem>
+        </varlistentry>
+
         <varlistentry>
           <term><varname>Cmdline=<replaceable>TEXT</replaceable>|<replaceable>@PATH</replaceable></varname></term>
           <term><option>--cmdline=<replaceable>TEXT</replaceable>|<replaceable>@PATH</replaceable></option></term>
index 686377200f4026a0ea72e5ec1cce4b87e9b41b5f..50d921b7a80e88151d79ae68e4ff90e82273c003 100755 (executable)
@@ -303,6 +303,7 @@ class Uname:
 DEFAULT_SECTIONS_TO_SHOW = {
         '.linux'    : 'binary',
         '.initrd'   : 'binary',
+        '.ucode'    : 'binary',
         '.splash'   : 'binary',
         '.dtb'      : 'binary',
         '.cmdline'  : 'text',
@@ -855,6 +856,7 @@ def make_uki(opts):
         ('.splash',  opts.splash,     True ),
         ('.pcrpkey', pcrpkey,         True ),
         ('.initrd',  initrd,          True ),
+        ('.ucode',   opts.microcode,  True ),
 
         # linux shall be last to leave breathing room for decompression.
         # We'll add it later.
@@ -1279,6 +1281,14 @@ CONFIG_ITEMS = [
         config_push = ConfigItem.config_list_prepend,
     ),
 
+    ConfigItem(
+        '--microcode',
+        metavar = 'UCODE',
+        type = pathlib.Path,
+        help = 'microcode file [.ucode section]',
+        config_key = 'UKI/Microcode',
+    ),
+
     ConfigItem(
         ('--config', '-c'),
         metavar = 'PATH',