From 72e4cd2eca2b86a7ee9a73af573715193f652e2e Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@retroboot.org>
Date: Thu, 31 Dec 2020 04:52:01 +0000
Subject: [PATCH 7/9] hardcode tianocore revisions, and don't automatically
 download

This is for retroboot integration of tianocore
---
 Makefile                             |  2 +-
 payloads/external/tianocore/Makefile | 48 +++++++---------------------
 2 files changed, 12 insertions(+), 38 deletions(-)

diff --git a/Makefile b/Makefile
index 1b7cb9b8d6..b49c55976f 100644
--- a/Makefile
+++ b/Makefile
@@ -471,7 +471,7 @@ distclean-utils:
 		$(MAKE) -C util/$(tool) distclean MFLAGS= MAKEFLAGS= ; \
 		rm -f /util/$(tool)/junit.xml;)
 
-distclean: clean clean-ctags clean-cscope distclean-payloads distclean-utils
+distclean: clean clean-ctags clean-cscope distclean-utils
 	rm -f .config .config.old ..config.tmp* .kconfig.d .tmpconfig* .ccwrap .xcompile
 	rm -rf coreboot-builds coreboot-builds-chromeos
 	rm -f abuild*.xml junit.xml* util/lint/junit.xml
diff --git a/payloads/external/tianocore/Makefile b/payloads/external/tianocore/Makefile
index 3d3a3dd748..3f335961f2 100644
--- a/payloads/external/tianocore/Makefile
+++ b/payloads/external/tianocore/Makefile
@@ -9,43 +9,23 @@ project_git_repo=https://github.com/mrchromebox/edk2
 project_git_branch=coreboot_fb
 upstream_git_repo=https://github.com/tianocore/edk2
 
-ifeq ($(CONFIG_TIANOCORE_UEFIPAYLOAD),y)
-bootloader=UefiPayloadPkg
-logo_pkg=MdeModulePkg
-build_flavor=-D BOOTLOADER=COREBOOT -D PCIE_BASE=$(CONFIG_MMCONF_BASE_ADDRESS) -DPS2_KEYBOARD_ENABLE
-TAG=upstream/master
-else
 bootloader=CorebootPayloadPkg
 logo_pkg=CorebootPayloadPkg
 # STABLE revision is MrChromebox's coreboot framebuffer (coreboot_fb) branch
-TAG=origin/$(project_git_branch)
-endif
-
-ifneq ($(CONFIG_TIANOCORE_REVISION_ID),)
-TAG=$(CONFIG_TIANOCORE_REVISION_ID)
-endif
+TAG=ca08920ded1649921a12105d1959df423733431f
+# above is a commit ID in MrChromebox's coreboot_fb branch
 
 export EDK_TOOLS_PATH=$(project_dir)/BaseTools
 
-ifeq ($(CONFIG_TIANOCORE_DEBUG),y)
-BUILD_TYPE=DEBUG
-else
 BUILD_TYPE=RELEASE
-endif
 
-ifneq ($(CONFIG_TIANOCORE_USE_8254_TIMER), y)
 TIMER=-DUSE_HPET_TIMER
-endif
 
-ifeq ($(CONFIG_TIANOCORE_TARGET_IA32), y)
-	BUILD_STR=-q -a IA32 -t COREBOOT -p $(bootloader)/$(bootloader)Ia32.dsc -b $(BUILD_TYPE) $(TIMER) $(build_flavor)
-else
-	BUILD_STR=-q -a IA32 -a X64 -t COREBOOT -p $(bootloader)/$(bootloader)Ia32X64.dsc -b $(BUILD_TYPE) $(TIMER) $(build_flavor)
-endif
+BUILD_STR=-q -a IA32 -a X64 -t COREBOOT -p $(bootloader)/$(bootloader)Ia32X64.dsc -b $(BUILD_TYPE) $(TIMER) $(build_flavor)
 
-all: clean build
+all: build
 
-$(project_dir):
+download:
 	echo "    Cloning $(project_name) from Git"
 	git clone --branch $(project_git_branch) $(project_git_repo) $(project_dir); \
 		cd $(project_dir); \
@@ -65,20 +45,14 @@ update: $(project_dir)
 		else \
 			echo "    Working directory not clean; will not overwrite"; \
 		fi; \
-		git submodule update --init
+		git submodule update --init; \
+        cd CryptoPkg/Library/OpensslLib/openssl/; \
+        git reset --hard 74f2d9c1ec5f5510e1d3da5a9f03c28df0977762
 
 checktools:
-	echo "Checking uuid-dev..."
-	echo "#include <uuid/uuid.h>" > libtest.c
-	echo "int main(int argc, char **argv) { (void) argc; (void) argv; return 0; }" >> libtest.c
-	$(HOSTCC) $(HOSTCCFLAGS) libtest.c -o libtest >/dev/null 2>&1 && echo " found uuid-dev." || \
-		( echo " Not found."; echo "ERROR: please_install uuid-dev (libuuid-devel)"; exit 1 )
-	rm -rf libtest.c libtest
-	echo "Checking nasm..."
-	type nasm > /dev/null 2>&1 && echo " found nasm." || \
-		( echo " Not found."; echo "Error: Please install nasm."; exit 1 )
+	echo "tianocore tool check disabled in coreboot build system"
 
-build: update checktools
+build: checktools
 	unset CC; $(MAKE) -C $(project_dir)/BaseTools
 	echo " build $(project_name) $(TAG)"
 	if [ -n "$(CONFIG_TIANOCORE_BOOTSPLASH_FILE)" ]; then \
@@ -108,4 +82,4 @@ clean:
 distclean:
 	rm -rf $(project_dir)
 
-.PHONY: all update checktools config build clean distclean
+.PHONY: all update checktools config build clean distclean download
-- 
2.25.1

