@@ -55,6 +55,8 @@ $(OBJCOPY) --add-section ".$(patsubst %.csv,%,$(1))=$(1)" $(2)
55
55
endef
56
56
57
57
SBATPATH = $(TOPDIR ) /data/sbat.csv
58
+ SBATLEVELLATESTPATH = $(TOPDIR ) /data/sbat_level_latest.csv
59
+ SBATLEVELPREVIOUSPATH = $(TOPDIR ) /data/sbat_level_previous.csv
58
60
VENDOR_SBATS := $(sort $(foreach x,$(wildcard $(TOPDIR ) /data/sbat.* .csv data/sbat.* .csv) ,$(notdir $(x ) ) ) )
59
61
60
62
OBJFLAGS =
@@ -84,7 +86,7 @@ ifeq ($(ARCH),arm)
84
86
BUILDFLAGS += -ffreestanding -I$(shell $(CC) -print-file-name=include)
85
87
endif
86
88
87
- all : certmule.efi
89
+ all : certmule.efi sbat_level.efi
88
90
89
91
certmule.so : sbat_data.o certmule.o
90
92
certmule.so : SOLIBS=
@@ -94,6 +96,12 @@ certmule.efi : OBJFLAGS = --strip-unneeded $(call VENDOR_DB, $<)
94
96
certmule.efi : SECTIONS=.text .reloc .db .sbat
95
97
certmule.efi : VENDOR_DB_FILE?=db.esl
96
98
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
+
97
105
% .efi : % .so
98
106
ifneq ($(OBJCOPY_GTE224 ) ,1)
99
107
$(error objcopy >= 2.24 is required)
@@ -111,6 +119,15 @@ sbat_data.o : /dev/null
111
119
$@
112
120
$(foreach vs,$(VENDOR_SBATS ) ,$(call add-vendor-sbat,$(vs ) ,$@ ) )
113
121
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
+
114
131
% .so : % .o
115
132
$(CC ) $(CCLDFLAGS ) $(SOFLAGS ) -o $@ $^ $(SOLIBS ) \
116
133
$(shell $(CC ) -print-libgcc-file-name) \
0 commit comments