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 <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31781>
This commit is contained in:
Daniel Stone 2024-10-21 13:04:05 +01:00 committed by Marge Bot
parent 24a9fe6655
commit ff97a8b006

View File

@ -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