From 4cdb46569d29e5af757e61ad4033e6a1f2d16f1f Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Thu, 25 Aug 2022 20:31:37 +0300 Subject: [PATCH] download/u-boot: Support applying patches from board dirs Boards may need different sets of patches to be applied to their U-Boot builds, copy the existing mechanism from the coreboot download script to the U-Boot download script. Signed-off-by: Alper Nebi Yasak --- resources/scripts/download/u-boot | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/resources/scripts/download/u-boot b/resources/scripts/download/u-boot index 86be55b..212a5a2 100755 --- a/resources/scripts/download/u-boot +++ b/resources/scripts/download/u-boot @@ -169,6 +169,20 @@ downloadfor() { "${ubtree}" return 1 fi + + for patch in resources/u-boot/${board}/patches/*.patch; do + if [ ! -f "${patch}" ]; then + continue + fi + + git -C "${ubtree}" am "$(pwd)/${patch}" || touch build_error + if [ -f build_error ]; then + printf "ERROR: %s: Unable to apply patch '%s' for board '%s' on tree '%s'" \ + "download/u-boot" "${patch}" "${board}" "${ubtree}" + git -C "${ubtree}" am --abort + return 1 + fi + done } strip_comments()