From ff97a8b006ea64515096ad75374379173bcce80a Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 21 Oct 2024 13:04:05 +0100 Subject: [PATCH] ci/firmware: Allow calling firmware as sourced script Most of our build scripts are sourced rather than executed in a subshell, so they inherit our environment. Allow our firmware script to do the same by not exiting when we have no firmware to download, as is the case on arm32. Signed-off-by: Daniel Stone Part-of: --- .gitlab-ci/container/get-firmware-from-source.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci/container/get-firmware-from-source.sh b/.gitlab-ci/container/get-firmware-from-source.sh index 0696e7c30a8..c3034a2a119 100755 --- a/.gitlab-ci/container/get-firmware-from-source.sh +++ b/.gitlab-ci/container/get-firmware-from-source.sh @@ -7,16 +7,15 @@ set -e ROOTFS=$1 FIRMWARE_FILES=$2 -FIRMWARE=$(jq -s '.' $(echo "$FIRMWARE_FILES")) -if [ -z "$FIRMWARE" ] || [ "$(echo "$FIRMWARE" | jq '. | length')" -eq 0 ]; then - echo "FIRMWARE is not set or is empty." - exit +if [ -n "${FIRMWARE_FILES:-}" ]; then + FIRMWARE=$(jq -s '.' $(echo "$FIRMWARE_FILES")) +else + FIRMWARE="" fi if ! echo "$FIRMWARE" | jq empty; then echo "FIRMWARE contains invalid JSON." - exit fi for item in $(echo "$FIRMWARE" | jq -c '.[]'); do