]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
mkosi-obs: fix creating subfolder structure for signature cpio
authorLuca Boccassi <luca.boccassi@gmail.com>
Wed, 19 Feb 2025 15:15:12 +0000 (15:15 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 19 Feb 2025 17:51:57 +0000 (18:51 +0100)
The signature file will be stored in the same directory structure it was
picked from, to allow having multiple files with the same name

mkosi/resources/mkosi-obs/mkosi.build
mkosi/resources/mkosi-obs/mkosi.postoutput

index 6031ee157875d25d2f48d13ce4a0e9e3908d1cf7..bc0d09a9a41d502d07668df5a6b5592b24c3ccd3 100755 (executable)
@@ -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"
 
index 585eeb0dc9a72c811d9294343178861d1c1276ba..317865b78351464020aefe0ef47d888f0e495656 100755 (executable)
@@ -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