From: Tobias Fleig Date: Tue, 2 Apr 2024 11:00:10 +0000 (-0700) Subject: ukify: Add support for .ucode UKI section X-Git-Tag: v256-rc1~102^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F31872%2Fhead;p=thirdparty%2Fsystemd.git ukify: Add support for .ucode UKI section This commit teaches ukify how to build a .ucode section into UKIs. This section is functionally an initrd, intended for microcode updates. --- diff --git a/man/ukify.xml b/man/ukify.xml index a81cbcb47b5..a9034bc5111 100644 --- a/man/ukify.xml +++ b/man/ukify.xml @@ -67,6 +67,7 @@ Additional sections will be inserted into the UKI, either automatically or only if a specific option is provided. See the discussions of + Microcode=/, Cmdline=/, OSRelease=/, DeviceTree=/, @@ -302,6 +303,16 @@ + + Microcode=UCODE + + + Path to initrd containing microcode updates. If not specified, the section + will not be present. + + + + Cmdline=TEXT|@PATH diff --git a/src/ukify/ukify.py b/src/ukify/ukify.py index 686377200f4..50d921b7a80 100755 --- a/src/ukify/ukify.py +++ b/src/ukify/ukify.py @@ -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',