From ad6da5a9a78acce311c0e0758449d0ecef6437ee Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Wed, 8 Oct 2025 11:42:12 +0800 Subject: [PATCH] uefi: Add .sbat link_section Validated with https://github.com/google/sbat-rs ``` > sbat-tool validate ./framework_uefi/build/x86_64-unknown-uefi/boot.efi ./framework_uefi/build/x86_64-unknown-uefi/boot.efi: +----------------+-----+------------------------+----------------+---------+-------------------------------------------------------+ | component | gen | vendor | package | version | url | +----------------+-----+------------------------+----------------+---------+-------------------------------------------------------+ | sbat | 1 | SBAT Version | sbat | 1 | https://github.com/rhboot/shim/blob/main/SBAT.md | +----------------+-----+------------------------+----------------+---------+-------------------------------------------------------+ | framework_tool | 1 | Framework Computer Inc | framework_tool | 0.4.5 | https://github.com/FrameworkComputer/framework-system | +----------------+-----+------------------------+----------------+---------+-------------------------------------------------------+ ``` Signed-off-by: Daniel Schaefer --- framework_uefi/src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/framework_uefi/src/main.rs b/framework_uefi/src/main.rs index caeeee2e..61c2e771 100644 --- a/framework_uefi/src/main.rs +++ b/framework_uefi/src/main.rs @@ -11,6 +11,10 @@ extern crate alloc; use framework_lib::commandline; +#[used] +#[link_section = ".sbat"] +pub static SBAT: [u8; 191] = *b"sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md\nframework_tool,1,Framework Computer Inc,framework_tool,0.4.5,https://github.com/FrameworkComputer/framework-system\0"; + #[entry] fn main(image_handle: Handle, mut system_table: SystemTable) -> Status { uefi_services::init(&mut system_table).unwrap();