From: Luca Boccassi Date: Tue, 25 Feb 2025 11:40:02 +0000 (+0000) Subject: mkosi-obs: fix compression detection X-Git-Tag: v26~349^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ade15f9403d5cabc0f286dd13ea35de7f28b76f;p=thirdparty%2Fmkosi.git mkosi-obs: fix compression detection The recompress variable is not reset in the loop, so if there is a compressed ddi and an uncompressed one, the variable will be true for the second one. Reset it. --- diff --git a/mkosi/resources/mkosi-obs/mkosi.build b/mkosi/resources/mkosi-obs/mkosi.build index 7f6aa94db..447fef12c 100755 --- a/mkosi/resources/mkosi-obs/mkosi.build +++ b/mkosi/resources/mkosi-obs/mkosi.build @@ -67,6 +67,8 @@ while read -r SIG; do unzstd "${DEST%efi}"raw*.zst rm -f "${DEST%efi}"raw*.zst recompress=1 + else + recompress=0 fi offset="$(systemd-repart --json=short "${DEST%efi}"raw* | jq -r '.[] | select(.type == "esp") | .offset')" @@ -198,6 +200,8 @@ while read -r SIG; do recompress=1 unzstd "$OUTPUTDIR/$(basename "${SIG%roothash.sig}")"raw*.zst rm -f "$OUTPUTDIR/$(basename "${SIG%roothash.sig}")"raw*.zst + else + recompress=0 fi ARGS=( @@ -245,10 +249,14 @@ mapfile -t AUTHVARS < <(find hashes/authvars -type f -name "*.auth") if (( ${#AUTHVARS[@]} > 0 )); then for ddi in "$OUTPUTDIR"/*.raw*; do test -f "$ddi" || continue + if [[ $ddi == *.zst ]]; then unzstd "${ddi}" recompress=1 + else + recompress=0 fi + offset="$(systemd-repart --json=short "${ddi%.zst}" | jq -r '.[] | select(.type == "esp") | .offset')" if [ -z "$offset" ] || [ "$offset" = "null" ]; then if [[ $ddi == *.zst ]]; then