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 <alpernebiyasak@gmail.com>
This commit is contained in:
Alper Nebi Yasak 2022-08-25 20:31:37 +03:00 committed by Denis 'GNUtoo' Carikli
parent 5c6d462611
commit 4cdb46569d
Signed by: GNUtoo
GPG Key ID: 5F5DFCC14177E263
1 changed files with 14 additions and 0 deletions

View File

@ -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()