u-boot: call olddefconfig after config hooks; use pipetty instead of unbuffer for make

- also: cli `uboot-config` produces a defconfig diff (useful to create post_config_uboot_target)
This commit is contained in:
Ricardo Pardini 2024-02-22 22:46:14 +01:00 committed by Igor
parent c23fa92502
commit 49e86b2cff

View File

@ -75,7 +75,7 @@ function compile_uboot_target() {
declare -g if_error_detail_message="${uboot_prefix}Failed to configure u-boot ${version} $BOOTCONFIG ${target_make}"
run_host_command_logged CCACHE_BASEDIR="$(pwd)" PATH="${toolchain}:${toolchain2}:${PATH}" \
"KCFLAGS=-fdiagnostics-color=always" \
unbuffer make "$CTHREADS" "$BOOTCONFIG" "CROSS_COMPILE=\"$CCACHE $UBOOT_COMPILER\""
pipetty make "${CTHREADS}" "${BOOTCONFIG}" "CROSS_COMPILE=\"${CCACHE} ${UBOOT_COMPILER}\""
# armbian specifics u-boot settings
[[ -f .config ]] && sed -i 's/CONFIG_LOCALVERSION=""/CONFIG_LOCALVERSION="-armbian"/g' .config
@ -179,12 +179,27 @@ function compile_uboot_target() {
Also the only chance to change the (local) array `uboot_cflags_array`.
POST_CONFIG_UBOOT_TARGET
# make olddefconfig, so changes made in hook above are consolidated
display_alert "${uboot_prefix}Updating u-boot config with olddefconfig" "${version} ${target_make}" "info"
run_host_command_logged CCACHE_BASEDIR="$(pwd)" PATH="${toolchain}:${toolchain2}:${PATH}" \
"KCFLAGS=-fdiagnostics-color=always" \
pipetty make "${CTHREADS}" "olddefconfig" "CROSS_COMPILE=\"${CCACHE} ${UBOOT_COMPILER}\""
if [[ "${UBOOT_CONFIGURE:-"no"}" == "yes" ]]; then
display_alert "Configuring u-boot" "UBOOT_CONFIGURE=yes; experimental" "warn"
run_host_command_dialog make menuconfig
display_alert "Exporting saved config" "UBOOT_CONFIGURE=yes; experimental" "warn"
run_host_command_logged make savedefconfig
run_host_command_logged cp -v defconfig "${DEST}/defconfig-uboot-${BOARD}-${BRANCH}"
# check if we can find configs/${BOOTCONFIG}, and if so, output a diff between that and the new saved defconfig
if [[ -f "configs/${BOOTCONFIG}" ]]; then
display_alert "Diffing ${BOOTCONFIG} and new defconfig" "UBOOT_CONFIGURE=yes; experimental" "warn"
run_host_command_logged diff -u --color=always "configs/${BOOTCONFIG}" "${DEST}/defconfig-uboot-${BOARD}-${BRANCH}" "2>&1" "|| true" # no errors please, all to stdout
fi
display_alert "Exporting saved config (experimental)" "${DEST}/defconfig-uboot-${BOARD}-${BRANCH}" "warn"
return 0 # exit after this
fi