0001-hardcode-tianocore-revisions-and-don-t-automatically.patch 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. From 9000fe203d31e584bdc7d3e43d7ea615d9335205 Mon Sep 17 00:00:00 2001
  2. From: Leah Rowe <leah@libreboot.org>
  3. Date: Thu, 13 May 2021 23:52:08 +0100
  4. Subject: [PATCH 01/19] hardcode tianocore revisions, and don't automatically
  5. download
  6. ---
  7. Makefile | 2 +-
  8. payloads/external/tianocore/Makefile | 57 ++++++++--------------------
  9. 2 files changed, 17 insertions(+), 42 deletions(-)
  10. diff --git a/Makefile b/Makefile
  11. index 02c6288f15..8290b45e89 100644
  12. --- a/Makefile
  13. +++ b/Makefile
  14. @@ -486,7 +486,7 @@ distclean-utils:
  15. $(MAKE) -C util/$(tool) distclean MFLAGS= MAKEFLAGS= ; \
  16. rm -f /util/$(tool)/junit.xml;)
  17. -distclean: clean clean-ctags clean-cscope distclean-payloads distclean-utils
  18. +distclean: clean clean-ctags clean-cscope distclean-utils
  19. rm -f .config .config.old ..config.tmp* .kconfig.d .tmpconfig* .ccwrap .xcompile
  20. rm -rf coreboot-builds coreboot-builds-chromeos
  21. rm -f abuild*.xml junit.xml* util/lint/junit.xml
  22. diff --git a/payloads/external/tianocore/Makefile b/payloads/external/tianocore/Makefile
  23. index 7cd34f1732..3527b7a2ad 100644
  24. --- a/payloads/external/tianocore/Makefile
  25. +++ b/payloads/external/tianocore/Makefile
  26. @@ -1,5 +1,8 @@
  27. ## SPDX-License-Identifier: GPL-2.0-only
  28. +# This file has been modified for libreboot/osboot/osboot-libre.
  29. +# The tianocore repo/branch/revision has been hardcoded, as have some options
  30. +
  31. # force the shell to bash - the edksetup.sh script doesn't work with dash
  32. export SHELL := env bash
  33. @@ -9,51 +12,31 @@ project_git_repo=https://github.com/mrchromebox/edk2
  34. project_git_branch=coreboot_fb
  35. upstream_git_repo=https://github.com/tianocore/edk2
  36. -ifeq ($(CONFIG_TIANOCORE_UEFIPAYLOAD),y)
  37. -bootloader=UefiPayloadPkg
  38. -logo_pkg=MdeModulePkg
  39. -build_flavor=-D BOOTLOADER=COREBOOT -D PCIE_BASE=$(CONFIG_MMCONF_BASE_ADDRESS) -DPS2_KEYBOARD_ENABLE
  40. -TAG=upstream/master
  41. -else
  42. bootloader=CorebootPayloadPkg
  43. logo_pkg=CorebootPayloadPkg
  44. # STABLE revision is MrChromebox's coreboot framebuffer (coreboot_fb) branch
  45. -TAG=origin/$(project_git_branch)
  46. -endif
  47. -
  48. -ifneq ($(CONFIG_TIANOCORE_REVISION_ID),)
  49. -TAG=$(CONFIG_TIANOCORE_REVISION_ID)
  50. -endif
  51. +TAG=ca08920ded1649921a12105d1959df423733431f
  52. +# above is a commit ID in MrChromebox's coreboot_fb branch
  53. export EDK_TOOLS_PATH=$(project_dir)/BaseTools
  54. -ifeq ($(CONFIG_TIANOCORE_DEBUG),y)
  55. -BUILD_TYPE=DEBUG
  56. -else
  57. BUILD_TYPE=RELEASE
  58. -endif
  59. -ifneq ($(CONFIG_TIANOCORE_USE_8254_TIMER), y)
  60. TIMER=-DUSE_HPET_TIMER
  61. -endif
  62. -TIMEOUT=-D PLATFORM_BOOT_TIMEOUT=$(CONFIG_TIANOCORE_BOOT_TIMEOUT)
  63. +# see coreboot 61a3c8a005922d46425c84f847c0ad26e9c3cdca
  64. +# "2 seconds for board with internal display"
  65. +# "5 seconds for board without internal display"
  66. +# libreboot takes the shotgun approach. 5 seconds for all
  67. +TIMEOUT=-D PLATFORM_BOOT_TIMEOUT=5
  68. -ifeq ($(CONFIG_TIANOCORE_COREBOOTPAYLOAD),y)
  69. -ifeq ($(CONFIG_TIANOCORE_TARGET_IA32), y)
  70. -ARCH=-a IA32 -p CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
  71. -else
  72. ARCH=-a IA32 -a X64 -p CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
  73. -endif
  74. -else
  75. -ARCH=-a IA32 -a X64 -p UefiPayloadPkg/UefiPayloadPkg.dsc
  76. -endif
  77. -BUILD_STR=-q $(ARCH) -t COREBOOT -b $(BUILD_TYPE) $(TIMER) $(TIMEOUT) $(build_flavor)
  78. +BUILD_STR=-q $(ARCH) -t COREBOOT -b $(BUILD_TYPE) $(TIMER) $(TIMEOUT)
  79. all: clean build
  80. -$(project_dir):
  81. +download:
  82. echo " Cloning $(project_name) from Git"
  83. git clone --branch $(project_git_branch) $(project_git_repo) $(project_dir); \
  84. cd $(project_dir); \
  85. @@ -76,17 +59,9 @@ update: $(project_dir)
  86. git submodule update --init
  87. checktools:
  88. - echo "Checking uuid-dev..."
  89. - echo "#include <uuid/uuid.h>" > libtest.c
  90. - echo "int main(int argc, char **argv) { (void) argc; (void) argv; return 0; }" >> libtest.c
  91. - $(HOSTCC) $(HOSTCCFLAGS) libtest.c -o libtest >/dev/null 2>&1 && echo " found uuid-dev." || \
  92. - ( echo " Not found."; echo "ERROR: please_install uuid-dev (libuuid-devel)"; exit 1 )
  93. - rm -rf libtest.c libtest
  94. - echo "Checking nasm..."
  95. - type nasm > /dev/null 2>&1 && echo " found nasm." || \
  96. - ( echo " Not found."; echo "Error: Please install nasm."; exit 1 )
  97. -
  98. -build: update checktools
  99. + echo "tianocore tool check disabled"
  100. +
  101. +build: checktools
  102. unset CC; $(MAKE) -C $(project_dir)/BaseTools
  103. echo " build $(project_name) $(TAG)"
  104. if [ -n "$(CONFIG_TIANOCORE_BOOTSPLASH_FILE)" ]; then \
  105. @@ -116,4 +91,4 @@ clean:
  106. distclean:
  107. rm -rf $(project_dir)
  108. -.PHONY: all update checktools config build clean distclean
  109. +.PHONY: all update checktools config build clean distclean download
  110. --
  111. 2.25.1