From 391007ae9aa398ab88f0f4afba8a1bd61b14e196 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Tue, 7 Jan 2025 12:12:18 +0100 Subject: [PATCH] nanopct6(-lts): u-boot: edge: fix for pulling devicetree-rebasing using git - otherwise git breaks when unconfigured --- config/boards/nanopct6.conf | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/config/boards/nanopct6.conf b/config/boards/nanopct6.conf index beb5e4451f..1567c978a4 100644 --- a/config/boards/nanopct6.conf +++ b/config/boards/nanopct6.conf @@ -72,13 +72,21 @@ function pre_config_uboot_target__nanoptc6_patch_uboot_dtsi_for_ums() { # @TODO this probably can be removed for 2025.04 function pre_config_uboot_target__nanoptc6_patch_uboot_dtsi_for_ums() { [[ "${BRANCH}" != "edge" ]] && return 0 + display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: pull in upstream/dts for UMS" "info" - regular_git add . || true - regular_git commit -m "commit pre update OF upstream so that tree is clean" || true - run_host_command_logged bash tools/update-subtree.sh pull dts v6.13-rc5-dts "||" true # do not fail as conflicts are expected - regular_git checkout --theirs dts/upstream # "accept theirs" on all conflicts - regular_git add dts/upstream - regular_git commit -m "Update OF upstream to v6.13-rc5-dts and accept theirs on all conflicts" + # Need to specify params and envs so git doesn't break when commiter/author/gpg/HOME/etc is unset. + declare -a common_envs=("HOME=${HOME}" "PATH=${PATH}") + declare -a git_params=("-c" "commit.gpgsign=false") + declare -a commit_params=(--author="${MAINTAINER} <${MAINTAINERMAIL}>") + declare -a commit_envs=("GIT_COMMITTER_NAME=${MAINTAINER}" "GIT_COMMITTER_EMAIL=${MAINTAINERMAIL}" "GIT_AUTHOR_NAME=${MAINTAINER}" "GIT_AUTHOR_EMAIL=${MAINTAINERMAIL}") + + run_host_command_logged env -i "${common_envs[@]@Q}" git add . || true + run_host_command_logged env -i "${common_envs[@]@Q}" "${commit_envs[@]@Q}" git "${git_params[@]@Q}" commit "${commit_params[@]@Q}" -m "'commit pre update OF upstream so that tree is clean'" || true + display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: running tools/update-subtree.sh" "info" + run_host_command_logged env -i "${common_envs[@]@Q}" "${commit_envs[@]@Q}" bash tools/update-subtree.sh pull dts v6.13-rc5-dts "||" true # do not fail as conflicts are expected + run_host_command_logged env -i "${common_envs[@]@Q}" git checkout --theirs dts/upstream + run_host_command_logged env -i "${common_envs[@]@Q}" git add dts/upstream + run_host_command_logged env -i "${common_envs[@]@Q}" "${commit_envs[@]@Q}" git "${git_params[@]@Q}" commit "${commit_params[@]@Q}" -m "'Update OF upstream to v6.13-rc5-dts and accept theirs on all conflicts'" } function post_config_uboot_target__extra_configs_for_nanopct6_mainline_environment_in_spi() {