From dbc1efbc9ee19c6bd30a421373fdf1116ea351da Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Tue, 28 Jul 2026 13:14:03 -0500 Subject: [PATCH 1/2] Fixed ci scripts to work properly on proxied hosts $(pwd) was the jenkins workspace directory which does not have proxy-target.txt so revert back to $HOME rhel/centos-7 need centos-7-setup-devtoolset-11.sh and also realpath to find the right place to source. Limit that to hosts which have realpath and fail fast on rhel/centos-7 hosts that do not have realpath available. Ticket: ENT-11241 Changelog: none (cherry picked from commit 90b666a82df39efb07af4a9567725ca66dbd337e) --- ci/fix-buildhost.sh | 11 ++++++++--- ci/initialize-build-host.sh | 10 +++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ci/fix-buildhost.sh b/ci/fix-buildhost.sh index beea92f0e..d825bfc04 100755 --- a/ci/fix-buildhost.sh +++ b/ci/fix-buildhost.sh @@ -1,13 +1,18 @@ #!/usr/bin/env bash # it is expected that this file is sourced, not executed directly set -ex -my_path="$(realpath "${BASH_SOURCE[0]}")" -my_dir="$(dirname "$my_path")" if [ -f /etc/os-release ]; then source /etc/os-release if [ "$ID" = "centos" ] && [ "$VERSION_ID" = "7" ]; then - source "$my_dir"/centos-7-setup-devtoolset-11.sh + if command -v realpath >/dev/null; then + my_path="$(realpath "${BASH_SOURCE[0]}")" + my_dir="$(dirname "$my_path")" + source "$my_dir"/centos-7-setup-devtoolset-11.sh + else + echo "FAIL: could not find realpath command on rhel/centos-7 to source needed centos-7-setup-devtoolset-11.sh" + exit 1 + fi fi fi diff --git a/ci/initialize-build-host.sh b/ci/initialize-build-host.sh index 7080d2dd4..eefbbc937 100644 --- a/ci/initialize-build-host.sh +++ b/ci/initialize-build-host.sh @@ -8,7 +8,7 @@ # serial execution of initialization steps. It will post the output when # finished, if any. # -# 2. If $(pwd)/proxy-target.txt exists, it means this is a proxy host, and the +# 2. If $HOME/proxy-target.txt exists, it means this is a proxy host, and the # real build machine is on the host specified by the login details inside # that file. If the file does not exist, we are on the build slave itself. # After figuring that stuff out, the script will run the rest of the original @@ -227,7 +227,7 @@ reset_nested_vm() { fi if [ ! -z "$login" ] then - ip=`sed 's/.*@//' $(pwd)/proxy-target.txt` + ip=`sed 's/.*@//' $HOME/proxy-target.txt` if sudo arp | grep -q $ip then sudo arp -d $ip @@ -235,7 +235,7 @@ reset_nested_vm() { fi # TODO, remove this, we don't need or use or test nested-vms $HOME/mender-qa/scripts/nested-vm.sh $HOME/*.qcow2 - login="`cat $(pwd)/proxy-target.txt`" + login="`cat $HOME/proxy-target.txt`" if $RSH $login true then echo "Nested VM is back up, it seems. Happily continuing!" @@ -277,13 +277,13 @@ reset_nested_vm() { fi } -if [ -f $(pwd)/proxy-target.txt ] +if [ -f $HOME/proxy-target.txt ] then # -------------------------------------------------------------------------- # Check target machine health. # -------------------------------------------------------------------------- - login="$(cat $(pwd)/proxy-target.txt)" + login="$(cat $HOME/proxy-target.txt)" if [ ! -z "$login" ] && $RSH $login true then From 12906d564bc5eb13b6df114a2a7b2a147e0f78cf Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Tue, 28 Jul 2026 13:19:47 -0500 Subject: [PATCH 2/2] Fixed unpack-tarballs to use more portable find command arguments Some find commands require a path to search in. Ticket: ENT-11241 Changelog: none (cherry picked from commit dd61423a807a1bcf16c03e19534135e5aca1d22e) --- build-scripts/unpack-tarballs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-scripts/unpack-tarballs b/build-scripts/unpack-tarballs index 01f67afb8..bb67aa9af 100755 --- a/build-scripts/unpack-tarballs +++ b/build-scripts/unpack-tarballs @@ -68,5 +68,5 @@ log_debug "UNPACKING MASTERFILES TARBALL: $MASTERFILES_TARBALL AND SYMLINKING ma # We want globbing here gzip -dc $MASTERFILES_TARBALL | tar -xf - # the masterfiles tarball would match cfengine-masterfiles-* so find the unpacked dir specifically -_cfmpfdir=$(find -type d -name 'cfengine-masterfiles-*') +_cfmpfdir=$(find . -type d -name 'cfengine-masterfiles-*') ln -s "$_cfmpfdir" masterfiles