mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-19 04:57:55 +00:00
build appears to produce a NERFed r630 firmware image
This commit is contained in:
parent
998736fc50
commit
796ea2870a
1
Makefile
1
Makefile
@ -440,6 +440,7 @@ bootstrap:
|
|||||||
musl-cross.intermediate \
|
musl-cross.intermediate \
|
||||||
$(build)/$(coreboot_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc \
|
$(build)/$(coreboot_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc \
|
||||||
|
|
||||||
|
include Makefile.nerf
|
||||||
|
|
||||||
else
|
else
|
||||||
# Wrong make version detected -- build our local version
|
# Wrong make version detected -- build our local version
|
||||||
|
@ -26,6 +26,7 @@ GenSec-pe = $(EDK2_DIR)/GenSec \
|
|||||||
"$2" \
|
"$2" \
|
||||||
|
|
||||||
|
|
||||||
|
$(build)/$(linux_dir)/arch/x86/boot/bzImage: linux.intermediate
|
||||||
linux-pe.sec: $(build)/$(linux_dir)/arch/x86/boot/bzImage
|
linux-pe.sec: $(build)/$(linux_dir)/arch/x86/boot/bzImage
|
||||||
$(call GenSec-pe,$@,$<)
|
$(call GenSec-pe,$@,$<)
|
||||||
linux-name.sec:
|
linux-name.sec:
|
||||||
@ -82,7 +83,7 @@ DxeCore.ffs: DxeCore-pe.sec DxeCore-name.sec DxeCore-version.sec
|
|||||||
$(EDK2_DIR)/GenFfs \
|
$(EDK2_DIR)/GenFfs \
|
||||||
-t EFI_FV_FILETYPE_DXE_CORE \
|
-t EFI_FV_FILETYPE_DXE_CORE \
|
||||||
-g D6A2CB7F-6A18-4E2F-B43B-9920A733700A \
|
-g D6A2CB7F-6A18-4E2F-B43B-9920A733700A \
|
||||||
--align 64K \
|
--align 1K \
|
||||||
$(addprefix -i ,$^) \
|
$(addprefix -i ,$^) \
|
||||||
-o $@ \
|
-o $@ \
|
||||||
|
|
||||||
@ -112,6 +113,7 @@ nerf.vol: DxeCore.ffs RuntimeDxe.ffs linux.ffs
|
|||||||
|
|
||||||
|
|
||||||
nerf.intermediate: \
|
nerf.intermediate: \
|
||||||
|
linux.intermediate \
|
||||||
edk2.intermediate \
|
edk2.intermediate \
|
||||||
DxeCore.ffs \
|
DxeCore.ffs \
|
||||||
RuntimeDxe.ffs \
|
RuntimeDxe.ffs \
|
||||||
|
@ -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
|
|
@ -16,16 +16,7 @@ edk2_configure := \
|
|||||||
-C BaseTools \
|
-C BaseTools \
|
||||||
&& pwd \
|
&& pwd \
|
||||||
&& cp ../../config/edk2.config ./Conf/target.txt \
|
&& cp ../../config/edk2.config ./Conf/target.txt \
|
||||||
&& cp ../../config/edk2.makefile ./Makefile \
|
|
||||||
&& . ./edksetup.sh
|
&& . ./edksetup.sh
|
||||||
|
|
||||||
edk2_target := \
|
edk2_target := \
|
||||||
all
|
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
71
patches/edk2.patch
Normal 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
|
Loading…
Reference in New Issue
Block a user