payloads: Replace GPL boilerplate with SPDX headers
Used commands:
perl -i -p0e 's|\/\*[\s*]*.*is free software[:;][\s*]*you[\s*]*can[\s*]*redistribute[\s*]*it[\s*]*and\/or[\s*]*modify[\s*]*it[\s*]*under[\s*]*the[\s*]*terms[\s*]*of[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*as[\s*]*published[\s*]*by[\s*]*the[\s*]*Free[\s*]*Software[\s*]*Foundation[;,][\s*]*version[\s*]*2[\s*]*of[\s*]*the[\s*]*License.[\s*]*This[\s*]*program[\s*]*is[\s*]*distributed[\s*]*in[\s*]*the[\s*]*hope[\s*]*that[\s*]*it[\s*]*will[\s*]*be[\s*]*useful,[\s*]*but[\s*]*WITHOUT[\s*]*ANY[\s*]*WARRANTY;[\s*]*without[\s*]*even[\s*]*the[\s*]*implied[\s*]*warranty[\s*]*of[\s*]*MERCHANTABILITY[\s*]*or[\s*]*FITNESS[\s*]*FOR[\s*]*A[\s*]*PARTICULAR[\s*]*PURPOSE.[\s*]*See[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*for[\s*]*more[\s*]*details.[\s*]*\*\/|/* SPDX-License-Identifier: GPL-2.0-only */|' $(cat filelist)
perl -i -p0e 's|\/\*[\s*]*.*is[\s*]*free[\s*]*software[:;][\s*]*you[\s*]*can[\s*]*redistribute[\s*]*it[\s*]*and/or[\s*]*modify[\s*]*it[\s*]*under[\s*]*the[\s*]*terms[\s*]*of[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*as[\s*]*published[\s*]*by[\s*]*the[\s*]*Free[\s*]*Software[\s*]*Foundation[;,][\s*]*either[\s*]*version[\s*]*2[\s*]*of[\s*]*the[\s*]*License,[\s*]*or[\s*]*.at[\s*]*your[\s*]*option.*[\s*]*any[\s*]*later[\s*]*version.[\s*]*This[\s*]*program[\s*]*is[\s*]*distributed[\s*]*in[\s*]*the[\s*]*hope[\s*]*that[\s*]*it[\s*]*will[\s*]*be[\s*]*useful,[\s*]*but[\s*]*WITHOUT[\s*]*ANY[\s*]*WARRANTY;[\s*]*without[\s*]*even[\s*]*the[\s*]*implied[\s*]*warranty[\s*]*of[\s*]*MERCHANTABILITY[\s*]*or[\s*]*FITNESS[\s*]*FOR[\s*]*A[\s*]*PARTICULAR[\s*]*PURPOSE.[\s*]*See[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*for[\s*]*more[\s*]*details.[\s*]*\*\/|/* SPDX-License-Identifier: GPL-2.0-or-later */|' $(cat filelist)
perl -i -p0e 's|\/\*[\s*]*.*is[\s*#]*free[\s*#]*software[;:,][\s*#]*you[\s*#]*can[\s*#]*redistribute[\s*#]*it[\s*#]*and/or[\s*#]*modify[\s*#]*it[\s*#]*under[\s*#]*the[\s*#]*terms[\s*#]*of[\s*#]*the[\s*#]*GNU[\s*#]*General[\s*#]*Public[\s*#]*License[\s*#]*as[\s*#]*published[\s*#]*by[\s*#]*the[\s*#]*Free[\s*#]*Software[\s*#]*Foundation[;:,][\s*#]*either[\s*#]*version[\s*#]*3[\s*#]*of[\s*#]*the[\s*#]*License[;:,][\s*#]*or[\s*#]*.at[\s*#]*your[\s*#]*option.*[\s*#]*any[\s*#]*later[\s*#]*version.[\s*#]*This[\s*#]*program[\s*#]*is[\s*#]*distributed[\s*#]*in[\s*#]*the[\s*#]*hope[\s*#]*that[\s*#]*it[\s*#]*will[\s*#]*be[\s*#]*useful[;:,][\s*#]*but[\s*#]*WITHOUT[\s*#]*ANY[\s*#]*WARRANTY[;:,][\s*#]*without[\s*#]*even[\s*#]*the[\s*#]*implied[\s*#]*warranty[\s*#]*of[\s*#]*MERCHANTABILITY[\s*#]*or[\s*#]*FITNESS[\s*#]*FOR[\s*#]*A[\s*#]*PARTICULAR[\s*#]*PURPOSE.[\s*#]*See[\s*#]*the[\s*#]*GNU[\s*#]*General[\s*#]*Public[\s*#]*License[\s*#]*for[\s*#]*more[\s*#]*details.[\s*]*\*\/|/* SPDX-License-Identifier: GPL-3.0-or-later */|' $(cat filelist)
perl -i -p0e 's|(\#\#*)[\w]*.*is free software[:;][\#\s]*you[\#\s]*can[\#\s]*redistribute[\#\s]*it[\#\s]*and\/or[\#\s]*modify[\#\s]*it[\s\#]*under[\s \#]*the[\s\#]*terms[\s\#]*of[\s\#]*the[\s\#]*GNU[\s\#]*General[\s\#]*Public[\s\#]*License[\s\#]*as[\s\#]*published[\s\#]*by[\s\#]*the[\s\#]*Free[\s\#]*Software[\s\#]*Foundation[;,][\s\#]*version[\s\#]*2[\s\#]*of[\s\#]*the[\s\#]*License.*[\s\#]*This[\s\#]*program[\s\#]*is[\s\#]*distributed[\s\#]*in[\s\#]*the[\s\#]*hope[\s\#]*that[\s\#]*it[\s\#]*will[\#\s]*be[\#\s]*useful,[\#\s]*but[\#\s]*WITHOUT[\#\s]*ANY[\#\s]*WARRANTY;[\#\s]*without[\#\s]*even[\#\s]*the[\#\s]*implied[\#\s]*warranty[\#\s]*of[\#\s]*MERCHANTABILITY[\#\s]*or[\#\s]*FITNESS[\#\s]*FOR[\#\s]*A[\#\s]*PARTICULAR[\#\s]*PURPOSE.[\#\s]*See[\#\s]*the[\#\s]*GNU[\#\s]*General[\#\s]*Public[\#\s]*License[\#\s]*for[\#\s]*more[\#\s]*details.\s(#* *\n)*|\1 SPDX-License-Identifier: GPL-2.0-only\n\n|' $(cat filelist)
perl -i -p0e 's|(\#\#*)[\w*]*.*is free software[:;][\s*]*you[\s*]*can[\s*]*redistribute[\s*]*it[\s*]*and\/or[\s*]*modify[\s*]*it[\s*]*under[\s*]*the[\s*]*terms[\s*]*of[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*as[\s*]*published[\s*]*by[\s*]*the[\s*]*Free[\s*]*Software[\s*]*Foundation[;,][\s*]*version[\s*]*2[\s*]*of[\s*]*the[\s*]*License.[\s*]*This[\s*]*program[\s*]*is[\s*]*distributed[\s*]*in[\s*]*the[\s*]*hope[\s*]*that[\s*]*it[\s*]*will[\s*]*be[\s*]*useful,[\s*]*but[\s*]*WITHOUT[\s*]*ANY[\s*]*WARRANTY;[\s*]*without[\s*]*even[\s*]*the[\s*]*implied[\s*]*warranty[\s*]*of[\s*]*MERCHANTABILITY[\s*]*or[\s*]*FITNESS[\s*]*FOR[\s*]*A[\s*]*PARTICULAR[\s*]*PURPOSE.[\s*]*See[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*for[\s*]*more[\s*]*details.\s(#* *\n)*|\1 SPDX-License-Identifier: GPL-2.0-only\n\n|' $(cat filelist)
Change-Id: I9f74ed19257bc4234465b8f912deff1b485173f9
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41179
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-05-08 22:50:46 +02:00
|
|
|
## SPDX-License-Identifier: GPL-2.0-only
|
2016-06-03 00:42:29 +02:00
|
|
|
|
|
|
|
# force the shell to bash - the edksetup.sh script doesn't work with dash
|
|
|
|
export SHELL := env bash
|
|
|
|
|
2022-02-04 08:41:16 +01:00
|
|
|
project_name = Tianocore
|
|
|
|
project_dir = $(CURDIR)/$(word 3,$(subst /, ,$(CONFIG_TIANOCORE_REPOSITORY)))
|
2021-05-10 18:02:13 +02:00
|
|
|
|
2022-02-04 08:41:16 +01:00
|
|
|
BUILD_STR = -a IA32 -a X64 -t COREBOOT
|
2021-10-28 23:46:17 +02:00
|
|
|
ifeq ($(CONFIG_TIANOCORE_COREBOOTPAYLOAD),y)
|
2022-02-04 08:41:16 +01:00
|
|
|
BUILD_STR += -p CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
|
2021-10-28 23:46:17 +02:00
|
|
|
else
|
2022-02-04 08:41:16 +01:00
|
|
|
BUILD_STR += -p UefiPayloadPkg/UefiPayloadPkg.dsc
|
2021-10-28 23:46:17 +02:00
|
|
|
endif
|
2022-02-04 08:41:16 +01:00
|
|
|
BUILD_STR += -D BOOTLOADER=COREBOOT -q
|
|
|
|
|
|
|
|
#
|
|
|
|
# EDK II has the following build options relevant to coreboot:
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# OPTION = DEFAULT_VALUE
|
|
|
|
#
|
|
|
|
# ABOVE_4G_MEMORY = TRUE
|
|
|
|
ifneq ($(CONFIG_TIANOCORE_ABOVE_4G_MEMORY),y)
|
|
|
|
BUILD_STR += -D ABOVE_4G_MEMORY=FALSE
|
2019-07-20 07:06:03 +02:00
|
|
|
endif
|
2022-02-04 08:41:16 +01:00
|
|
|
# BOOTSPLASH_IMAGE = FALSE
|
|
|
|
ifneq ($(CONFIG_TIANOCORE_BOOTSPLASH_FILE),)
|
|
|
|
BUILD_STR += -D BOOTSPLASH_IMAGE=TRUE
|
2019-07-20 07:06:03 +02:00
|
|
|
endif
|
2022-02-09 09:25:39 +01:00
|
|
|
# BOOT_MANAGER_ESCAPE = FALSE
|
|
|
|
ifeq ($(CONFIG_TIANOCORE_BOOT_MANAGER_ESCAPE),y)
|
|
|
|
BUILD_STR += -D BOOT_MANAGER_ESCAPE=TRUE
|
|
|
|
endif
|
2022-02-04 08:41:16 +01:00
|
|
|
# BUILD_TARGETS = DEBUG
|
|
|
|
ifeq ($(CONFIG_TIANOCORE_RELEASE),y)
|
|
|
|
BUILD_STR += -b RELEASE
|
2016-06-03 00:42:29 +02:00
|
|
|
endif
|
2022-07-04 18:01:09 +02:00
|
|
|
# DISABLE_SERIAL_TERMINAL = FALSE
|
|
|
|
ifneq ($(CONFIG_TIANOCORE_SERIAL_SUPPORT),y)
|
|
|
|
BUILD_STR += -D DISABLE_SERIAL_TERMINAL=TRUE
|
|
|
|
endif
|
2022-02-09 09:27:29 +01:00
|
|
|
# FOLLOW_BGRT_SPEC = FALSE
|
|
|
|
ifeq ($(CONFIG_TIANOCORE_FOLLOW_BGRT_SPEC),y)
|
|
|
|
BUILD_STR += -D FOLLOW_BGRT_SPEC=TRUE
|
|
|
|
endif
|
2022-02-10 10:21:50 +01:00
|
|
|
# PRIORITIZE_INTERNAL = FALSE
|
|
|
|
ifeq ($(CONFIG_TIANOCORE_PRIORITIZE_INTERNAL),y)
|
|
|
|
BUILD_STR += -D PRIORITIZE_INTERNAL=TRUE
|
|
|
|
endif
|
2022-02-09 09:31:24 +01:00
|
|
|
# PS2_KEYBOARD_ENABLE = FALSE
|
|
|
|
ifeq ($(CONFIG_TIANOCORE_PS2_SUPPORT),y)
|
|
|
|
BUILD_STR += -D PS2_KEYBOARD_ENABLE=TRUE
|
|
|
|
endif
|
2022-02-04 08:41:16 +01:00
|
|
|
# PLATFORM_BOOT_TIMEOUT = 3
|
2022-03-18 14:58:41 +01:00
|
|
|
ifneq ($(CONFIG_TIANOCORE_BOOT_TIMEOUT),)
|
2022-02-04 08:41:16 +01:00
|
|
|
BUILD_STR += -D PLATFORM_BOOT_TIMEOUT=$(CONFIG_TIANOCORE_BOOT_TIMEOUT)
|
2022-02-09 09:31:24 +01:00
|
|
|
endif
|
|
|
|
# SIO_BUS_ENABLE = FALSE
|
|
|
|
ifeq ($(CONFIG_TIANOCORE_PS2_SUPPORT),y)
|
|
|
|
BUILD_STR += -D SIO_BUS_ENABLE=TRUE
|
|
|
|
endif
|
2022-02-09 09:30:07 +01:00
|
|
|
# SHELL_TYPE = BUILD_SHELL
|
|
|
|
ifneq ($(CONFIG_TIANOCORE_HAVE_EFI_SHELL),y)
|
|
|
|
BUILD_STR += -D SHELL_TYPE=NONE
|
2022-02-04 08:41:16 +01:00
|
|
|
endif
|
|
|
|
# USE_CBMEM_FOR_CONSOLE = FALSE
|
2021-06-02 22:19:38 +02:00
|
|
|
ifeq ($(CONFIG_TIANOCORE_CBMEM_LOGGING),y)
|
2022-02-04 08:41:16 +01:00
|
|
|
BUILD_STR += -D USE_CBMEM_FOR_CONSOLE=TRUE
|
2021-06-02 22:19:38 +02:00
|
|
|
endif
|
2022-02-13 22:19:19 +01:00
|
|
|
# SD_MMC_TIMEOUT = 1000000
|
|
|
|
ifneq ($(CONFIG_TIANOCORE_SD_MMC_TIMEOUT),)
|
|
|
|
BUILD_STR += -D SD_MMC_TIMEOUT=$(CONFIG_TIANOCORE_SD_MMC_TIMEOUT)
|
|
|
|
endif
|
2022-02-04 08:41:16 +01:00
|
|
|
#
|
|
|
|
# The below are legacy options only available in CorebootPayloadPkg:
|
|
|
|
#
|
|
|
|
# PCIE_BASE = 0
|
|
|
|
ifneq ($(CONFIG_ECAM_MMCONF_BASE_ADDRESS),)
|
|
|
|
BUILD_STR += -D PCIE_BASE=$(CONFIG_ECAM_MMCONF_BASE_ADDRESS)
|
2021-07-12 20:35:51 +02:00
|
|
|
endif
|
2022-02-04 08:41:16 +01:00
|
|
|
# USE_HPET_TIMER = FALSE
|
|
|
|
ifeq ($(CONFIG_TIANOCORE_USE_8254_TIMER),y)
|
|
|
|
BUILD_STR += -D USE_HPET_TIMER=TRUE
|
2021-10-28 23:46:17 +02:00
|
|
|
endif
|
|
|
|
|
2022-02-04 08:41:16 +01:00
|
|
|
bootloader = $(word 8,$(subst /, ,$(BUILD_STR)))
|
|
|
|
|
2022-02-23 16:55:24 +01:00
|
|
|
ifeq ($(CONFIG_TIANOCORE_CUSTOM),y)
|
|
|
|
ifneq ($(CONFIG_TIANOCORE_CUSTOM_BUILD_PARAMS),)
|
|
|
|
BUILD_STR += $(CONFIG_TIANOCORE_CUSTOM_BUILD_PARAMS)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2019-02-21 06:46:15 +01:00
|
|
|
all: clean build
|
2016-06-03 00:42:29 +02:00
|
|
|
|
|
|
|
$(project_dir):
|
2022-02-04 08:41:16 +01:00
|
|
|
echo " Cloning $(project_name) from $(CONFIG_TIANOCORE_REPOSITORY)"
|
|
|
|
git clone $(CONFIG_TIANOCORE_REPOSITORY) $(project_dir); \
|
|
|
|
cd $(project_dir);
|
2019-02-21 06:46:15 +01:00
|
|
|
|
|
|
|
update: $(project_dir)
|
2022-02-04 08:41:16 +01:00
|
|
|
if [ ! -d "$(project_dir)" ]; then \
|
|
|
|
git clone $(CONFIG_TIANOCORE_REPOSITORY) $(project_dir); \
|
|
|
|
fi
|
2019-02-21 06:46:15 +01:00
|
|
|
cd $(project_dir); \
|
2022-02-04 08:41:16 +01:00
|
|
|
echo " Fetching new commits from $(CONFIG_TIANOCORE_REPOSITORY)"; \
|
|
|
|
git fetch origin 2>/dev/null; \
|
|
|
|
if ! git rev-parse --verify -q $(CONFIG_TIANOCORE_TAG_OR_REV) >/dev/null; then \
|
|
|
|
echo " $(CONFIG_TIANOCORE_TAG_OR_REV) is not a valid git reference"; \
|
2019-02-21 06:46:15 +01:00
|
|
|
exit 1; \
|
2016-06-03 00:42:29 +02:00
|
|
|
fi; \
|
2022-05-23 21:12:28 +02:00
|
|
|
if git status --ignore-submodules=dirty | grep -q clean; then \
|
2022-02-04 08:41:16 +01:00
|
|
|
echo " Checking out $(project_name) revision $(CONFIG_TIANOCORE_TAG_OR_REV)"; \
|
|
|
|
git checkout --detach $(CONFIG_TIANOCORE_TAG_OR_REV) -f; \
|
2019-02-21 06:46:15 +01:00
|
|
|
else \
|
|
|
|
echo " Working directory not clean; will not overwrite"; \
|
2020-04-22 06:54:42 +02:00
|
|
|
fi; \
|
2022-02-04 08:41:16 +01:00
|
|
|
git submodule update --init --checkout
|
2016-06-03 00:42:29 +02:00
|
|
|
|
|
|
|
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." || \
|
2018-06-16 11:14:16 +02:00
|
|
|
( echo " Not found."; echo "ERROR: please_install uuid-dev (libuuid-devel)"; exit 1 )
|
2016-06-03 00:42:29 +02:00
|
|
|
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 )
|
|
|
|
|
2019-02-21 06:46:15 +01:00
|
|
|
build: update checktools
|
2022-06-16 22:32:33 +02:00
|
|
|
echo " ##### $(project_name) Build Summary #####"
|
|
|
|
echo " Repository: $(CONFIG_TIANOCORE_REPOSITORY)"
|
|
|
|
echo " Branch: $(CONFIG_TIANOCORE_TAG_OR_REV)"
|
|
|
|
echo " $(BUILD_STR)" | \
|
|
|
|
sed 's/-/\n /g' | sort | sed \
|
|
|
|
-e 's/a /Architecture: /g' \
|
|
|
|
-e 's/b /Release: /g' \
|
|
|
|
-e 's/D /Option: /g' \
|
|
|
|
-e 's/p /Payload: /g' \
|
|
|
|
-e 's/q /Build: Quiet/' \
|
|
|
|
-e 's/t /Toolchain: /'
|
2022-02-04 08:41:16 +01:00
|
|
|
unset CC; $(MAKE) -C $(project_dir)/BaseTools 2>&1
|
2020-04-29 22:29:27 +02:00
|
|
|
if [ -n "$(CONFIG_TIANOCORE_BOOTSPLASH_FILE)" ]; then \
|
2019-02-22 05:41:59 +01:00
|
|
|
echo " Copying custom bootsplash image"; \
|
|
|
|
case "$(CONFIG_TIANOCORE_BOOTSPLASH_FILE)" in \
|
2022-02-14 09:10:34 +01:00
|
|
|
/*) convert $(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \
|
|
|
|
BMP3:$(project_dir)/MdeModulePkg/Logo/Logo.bmp;; \
|
|
|
|
*) convert $(top)/$(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \
|
|
|
|
BMP3:$(project_dir)/MdeModulePkg/Logo/Logo.bmp;; \
|
2019-02-22 05:41:59 +01:00
|
|
|
esac \
|
|
|
|
fi; \
|
2016-06-03 00:42:29 +02:00
|
|
|
cd $(project_dir); \
|
|
|
|
export EDK_TOOLS_PATH=$(project_dir)/BaseTools; \
|
|
|
|
export WORKSPACE=$(project_dir); \
|
|
|
|
. ./edksetup.sh BaseTools; \
|
|
|
|
grep -q "COREBOOT" $(project_dir)/Conf/tools_def.txt; \
|
|
|
|
if [ $$? -ne 0 ]; then \
|
|
|
|
cat ../tools_def.txt >> $(project_dir)/Conf/tools_def.txt; \
|
|
|
|
fi; \
|
|
|
|
build $(BUILD_STR); \
|
2022-02-04 08:41:16 +01:00
|
|
|
mkdir -p $(project_dir)/../output
|
|
|
|
mv $(project_dir)/Build/$(bootloader)*/*/FV/UEFIPAYLOAD.fd $(project_dir)/../output/UEFIPAYLOAD.fd; \
|
2021-05-10 18:02:13 +02:00
|
|
|
git checkout MdeModulePkg/Logo/Logo.bmp > /dev/null 2>&1 || true
|
2016-06-03 00:42:29 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
test -d $(project_dir) && (cd $(project_dir); rm -rf Build; rm -f Conf/tools_def.txt) || exit 0
|
|
|
|
|
|
|
|
distclean:
|
2022-02-04 08:41:16 +01:00
|
|
|
rm -rf */
|
2016-06-03 00:42:29 +02:00
|
|
|
|
2019-02-21 06:46:15 +01:00
|
|
|
.PHONY: all update checktools config build clean distclean
|