From: Luca Boccassi Date: Wed, 19 Feb 2025 15:15:12 +0000 (+0000) Subject: mkosi-obs: fix creating subfolder structure for signature cpio X-Git-Tag: v26~366 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d58972ffa73fde5e790a47a461948235752c220;p=thirdparty%2Fmkosi.git mkosi-obs: fix creating subfolder structure for signature cpio The signature file will be stored in the same directory structure it was picked from, to allow having multiple files with the same name --- diff --git a/mkosi/resources/mkosi-obs/mkosi.build b/mkosi/resources/mkosi-obs/mkosi.build index 6031ee157..bc0d09a9a 100755 --- a/mkosi/resources/mkosi-obs/mkosi.build +++ b/mkosi/resources/mkosi-obs/mkosi.build @@ -40,6 +40,7 @@ rm -f "$OUTPUTDIR/hashes.cpio.rsasign*" "$OUTPUTDIR"/*.sha* # First step: if there are UKI signatures, attach them while read -r SIG; do infile="${SIG%.sig}" + test -f "/usr/src/packages/SOURCES/$infile" || continue sattrs="hashes/ukis/${SIG%.sig}" test -s "$sattrs" diff --git a/mkosi/resources/mkosi-obs/mkosi.postoutput b/mkosi/resources/mkosi-obs/mkosi.postoutput index 585eeb0dc..317865b78 100755 --- a/mkosi/resources/mkosi-obs/mkosi.postoutput +++ b/mkosi/resources/mkosi-obs/mkosi.postoutput @@ -35,14 +35,14 @@ for f in "${UKIS[@]}"; do echo -n "$pol" | tr '[:lower:]' '[:upper:]' | basenc --base16 --decode >"hashes/pcrs/${f}/${pol}" done < <(jq -r 'to_entries[] | .value[].pol' <"${OUTPUTDIR}/${f%.efi}.pcrs") else - mkdir -p hashes/ukis + mkdir -p "$(dirname "hashes/ukis/$f")" pesign --force -n sql:"$nss_db" -i "${OUTPUTDIR}/${f}" -E "hashes/ukis/$f" fi done for f in "${KERNELS[@]}"; do test -f "${OUTPUTDIR}/${f}" || continue - mkdir -p hashes/kernels + mkdir -p "$(dirname "hashes/kernels/$f")" pesign --force -n sql:"$nss_db" -i "${OUTPUTDIR}/${f}" -E "hashes/kernels/$f" done