build: fix IGNORE_UPDATES bootstrap placement

Ensure missing kernel/u-boot/ATF sources are fetched once even when IGNORE_UPDATES=yes, before compilation starts.
This commit is contained in:
OrangePi CM5 Builder 2026-04-09 19:00:23 +08:00
parent 33771550cf
commit f0226ed24e
1 changed files with 20 additions and 21 deletions

View File

@ -563,6 +563,26 @@ if [[ ${IGNORE_UPDATES} != yes ]]; then
BUILD_HOST_TOOLS
fi
# IGNORE_UPDATES=yes: prefer local trees, but bootstrap missing sources to avoid hard failures.
if [[ ${IGNORE_UPDATES} == yes ]]; then
# Kernel: if the tree isn't populated, it will be missing the top-level Makefile.
if [[ $BUILD_OPT =~ kernel|image && ! -f "${LINUXSOURCEDIR}/Makefile" ]]; then
display_alert "Kernel sources missing; downloading once" "(IGNORE_UPDATES=yes)" "wrn"
fetch_from_repo "$KERNELSOURCE" "$KERNELDIR" "$KERNELBRANCH" "yes"
fi
# U-Boot/ATF are required for u-boot/image builds; fetch once if missing.
if [[ $BOARDFAMILY != "cix" && $BUILD_OPT =~ u-boot|image && ! -f "${BOOTSOURCEDIR}/Makefile" ]]; then
display_alert "U-Boot sources missing; downloading once" "(IGNORE_UPDATES=yes)" "wrn"
fetch_from_repo "$BOOTSOURCE" "$BOOTDIR" "$BOOTBRANCH" "yes"
fi
if [[ -n ${ATFSOURCE} && $BUILD_OPT =~ u-boot|image && ! -f "${EXTER}/cache/sources/${ATFSOURCEDIR}/Makefile" ]]; then
display_alert "ATF sources missing; downloading once" "(IGNORE_UPDATES=yes)" "wrn"
fetch_from_repo "$ATFSOURCE" "${EXTER}/cache/sources/$ATFDIR" "$ATFBRANCH" "yes"
fi
fi
for option in $(tr ',' ' ' <<< "$CLEAN_LEVEL"); do
[[ $option != sources ]] && cleaning "$option"
done
@ -585,27 +605,6 @@ if [[ $BUILD_OPT == u-boot || $BUILD_OPT == image ]]; then
display_alert "File name" "${CHOSEN_UBOOT}_${REVISION}_${ARCH}.deb" "info"
fi
fi
else
# IGNORE_UPDATES=yes: prefer local trees, but bootstrap missing sources to avoid hard failures.
# Kernel: if the tree isn't populated, it will be missing the top-level Makefile.
if [[ $BUILD_OPT =~ kernel|image && ! -f "${LINUXSOURCEDIR}/Makefile" ]]; then
display_alert "Kernel sources missing; downloading once" "(IGNORE_UPDATES=yes)" "wrn"
fetch_from_repo "$KERNELSOURCE" "$KERNELDIR" "$KERNELBRANCH" "yes"
fi
# U-Boot/ATF are required for image builds; fetch once if missing.
if [[ $BOARDFAMILY != "cix" && $BUILD_OPT =~ u-boot|image && ! -f "${BOOTSOURCEDIR}/Makefile" ]]; then
display_alert "U-Boot sources missing; downloading once" "(IGNORE_UPDATES=yes)" "wrn"
fetch_from_repo "$BOOTSOURCE" "$BOOTDIR" "$BOOTBRANCH" "yes"
fi
if [[ -n ${ATFSOURCE} && $BUILD_OPT =~ u-boot|image && ! -f "${EXTER}/cache/sources/${ATFSOURCEDIR}/Makefile" ]]; then
display_alert "ATF sources missing; downloading once" "(IGNORE_UPDATES=yes)" "wrn"
fetch_from_repo "$ATFSOURCE" "${EXTER}/cache/sources/$ATFDIR" "$ATFBRANCH" "yes"
fi
fi
# Compile kernel if packed .deb does not exist or use the one from Orange Pi