From patchwork Wed Mar 18 09:57:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 243798 List-Id: U-Boot discussion From: ynezz at true.cz (=?UTF-8?q?Petr=20=C5=A0tetiar?=) Date: Wed, 18 Mar 2020 10:57:48 +0100 Subject: [RFC PATCH 1/9] Kconfig: add config options for automatic builds In-Reply-To: <20200318095757.9365-1-ynezz@true.cz> References: <20200318095757.9365-1-ynezz@true.cz> Message-ID: <20200318095757.9365-2-ynezz@true.cz> Currently its not possible to distinguish between normal builds and builds performed by the build bots/CI, thus leading to a workarounds like for example in 4c78028737c3 ("mksunxi_fit_atf.sh: Allow for this to complete when bl31.bin is missing"), where producing unusable binaries is prefered in favor of a green automatic builds. So lets try to fix this properly, add BUILDBOT config options which could be set on the build bots/CI and the codebase can use this new config option to workaround the issues in more clear manner. Signed-off-by: Petr ?tetiar --- Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Kconfig b/Kconfig index 66148ce47790..24960cf7abbf 100644 --- a/Kconfig +++ b/Kconfig @@ -20,6 +20,18 @@ config BROKEN This option cannot be enabled. It is used as dependency for broken and incomplete features. +config BUILDBOT + bool "Set build defaults for automatic builds" + help + This option allows setting of usable defaults for automatic builds. + +config BUILDBOT_BROKEN_BINARIES + bool "Allow building of broken binaries" + depends on BUILDBOT + help + Resulting images wont be used for runtime testing, thus completition + of build is preferred. + config DEPRECATED bool help From patchwork Wed Mar 18 09:57:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 243802 List-Id: U-Boot discussion From: ynezz at true.cz (=?UTF-8?q?Petr=20=C5=A0tetiar?=) Date: Wed, 18 Mar 2020 10:57:49 +0100 Subject: [RFC PATCH 2/9] Makefile: export config options for automatic builds In-Reply-To: <20200318095757.9365-1-ynezz@true.cz> References: <20200318095757.9365-1-ynezz@true.cz> Message-ID: <20200318095757.9365-3-ynezz@true.cz> Make config options related to build bots accessible within the scripts. Signed-off-by: Petr ?tetiar --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index fa687f13a588..44776b8efcc4 100644 --- a/Makefile +++ b/Makefile @@ -426,6 +426,11 @@ KBUILD_AFLAGS += $(call cc-option,-fno-PIE) UBOOTRELEASE = $(shell cat include/config/uboot.release 2> /dev/null) UBOOTVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) +BUILDBOT = $(CONFIG_BUILDBOT) +BUILDBOT_BROKEN_BINARIES = $(CONFIG_BUILDBOT_BROKEN_BINARIES) + +export BUILDBOT BUILDBOT_BROKEN_BINARIES + export VERSION PATCHLEVEL SUBLEVEL UBOOTRELEASE UBOOTVERSION export ARCH CPU BOARD VENDOR SOC CPUDIR BOARDDIR export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC From patchwork Wed Mar 18 09:57:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 243801 List-Id: U-Boot discussion From: ynezz at true.cz (=?UTF-8?q?Petr=20=C5=A0tetiar?=) Date: Wed, 18 Mar 2020 10:57:50 +0100 Subject: [RFC PATCH 3/9] mksunxi_fit_atf.sh: produce working binaries by default In-Reply-To: <20200318095757.9365-1-ynezz@true.cz> References: <20200318095757.9365-1-ynezz@true.cz> Message-ID: <20200318095757.9365-4-ynezz@true.cz> At this moment unusable binaries are produced if bl31.bin file is missing in order to allow passing of various CI tests. This intention of broken binaries has to be now explicitly confirmed via new BUILDBOT_BROKEN_BINARIES config option, so usable binaries are produced by default from now on. Signed-off-by: Petr ?tetiar --- board/sunxi/mksunxi_fit_atf.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/board/sunxi/mksunxi_fit_atf.sh b/board/sunxi/mksunxi_fit_atf.sh index 88ad71974706..708b4248549d 100755 --- a/board/sunxi/mksunxi_fit_atf.sh +++ b/board/sunxi/mksunxi_fit_atf.sh @@ -8,9 +8,13 @@ [ -z "$BL31" ] && BL31="bl31.bin" if [ ! -f $BL31 ]; then - echo "WARNING: BL31 file $BL31 NOT found, resulting binary is non-functional" >&2 - echo "Please read the section on ARM Trusted Firmware (ATF) in board/sunxi/README.sunxi64" >&2 - BL31=/dev/null + if [ "$BUILDBOT_BROKEN_BINARIES" = "y" ]; then + BL31=/dev/null + else + echo "ERROR: BL31 file $BL31 NOT found, resulting binary is non-functional" >&2 + echo "Please read the section on ARM Trusted Firmware (ATF) in board/sunxi/README.sunxi64" >&2 + exit 1 + fi fi if grep -q "^CONFIG_MACH_SUN50I_H6=y" .config; then From patchwork Wed Mar 18 09:57:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 243803 List-Id: U-Boot discussion From: ynezz at true.cz (=?UTF-8?q?Petr=20=C5=A0tetiar?=) Date: Wed, 18 Mar 2020 10:57:51 +0100 Subject: [RFC PATCH 4/9] make_fit_atf.py: produce working binaries by default In-Reply-To: <20200318095757.9365-1-ynezz@true.cz> References: <20200318095757.9365-1-ynezz@true.cz> Message-ID: <20200318095757.9365-5-ynezz@true.cz> At this moment unusable binaries are produced if bl31.elf file is missing in order to allow passing of various CI tests. This intention of broken binaries has to be now explicitly confirmed via new BUILDBOT_BROKEN_BINARIES config option, so usable binaries are produced by default from now on. Signed-off-by: Petr ?tetiar --- arch/arm/mach-rockchip/make_fit_atf.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py index d15c32b30329..4c55a87b51f2 100755 --- a/arch/arm/mach-rockchip/make_fit_atf.py +++ b/arch/arm/mach-rockchip/make_fit_atf.py @@ -196,17 +196,20 @@ def unpack_elf(filename): def main(): uboot_elf = "./u-boot" fit_its = sys.stdout + broken_binaries = os.getenv("BUILDBOT_BROKEN_BINARIES") == "y" if "BL31" in os.environ: bl31_elf=os.getenv("BL31"); elif os.path.isfile("./bl31.elf"): bl31_elf = "./bl31.elf" - else: + elif broken_binaries: os.system("echo 'int main(){}' > bl31.c") os.system("${CROSS_COMPILE}gcc -c bl31.c -o bl31.elf") bl31_elf = "./bl31.elf" + else: logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG) - logging.warning(' BL31 file bl31.elf NOT found, resulting binary is non-functional') - logging.warning(' Please read Building section in doc/README.rockchip') + logging.error(' BL31 file bl31.elf NOT found, resulting binary would be non-functional') + logging.error(' Please read Building section in doc/README.rockchip') + sys.exit(1) if "TEE" in os.environ: tee_elf = os.getenv("TEE") From patchwork Wed Mar 18 09:57:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 243799 List-Id: U-Boot discussion From: ynezz at true.cz (=?UTF-8?q?Petr=20=C5=A0tetiar?=) Date: Wed, 18 Mar 2020 10:57:52 +0100 Subject: [RFC PATCH 5/9] fit_spl_optee.sh: produce working binaries by default In-Reply-To: <20200318095757.9365-1-ynezz@true.cz> References: <20200318095757.9365-1-ynezz@true.cz> Message-ID: <20200318095757.9365-6-ynezz@true.cz> At this moment unusable binaries are produced if tee.bin file is missing in order to allow passing of various CI tests. This intention of broken images has to be now explicitly confirmed via new BUILDBOT_BROKEN_BINARIES config option, so usable binaries are produced by default from now on. Signed-off-by: Petr ?tetiar --- arch/arm/mach-rockchip/fit_spl_optee.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-rockchip/fit_spl_optee.sh b/arch/arm/mach-rockchip/fit_spl_optee.sh index 4118472d9f22..bdf61c4ba16d 100755 --- a/arch/arm/mach-rockchip/fit_spl_optee.sh +++ b/arch/arm/mach-rockchip/fit_spl_optee.sh @@ -11,9 +11,13 @@ [ -z "$TEE" ] && TEE="tee.bin" if [ ! -f $TEE ]; then - echo "WARNING: TEE file $TEE NOT found, U-Boot.itb is non-functional" >&2 - echo "Please export path for TEE or copy tee.bin to U-Boot folder" >&2 - TEE=/dev/null + if [ "$BUILDBOT_BROKEN_BINARIES" = "y" ]; then + TEE=/dev/null + else + echo "ERROR: TEE file $TEE NOT found, U-Boot.itb is non-functional" >&2 + echo "Please export path for TEE or copy tee.bin to U-Boot folder" >&2 + exit 1 + fi fi dtname=$1 From patchwork Wed Mar 18 09:57:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 243800 List-Id: U-Boot discussion From: ynezz at true.cz (=?UTF-8?q?Petr=20=C5=A0tetiar?=) Date: Wed, 18 Mar 2020 10:57:53 +0100 Subject: [RFC PATCH 6/9] mkimage_fit_atf.sh: produce working binaries by default In-Reply-To: <20200318095757.9365-1-ynezz@true.cz> References: <20200318095757.9365-1-ynezz@true.cz> Message-ID: <20200318095757.9365-7-ynezz@true.cz> At this moment unusable binaries are produced if bl31.bin file is missing in order to allow passing of various CI tests. This intention of broken binaries has to be now explicitly confirmed via new BUILDBOT_BROKEN_BINARIES config option, so usable binaries are produced by default from now on. Signed-off-by: Petr ?tetiar --- arch/arm/mach-zynqmp/mkimage_fit_atf.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-zynqmp/mkimage_fit_atf.sh b/arch/arm/mach-zynqmp/mkimage_fit_atf.sh index 1e770ba111d3..5effe05abdee 100755 --- a/arch/arm/mach-zynqmp/mkimage_fit_atf.sh +++ b/arch/arm/mach-zynqmp/mkimage_fit_atf.sh @@ -29,11 +29,15 @@ else fi if [ ! -f $BL31 ]; then - echo "WARNING: BL31 file $BL31 NOT found, resulting binary is non-functional" >&2 - BL31=/dev/null - # But U-Boot proper could be loaded in EL3 by specifying - # firmware = "uboot"; - # instead of "atf" in config node + if [ "$BUILDBOT_BROKEN_BINARIES" = "y" ]; then + BL31=/dev/null + # But U-Boot proper could be loaded in EL3 by specifying + # firmware = "uboot"; + # instead of "atf" in config node + else + echo "ERROR: BL31 file $BL31 NOT found, resulting binary is non-functional" >&2 + exit 1 + fi fi cat << __HEADER_EOF From patchwork Wed Mar 18 09:57:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 243804 List-Id: U-Boot discussion From: ynezz at true.cz (=?UTF-8?q?Petr=20=C5=A0tetiar?=) Date: Wed, 18 Mar 2020 10:57:54 +0100 Subject: [RFC PATCH 7/9] fit_spl_atf.sh: produce working binaries by default In-Reply-To: <20200318095757.9365-1-ynezz@true.cz> References: <20200318095757.9365-1-ynezz@true.cz> Message-ID: <20200318095757.9365-8-ynezz@true.cz> At this moment unusable binaries are produced if either bl31.bin or rk3399m0.bin files are missing in order to allow passing of various CI tests. This intention of broken binaries has to be now explicitly confirmed via new BUILDBOT_BROKEN_BINARIES config option, so usable binaries are produced by default from now on. Signed-off-by: Petr ?tetiar --- .../puma_rk3399/fit_spl_atf.sh | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh b/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh index 420e7daf4ceb..b53cd5f3de30 100755 --- a/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh +++ b/board/theobroma-systems/puma_rk3399/fit_spl_atf.sh @@ -14,17 +14,25 @@ [ -z "$BL31" ] && BL31="bl31.bin" if [ ! -f $BL31 ]; then - echo "WARNING: BL31 file $BL31 NOT found, resulting binary is non-functional" >&2 - echo "Please read Building section in doc/README.rockchip" >&2 - BL31=/dev/null + if [ "$BUILDBOT_BROKEN_BINARIES" = "y" ]; then + BL31=/dev/null + else + echo "ERROR: BL31 file $BL31 NOT found, resulting binary is non-functional" >&2 + echo "Please read Building section in doc/README.rockchip" >&2 + exit 1 + fi fi [ -z "$PMUM0" ] && PMUM0="rk3399m0.bin" if [ ! -f $PMUM0 ]; then - echo "WARNING: PMUM0 file $PMUM0 NOT found, resulting binary is non-functional" >&2 - echo "Please read Building section in doc/README.rockchip" >&2 - PMUM0=/dev/null + if [ "$BUILDBOT_BROKEN_BINARIES" = "y" ]; then + PMUM0=/dev/null + else + echo "ERROR: PMUM0 file $PMUM0 NOT found, resulting binary is non-functional" >&2 + echo "Please read Building section in doc/README.rockchip" >&2 + exit 1 + fi fi cat << __HEADER_EOF From patchwork Wed Mar 18 09:57:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 243805 List-Id: U-Boot discussion From: ynezz at true.cz (=?UTF-8?q?Petr=20=C5=A0tetiar?=) Date: Wed, 18 Mar 2020 10:57:55 +0100 Subject: [RFC PATCH 8/9] k3_fit_atf.sh: produce working binaries by default In-Reply-To: <20200318095757.9365-1-ynezz@true.cz> References: <20200318095757.9365-1-ynezz@true.cz> Message-ID: <20200318095757.9365-9-ynezz@true.cz> At this moment unusable binaries are produced if either bl31.bin or bl32.bin files are missing in order to allow passing of various CI tests. This intention of broken binaries has to be now explicitly confirmed via new BUILDBOT_BROKEN_BINARIES config option, so usable binaries are produced by default from now on. Signed-off-by: Petr ?tetiar --- tools/k3_fit_atf.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/k3_fit_atf.sh b/tools/k3_fit_atf.sh index 4e9f69c08789..8e342b46c97b 100755 --- a/tools/k3_fit_atf.sh +++ b/tools/k3_fit_atf.sh @@ -10,15 +10,23 @@ [ -z "$ATF" ] && ATF="bl31.bin" if [ ! -f $ATF ]; then - echo "WARNING ATF file $ATF NOT found, resulting binary is non-functional" >&2 - ATF=/dev/null + if [ "$BUILDBOT_BROKEN_BINARIES" = "y" ]; then + ATF=/dev/null + else + echo "ERROR: ATF file $ATF NOT found, resulting binary is non-functional" >&2 + exit 1 + fi fi [ -z "$TEE" ] && TEE="bl32.bin" if [ ! -f $TEE ]; then - echo "WARNING OPTEE file $TEE NOT found, resulting might be non-functional" >&2 - TEE=/dev/null + if [ "$BUILDBOT_BROKEN_BINARIES" = "y" ]; then + TEE=/dev/null + else + echo "ERROR: OPTEE file $TEE NOT found, resulting might be non-functional" >&2 + exit 1 + fi fi if [ ! -z "$IS_HS" ]; then From patchwork Wed Mar 18 09:57:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 243806 List-Id: U-Boot discussion From: ynezz at true.cz (=?UTF-8?q?Petr=20=C5=A0tetiar?=) Date: Wed, 18 Mar 2020 10:57:56 +0100 Subject: [RFC PATCH 9/9] mkimage_fit_opensbi.sh: produce working binaries by default In-Reply-To: <20200318095757.9365-1-ynezz@true.cz> References: <20200318095757.9365-1-ynezz@true.cz> Message-ID: <20200318095757.9365-10-ynezz@true.cz> At this moment unusable binaries are produced if bl31.bin file is missing in order to allow passing of various CI tests. This intention of broken binaries has to be now explicitly confirmed via new BUILDBOT_BROKEN_BINARIES config option, so usable binaries are produced by default from now on. Signed-off-by: Petr ?tetiar --- arch/riscv/lib/mkimage_fit_opensbi.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/riscv/lib/mkimage_fit_opensbi.sh b/arch/riscv/lib/mkimage_fit_opensbi.sh index d6f95e5bfd2c..bf0968e683d2 100755 --- a/arch/riscv/lib/mkimage_fit_opensbi.sh +++ b/arch/riscv/lib/mkimage_fit_opensbi.sh @@ -17,8 +17,12 @@ if [ -z "$OPENSBI_LOAD_ADDR" ]; then fi if [ ! -f $OPENSBI ]; then - echo "WARNING: OpenSBI binary \"$OPENSBI\" not found, resulting binary is not functional." >&2 - OPENSBI=/dev/null + if [ "$BUILDBOT_BROKEN_BINARIES" = "y" ]; then + OPENSBI=/dev/null + else + echo "ERROR: OpenSBI binary \"$OPENSBI\" not found, resulting binary would be non-functional." >&2 + exit 1 + fi fi cat << __HEADER_EOF