From 49e86b2cff6999bd1e0e3e8b2cb9fa655a59d241 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Thu, 22 Feb 2024 22:46:14 +0100 Subject: [PATCH] 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) --- lib/functions/compilation/uboot.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/functions/compilation/uboot.sh b/lib/functions/compilation/uboot.sh index 08b07501a8..60504e039e 100644 --- a/lib/functions/compilation/uboot.sh +++ b/lib/functions/compilation/uboot.sh @@ -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