From 3193dc3d2c66bf5023e747e81471049df5902c69 Mon Sep 17 00:00:00 2001 From: Stetsed Date: Tue, 13 Oct 2026 13:32:23 +0200 Subject: [PATCH 1/2] uapi5: Added .dtbo as a valid UKI and PE addon section --- specs/unified_kernel_image.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/specs/unified_kernel_image.md b/specs/unified_kernel_image.md index 3162f6c8..7d8ff7d2 100644 --- a/specs/unified_kernel_image.md +++ b/specs/unified_kernel_image.md @@ -72,6 +72,7 @@ Please add any new components at the bottom of the list and NEVER reorder anythi * Optionally, a CSV file encoding the SBAT metadata for the image, in the `.sbat` section. The [SBAT format is defined by the Shim project](https://github.com/rhboot/shim/blob/main/SBAT.md), and used for UEFI revocation purposes. * Optionally, a JSON file encoding expected PCR 11 hash values seen from userspace once the UKI has booted up, along with signatures of these expected PCR 11 hash values, in the `.pcrsig` section. The signatures must also match the key pair described below. * Optionally, the public part of a public-private key pair in PEM format used to sign the expected PCR 11 value of the image, in the `.pcrpkey` section. +* Optionally, one or more compiled Devicetree overlays, each in a separate `.dtbo` section. This list specifies the canonical order of sections. Items will not be reordered and new sections will be added at the end only. @@ -79,7 +80,7 @@ This is required for predicatable PCR measurements. Note that all of the sections defined above are singletons: they may appear at most once, -except for the `.dtbauto` and `.efifw` sections which may appear multiple times. +except for the `.dtbauto`, `.efifw` and `.dtbo` sections which may appear multiple times. Only the `.linux` section is required for the image to be considered a Unified *Kernel* Image. @@ -109,15 +110,16 @@ PE Addons must contain at least one section of the following types: * `.cmdline` * `.dtb` * `.dtbauto` +* `.dtbo` * `.ucode` * `.initrd` PE Addons should be sorted by their filename, and applied in this order. In case of `.cmdline` all command lines provided by addons are suffixed in this order to any command line included in the UKI. In case of -`.dtb` and `.dtbauto` any such section included in the UKI shall be applied first, and those provided by add-ons should then -by applied in order as a fix-up. In case of `.ucode` the contained `cpio` archives should be prefixed to the -regular initrds passed to the kernel, in reverse order. In case of `.initrd` the contained `cpio` archives -should be appended to the regular initrds passed to the kernel. +`.dtb`, `.dtbauto` and `.dtbo` any such section included in the UKI shall be applied first, and those provided +by add-ons should then by applied in order as a fix-up. In case of `.ucode` the contained `cpio` archives +should be prefixed to the regular initrds passed to the kernel, in reverse order. In case of `.initrd` +the contained `cpio` archives should be appended to the regular initrds passed to the kernel. PE Addons may include sections of multiple types (e.g. both a `.cmdline` and a `.dtb` section), in which case all of them should be applied. From ae0e7da2a7605d05e774863fe7baa292009a0323 Mon Sep 17 00:00:00 2001 From: Stetsed Date: Wed, 14 Oct 2026 23:02:21 +0200 Subject: [PATCH 2/2] uapi5: Specify that only 1 DTBO section is valid Originally the assumption was made that `.dtbo` should be handled like `.dtbauto` where multiple sections are considered valid. However at closer look `.dtbauto` in the current reference implementation in systemd-stub doesn't actually handle multiple sections in the final flow. Instead, it simply selects it in the PE section logic. As such it makes more sense to also make DTBO a singleton --- specs/unified_kernel_image.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/unified_kernel_image.md b/specs/unified_kernel_image.md index 7d8ff7d2..357f32e2 100644 --- a/specs/unified_kernel_image.md +++ b/specs/unified_kernel_image.md @@ -72,7 +72,7 @@ Please add any new components at the bottom of the list and NEVER reorder anythi * Optionally, a CSV file encoding the SBAT metadata for the image, in the `.sbat` section. The [SBAT format is defined by the Shim project](https://github.com/rhboot/shim/blob/main/SBAT.md), and used for UEFI revocation purposes. * Optionally, a JSON file encoding expected PCR 11 hash values seen from userspace once the UKI has booted up, along with signatures of these expected PCR 11 hash values, in the `.pcrsig` section. The signatures must also match the key pair described below. * Optionally, the public part of a public-private key pair in PEM format used to sign the expected PCR 11 value of the image, in the `.pcrpkey` section. -* Optionally, one or more compiled Devicetree overlays, each in a separate `.dtbo` section. +* Optionally, a compiled Devicetree overlays in the `.dtbo` section. This list specifies the canonical order of sections. Items will not be reordered and new sections will be added at the end only. @@ -80,7 +80,7 @@ This is required for predicatable PCR measurements. Note that all of the sections defined above are singletons: they may appear at most once, -except for the `.dtbauto`, `.efifw` and `.dtbo` sections which may appear multiple times. +except for the `.dtbauto` and `.efifw` sections which may appear multiple times. Only the `.linux` section is required for the image to be considered a Unified *Kernel* Image.