Skip to content

Commit 5e7d884

Browse files
committed
Create sbat_level.efi to deliver new sbat level requirements
This covers delivering updates to SBAT_LEVEL without the need to create and sign a new shim Signed-off-by: Jan Setje-Eilers <[email protected]>
1 parent d50e6c5 commit 5e7d884

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

Makefile

+18-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ $(OBJCOPY) --add-section ".$(patsubst %.csv,%,$(1))=$(1)" $(2)
5555
endef
5656

5757
SBATPATH = $(TOPDIR)/data/sbat.csv
58+
SBATLEVELLATESTPATH = $(TOPDIR)/data/sbat_level_latest.csv
59+
SBATLEVELPREVIOUSPATH = $(TOPDIR)/data/sbat_level_previous.csv
5860
VENDOR_SBATS := $(sort $(foreach x,$(wildcard $(TOPDIR)/data/sbat.*.csv data/sbat.*.csv),$(notdir $(x))))
5961

6062
OBJFLAGS =
@@ -84,7 +86,7 @@ ifeq ($(ARCH),arm)
8486
BUILDFLAGS += -ffreestanding -I$(shell $(CC) -print-file-name=include)
8587
endif
8688

87-
all : certmule.efi
89+
all : certmule.efi sbat_level.efi
8890

8991
certmule.so : sbat_data.o certmule.o
9092
certmule.so : SOLIBS=
@@ -94,6 +96,12 @@ certmule.efi : OBJFLAGS = --strip-unneeded $(call VENDOR_DB, $<)
9496
certmule.efi : SECTIONS=.text .reloc .db .sbat
9597
certmule.efi : VENDOR_DB_FILE?=db.esl
9698

99+
sbat_level.so : sbat_data.o sbat_level.o certmule.o
100+
sbat_level.so : SOLIBS=
101+
sbat_level.so : SOFLAGS=
102+
sbat_level.efi : OBJFLAGS = --strip-unneeded
103+
sbat_level.efi : SECTIONS=.text .reloc .sbatl .sbatp .sbat
104+
97105
%.efi : %.so
98106
ifneq ($(OBJCOPY_GTE224),1)
99107
$(error objcopy >= 2.24 is required)
@@ -111,6 +119,15 @@ sbat_data.o : /dev/null
111119
$@
112120
$(foreach vs,$(VENDOR_SBATS),$(call add-vendor-sbat,$(vs),$@))
113121

122+
sbat_level.o : /dev/null
123+
$(CC) $(BUILDFLAGS) -x c -c -o $@ $<
124+
$(OBJCOPY) --add-section .sbatl=$(SBATLEVELLATESTPATH) \
125+
--set-section-flags .sbatl=contents,alloc,load,readonly,data \
126+
$@
127+
$(OBJCOPY) --add-section .sbatp=$(SBATLEVELPREVIOUSPATH) \
128+
--set-section-flags .sbatp=contents,alloc,load,readonly,data \
129+
$@
130+
114131
%.so : %.o
115132
$(CC) $(CCLDFLAGS) $(SOFLAGS) -o $@ $^ $(SOLIBS) \
116133
$(shell $(CC) -print-libgcc-file-name) \

data/sbat_level_latest.csv

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sbat,1,2022122400
2+
morefun,3

data/sbat_level_previous.csv

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sbat,1,2022110101
2+
component,2
3+
funfunfun,12

0 commit comments

Comments
 (0)