When multiple images are built mkosi.postoutput runs once
per image, so add access to output directory and ensure
the hashes.cpio.rsasign archive accumulates the hashes for
all images before proceeding to the next stage
# SPDX-License-Identifier: LGPL-2.1-or-later
[Build]
SandboxTrees=/usr/src/packages/SOURCES:/usr/src/packages/SOURCES
+BuildSources=/usr/src/packages/OTHER:/usr/src/packages/OTHER
ToolsTree=
History=no
CacheDirectory=
mkdir -p "$nss_db" hashes
certutil -N -d sql:"$nss_db" --empty-password
+# When a single build has multiple images, postoutput is called for each image,
+# so make sure the hashes.cpio from the previous stages gets its content preserved
+if [ -f /usr/src/packages/OTHER/hashes.cpio.rsasign ]; then
+ pushd hashes
+ cpio -idm </usr/src/packages/OTHER/hashes.cpio.rsasign
+ popd
+fi
+
for f in "${UKIS[@]}"; do
test -f "${OUTPUTDIR}/${f}" || continue
if [ -f "${OUTPUTDIR}/${f%.efi}.pcrs" ]; then