uboot: make sure patches work for custom uboot builds too

This commit is contained in:
Gunjan Gupta
2024-02-04 00:49:20 +05:30
committed by Igor
parent cba5ad5dcd
commit 473548220c

View File

@@ -22,32 +22,6 @@ function maybe_make_clean_uboot() {
# this receives version target uboot_name uboottempdir uboot_target_counter toolchain as variables.
# also receives uboot_prefix, target_make, target_patchdir, target_files as input
function compile_uboot_target() {
local uboot_work_dir=""
uboot_work_dir="$(pwd)"
# outer scope variable: uboot_git_revision, validate that it is set
if [[ -z "${uboot_git_revision}" ]]; then
exit_with_error "uboot_git_revision is not set"
fi
display_alert "${uboot_prefix} Checking out to clean sources SHA1 ${uboot_git_revision}" "{$BOOTSOURCEDIR} for ${target_make}"
git checkout -f -q "${uboot_git_revision}"
# grab the prepatch version from Makefile
local uboot_prepatch_version=""
uboot_prepatch_version=$(grab_version "${uboot_work_dir}")
maybe_make_clean_uboot
# Python patching for u-boot!
do_with_hooks uboot_main_patching_python
# create patch for manual source changes
if [[ $CREATE_PATCHES == yes ]]; then
userpatch_create "u-boot"
return 0 # exit after this.
fi
# atftempdir comes from atf.sh's compile_atf()
if [[ -n $ATFSOURCE && -d "${atftempdir}" ]]; then
display_alert "Copying over bin/elf's from atftempdir" "${atftempdir}" "debug"
@@ -345,6 +319,32 @@ function compile_uboot() {
mkdir -p "$uboottempdir/usr/lib/u-boot" "$uboottempdir/usr/lib/$uboot_name" "$uboottempdir/DEBIAN"
local uboot_work_dir=""
uboot_work_dir="$(pwd)"
# outer scope variable: uboot_git_revision, validate that it is set
if [[ -z "${uboot_git_revision}" ]]; then
exit_with_error "uboot_git_revision is not set"
fi
display_alert "${uboot_prefix} Checking out to clean sources SHA1 ${uboot_git_revision}" "{$BOOTSOURCEDIR} for ${target_make}"
git checkout -f -q "${uboot_git_revision}"
# grab the prepatch version from Makefile
local uboot_prepatch_version=""
uboot_prepatch_version=$(grab_version "${uboot_work_dir}")
maybe_make_clean_uboot
# Python patching for u-boot!
do_with_hooks uboot_main_patching_python
# create patch for manual source changes
if [[ $CREATE_PATCHES == yes ]]; then
userpatch_create "u-boot"
return 0 # exit after this.
fi
# Allow extension-based u-boot bulding. We call the hook, and if EXTENSION_BUILT_UBOOT="yes" afterwards, we skip our own compilation.
# This is to make it easy to build vendor/downstream uboot with their own quirks.