From bb6bc344477d55748033c286db707d75ab9c954c Mon Sep 17 00:00:00 2001 From: tranch Date: Fri, 11 Sep 2026 17:45:26 +0800 Subject: Fix booted image reference parsing --- build_files/patch-bazzite-rollback-helper.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build_files/patch-bazzite-rollback-helper.sh b/build_files/patch-bazzite-rollback-helper.sh index d5b3f21..eb4341f 100755 --- a/build_files/patch-bazzite-rollback-helper.sh +++ b/build_files/patch-bazzite-rollback-helper.sh @@ -17,7 +17,7 @@ patched_file=$(mktemp) awk ' /^signing_scheme\(\) \{/ { print "signing_scheme() {" - print " local current=$(rpm-ostree status -b --json | jq -r '\''.deployments[] | select(.booted == true) | .["container-image-reference"]'\'')" + print " local current=$(rpm-ostree status -b --json | jq -r '\''.deployments | map(select(.booted == true)) | first | .["container-image-reference"] // empty'\'')" print " local scheme=\"ostree-unverified-registry\"" print " [[ \"$current\" == *\"ostree-image-signed\"* ]] && scheme=\"ostree-image-signed\"" print " echo \"$scheme:docker://\"" @@ -25,7 +25,11 @@ awk ' print "" print "current_image_prefix() {" print " local current" - print " current=$(rpm-ostree status -b --json | jq -r '\''.deployments[] | select(.booted == true) | .["container-image-reference"]'\'')" + print " current=$(rpm-ostree status -b --json | jq -r '\''.deployments | map(select(.booted == true)) | first | .["container-image-reference"] // empty'\'')" + print " if [[ -z \"$current\" ]]; then" + print " echo \"Unable to determine the current booted image reference.\" >&2" + print " return 1" + print " fi" print " current=\"${current#ostree-image-signed:}\"" print " current=\"${current#ostree-unverified-registry:}\"" print " current=\"${current#docker://}\"" -- cgit v1.2.3