From 22b8236ff61f5427b5f266ca65b983a50502d5bc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 2 Jul 2024 09:38:53 +0200 Subject: [PATCH] ukify: add basic .profile support 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 | 11 +++++++++++ src/ukify/ukify.py | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/man/ukify.xml b/man/ukify.xml index bfe54a8f27..1c52c9414b 100644 --- a/man/ukify.xml +++ b/man/ukify.xml @@ -400,6 +400,17 @@ + + Profile=PATH + + + A path to a UKI profile to place in an .profile section. This + option is useful for creating multi-profile UKIs, and is typically used in combination with + , to extend the specified UKI with an additional profile. + + + + PCRBanks=PATH diff --git a/src/ukify/ukify.py b/src/ukify/ukify.py index 3478ff5689..c8b6ce401b 100755 --- a/src/ukify/ukify.py +++ b/src/ukify/ukify.py @@ -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',