revert accidentally committed changes

This commit is contained in:
Fabian Grünbichler 2023-11-20 11:06:51 +01:00
parent a70e861754
commit 214bdb2ab1
8 changed files with 96 additions and 44 deletions

View File

@ -78,9 +78,6 @@ Variables you could set to customize the build:
- OSLABEL
This is the label that will be put in BOOT$(EFI_ARCH).CSV for your OS.
By default this is the same value as EFIDIR .
- POST_PROCESS_PE_FLAGS
This allows you to add flags to the invocation of "post-process-pe", for
example to disable the NX compatibility flag.
Vendor SBAT data:
It will sometimes be requested by reviewers that a build includes extra

View File

@ -139,8 +139,6 @@ CFLAGS = $(FEATUREFLAGS) \
$(INCLUDES) \
$(DEFINES)
POST_PROCESS_PE_FLAGS =
ifneq ($(origin OVERRIDE_SECURITY_POLICY), undefined)
DEFINES += -DOVERRIDE_SECURITY_POLICY
endif

View File

@ -255,7 +255,7 @@ endif
-j .rela* -j .dyn -j .reloc -j .eh_frame \
-j .vendor_cert -j .sbat -j .sbatlevel \
$(FORMAT) $< $@
./post-process-pe -vv $(POST_PROCESS_PE_FLAGS) $@
./post-process-pe -vv $@
ifneq ($(origin ENABLE_SHIM_HASH),undefined)
%.hash : %.efi

91
gnu-efi/lib/Makefile.orig Normal file
View File

@ -0,0 +1,91 @@
#
# Copyright (C) 1999-2001 Hewlett-Packard Co.
# Contributed by David Mosberger <davidm@hpl.hp.com>
# Contributed by Stephane Eranian <eranian@hpl.hp.com>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
# * Neither the name of Hewlett-Packard Co. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
SRCDIR = .
VPATH = $(SRCDIR)
include $(SRCDIR)/../Make.defaults
TOPDIR = $(SRCDIR)/..
CDIR = $(TOPDIR)/..
FILES = boxdraw smbios console crc data debug dpath \
error event guid hand hw init lock \
misc print sread str cmdline \
runtime/rtlock runtime/efirtlib runtime/rtstr runtime/vm runtime/rtdata \
$(ARCH)/initplat $(ARCH)/math
ifeq ($(ARCH),ia64)
FILES += $(ARCH)/salpal $(ARCH)/palproc
endif
ifeq ($(ARCH),x86_64)
FILES += $(ARCH)/callwrap $(ARCH)/efi_stub
endif
ifeq ($(ARCH),arm)
FILES += $(ARCH)/lib1funcs $(ARCH)/div64
endif
OBJS = $(FILES:%=%.o)
SUBDIRS = ia32 x86_64 ia64 aarch64 arm runtime
LIBDIRINSTALL = $(INSTALLROOT)$(LIBDIR)
all: libsubdirs libefi.a
.PHONY: libsubdirs
libsubdirs:
for sdir in $(SUBDIRS); do mkdir -p $$sdir; done
libefi.a: $(patsubst %,libefi.a(%),$(OBJS))
clean:
rm -f libefi.a *~ $(OBJS) */*.o
$(LIBDIRINSTALL):
mkdir -p $@
$(LIBDIRINSTALL)/libefi.a: libefi.a | $(LIBDIRINSTALL)
$(INSTALL) -m 644 $< $(dir $@)
install: $(LIBDIRINSTALL)/libefi.a
include $(SRCDIR)/../Make.rules
.PHONY: libsubdirs

View File

@ -92,7 +92,7 @@ test-mock-variables: CFLAGS+=-DHAVE_SHIM_LOCK_GUID
test-mok-mirror_FILES = mok.c globals.c tpm.c lib/guid.c lib/variables.c mock-variables.c
test-mok-mirror: CFLAGS+=-DHAVE_START_IMAGE -DHAVE_SHIM_LOCK_GUID
test-sbat_FILES = csv.c lib/variables.c lib/guid.c sbat_var.S mock-variables.c
test-sbat_FILES = csv.c lib/variables.c lib/guid.c sbat_var.S
test-sbat :: CFLAGS+=-DHAVE_GET_VARIABLE -DHAVE_GET_VARIABLE_ATTR -DHAVE_SHIM_LOCK_GUID
test-str_FILES = lib/string.c

View File

@ -42,7 +42,7 @@ static int verbosity;
0; \
})
static bool set_nx_compat = true;
static bool set_nx_compat = false;
typedef uint8_t UINT8;
typedef uint16_t UINT16;

View File

@ -14,9 +14,7 @@ sbat_var_payload_header:
.Lsbat_var_payload_header_end:
.balign 1, 0
.Lsbat_var_previous:
.ascii SBAT_VAR_PREVIOUS
.byte 0
.asciz SBAT_VAR_PREVIOUS
.balign 1, 0
.Lsbat_var_latest:
.ascii SBAT_VAR_LATEST
.byte 0
.asciz SBAT_VAR_LATEST

View File

@ -1107,36 +1107,6 @@ test_preserve_sbat_uefi_variable_bad_short(void)
return 0;
}
static int
test_sbat_var_asciz(void)
{
EFI_STATUS status;
char buf[1024] = "";
UINT32 attrs = 0;
UINTN size = sizeof(buf);
char expected[] = SBAT_VAR_PREVIOUS;
status = set_sbat_uefi_variable();
if (status != EFI_SUCCESS)
return -1;
status = RT->GetVariable(SBAT_VAR_NAME, &SHIM_LOCK_GUID, &attrs, &size, buf);
if (status != EFI_SUCCESS)
return -1;
/*
* this should be enough to get past "sbat,", which handles the
* first error.
*/
if (size < (strlen(SBAT_VAR_SIG) + 2) || size != strlen(expected))
return -1;
if (strncmp(expected, buf, size) != 0)
return -1;
return 0;
}
int
main(void)
{
@ -1185,8 +1155,6 @@ main(void)
test(test_preserve_sbat_uefi_variable_version_older);
test(test_preserve_sbat_uefi_variable_version_olderlonger);
test(test_sbat_var_asciz);
return 0;
}