Generate .sbat from sbat_csv.h so the version tracks MT_VERSION

This commit is contained in:
Sam Demeulemeester
2026-08-12 16:07:10 +02:00
parent 4992250cce
commit 90dcc74457
9 changed files with 15 additions and 9 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ section_table:
.short (IMAGE_REL_BASED_ABSOLUTE << 12) + 0 // reloc 0 -> 0
.section ".sbat", "a", %progbits
.incbin "../boot/sbat.csv"
#include "sbat_csv.h"
.section ".osrel", "a", %progbits
.ascii "ID=memtest86plus\n"
+1 -1
View File
@@ -182,7 +182,7 @@ section_table:
.short (IMAGE_REL_BASED_ABSOLUTE << 12) + 0 // reloc 0 -> 0
.section ".sbat", "a", @progbits
.incbin "../boot/sbat.csv"
#include "sbat_csv.h"
.section ".osrel", "a", @progbits
.ascii "ID=memtest86plus\n"
-2
View File
@@ -1,2 +0,0 @@
sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
memtest86+,1,Memtest86+,mt86plus,8.0,https://github.com/memtest86plus
1 sbat 1 SBAT Version sbat 1 https://github.com/rhboot/shim/blob/main/SBAT.md
2 memtest86+ 1 Memtest86+ mt86plus 8.0 https://github.com/memtest86plus
+8
View File
@@ -0,0 +1,8 @@
// SPDX-License-Identifier: GPL-2.0
//
// SBAT metadata for the .sbat PE section, included by the per-arch header.S.
// The vendor version tracks MT_VERSION; bump the component generation
// (2nd field) on security-relevant releases (see shim's SBAT.md).
.ascii "sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md\n"
.ascii "memtest86+,1,Memtest86+,mt86plus," , MT_VERSION , ",https://github.com/memtest86plus\n"
+1 -1
View File
@@ -977,7 +977,7 @@ section_table:
.word (IMAGE_REL_BASED_ABSOLUTE << 12) + 0 // reloc 0 -> 0
.section ".sbat", "a", @progbits
.incbin "../boot/sbat.csv"
#include "sbat_csv.h"
.section ".osrel", "a", @progbits
.ascii "ID=memtest86plus\n"
+1 -1
View File
@@ -120,7 +120,7 @@ debug: check memtest.debug
-include $(subst .o,.d,$(TST_OBJS))
-include $(subst .o,.d,$(APP_OBJS))
boot/header.o : | ../../boot/sbat.csv
boot/header.o : ../../boot/sbat_csv.h
boot/startup.o: ../../boot/aarch64/startup.S ../../boot/boot.h
@mkdir -p boot
+1 -1
View File
@@ -112,7 +112,7 @@ debug: check memtest.debug mt86plus
-include $(subst .o,.d,$(TST_OBJS))
-include $(subst .o,.d,$(APP_OBJS))
boot/x86/header.o : | ../../boot/sbat.csv
boot/x86/header.o : ../../boot/sbat_csv.h
boot/x86/startup.o: ../../boot/x86/startup32.S ../../boot/boot.h
@mkdir -p boot/x86
+1 -1
View File
@@ -109,7 +109,7 @@ debug: check memtest.debug memtestloongarch.efi
-include $(subst .o,.d,$(TST_OBJS))
-include $(subst .o,.d,$(APP_OBJS))
boot/header.o : | ../../boot/sbat.csv
boot/header.o : ../../boot/sbat_csv.h
boot/startup.o: ../../boot/loongarch/startup64.S ../../boot/boot.h
@mkdir -p boot
+1 -1
View File
@@ -113,7 +113,7 @@ debug: check memtest.debug mt86plus
-include $(subst .o,.d,$(TST_OBJS))
-include $(subst .o,.d,$(APP_OBJS))
boot/x86/header.o : | ../../boot/sbat.csv
boot/x86/header.o : ../../boot/sbat_csv.h
boot/x86/startup.o: ../../boot/x86/startup64.S ../../boot/boot.h
@mkdir -p boot/x86