build appears to produce a NERFed r630 firmware image

This commit is contained in:
Trammell hudson 2017-09-20 18:24:54 -04:00
parent 998736fc50
commit 796ea2870a
Failed to extract signature
5 changed files with 75 additions and 42 deletions

View File

@ -440,6 +440,7 @@ bootstrap:
musl-cross.intermediate \
$(build)/$(coreboot_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc \
include Makefile.nerf
else
# Wrong make version detected -- build our local version

View File

@ -26,6 +26,7 @@ GenSec-pe = $(EDK2_DIR)/GenSec \
"$2" \
$(build)/$(linux_dir)/arch/x86/boot/bzImage: linux.intermediate
linux-pe.sec: $(build)/$(linux_dir)/arch/x86/boot/bzImage
$(call GenSec-pe,$@,$<)
linux-name.sec:
@ -82,7 +83,7 @@ DxeCore.ffs: DxeCore-pe.sec DxeCore-name.sec DxeCore-version.sec
$(EDK2_DIR)/GenFfs \
-t EFI_FV_FILETYPE_DXE_CORE \
-g D6A2CB7F-6A18-4E2F-B43B-9920A733700A \
--align 64K \
--align 1K \
$(addprefix -i ,$^) \
-o $@ \
@ -112,6 +113,7 @@ nerf.vol: DxeCore.ffs RuntimeDxe.ffs linux.ffs
nerf.intermediate: \
linux.intermediate \
edk2.intermediate \
DxeCore.ffs \
RuntimeDxe.ffs \

View File

@ -1,32 +0,0 @@
# Wrapper around the edk2 "build" script to generate
# the few files that we actually want and avoid rebuilding
# if we don't have to.
PWD := $(shell pwd)
EDK2_OUTPUT_DIR := $(PWD)/Build/MdeModule/DEBUG_GCC5/X64/MdeModulePkg/Core
EDK2_BIN_DIR := $(PWD)/BaseTools/BinWrappers/PosixLike
export PATH := $(EDK2_BIN_DIR):$(PATH)
export CONFIG_PATH := $(PWD)/Conf
export EDK_TOOLS_PATH := $(PWD)/BaseTools
export WORKSPACE := $(PWD)
EDK2_BINS += Dxe/DxeMain/DEBUG/DxeCore.efi
EDK2_BINS += RuntimeDxe/RuntimeDxe/DEBUG/RuntimeDxe.efi
EDK2_OUTPUTS = $(addprefix $(EDK2_OUTPUT_DIR)/,$(EDK2_BINS))
# build takes too long, so we check to see if our executables exist
# before we start a build. run the clean target if they must be rebuilt
all: $(EDK2_OUTPUTS)
ls -Fla $(EDK2_OUTPUTS)
cp -a $(EDK2_OUTPUTS) .
$(EDK2_OUTPUTS):
build
clean:
$(RM) $(EDK2_OUTPUTS)
real-clean: clean
build clean

View File

@ -16,16 +16,7 @@ edk2_configure := \
-C BaseTools \
&& pwd \
&& cp ../../config/edk2.config ./Conf/target.txt \
&& cp ../../config/edk2.makefile ./Makefile \
&& . ./edksetup.sh
edk2_target := \
all
NO:=\
obj=./$(BOARD) \
DOTCONFIG=../../config/edk2-$(BOARD).config \
BUILD_TIMELESS=1 \
CFLAGS_x86_32="$(EXTRA_FLAGS)" \
CFLAGS_x86_64="$(EXTRA_FLAGS)" \
$(MAKE_JOBS)

71
patches/edk2.patch Normal file
View File

@ -0,0 +1,71 @@
diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
index 91e94a7..6b729df 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
+++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
@@ -743,6 +800,7 @@ CoreExitBootServices (
//
// Disable Timer
//
+ if(gTimer)
gTimer->SetTimerPeriod (gTimer, 0);
//
@@ -780,6 +838,7 @@ CoreExitBootServices (
//
// Disable CPU Interrupts
//
+ if(gCpu)
gCpu->DisableInterrupt (gCpu);
MemoryProtectionExitBootServicesCallback();
diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
index a73c4cc..2c08b81 100644
--- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
+++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
@@ -232,7 +232,7 @@ SetUefiImageMemoryAttributes (
DEBUG ((DEBUG_INFO, "SetUefiImageMemoryAttributes - 0x%016lx - 0x%016lx (0x%016lx)\n", BaseAddress, Length, FinalAttributes));
- ASSERT(gCpu != NULL);
+ if(gCpu)
gCpu->SetMemoryAttributes (gCpu, BaseAddress, Length, FinalAttributes);
}
--- /dev/null 2017-09-19 09:53:09.766660422 -0400
+++ ./Makefile 2017-09-20 15:24:01.850433474 -0400
@@ -0,0 +1,35 @@
+# Wrapper around the edk2 "build" script to generate
+# the few files that we actually want and avoid rebuilding
+# if we don't have to.
+
+PWD := $(shell pwd)
+EDK2_OUTPUT_DIR := $(PWD)/Build/MdeModule/DEBUG_GCC5/X64/MdeModulePkg/Core
+EDK2_BIN_DIR := $(PWD)/BaseTools/BinWrappers/PosixLike
+
+export PATH := $(EDK2_BIN_DIR):$(PATH)
+export CONFIG_PATH := $(PWD)/Conf
+export EDK_TOOLS_PATH := $(PWD)/BaseTools
+export WORKSPACE := $(PWD)
+
+EDK2_BINS += Dxe/DxeMain/DEBUG/DxeCore.efi
+EDK2_BINS += RuntimeDxe/RuntimeDxe/DEBUG/RuntimeDxe.efi
+
+EDK2_OUTPUTS = $(addprefix $(EDK2_OUTPUT_DIR)/,$(EDK2_BINS))
+
+# build takes too long, so we check to see if our executables exist
+# before we start a build. run the clean target if they must be rebuilt
+all: $(EDK2_OUTPUTS)
+ ls -Fla $(EDK2_OUTPUTS)
+ cp -a $(EDK2_OUTPUTS) .
+
+$(EDK2_OUTPUTS):
+ build
+
+build:
+ build
+
+clean:
+ $(RM) $(EDK2_OUTPUTS)
+
+real-clean: clean
+ build clean