SandboxTrees=/usr/src/packages/SOURCES:/usr/src/packages/SOURCES
[Output]
-SplitArtifacts=pcrs
+SplitArtifacts=pcrs,roothash
[Validation]
SignExpectedPcrCertificate=/usr/src/packages/SOURCES/_projectcert.crt
UKIS=( "$(find "$OUTPUTDIR" -type f -name "*.efi" -printf '%P\n')" )
declare -a KERNELS
KERNELS=( "$(find "$OUTPUTDIR" -type f -name "vmlinu*" -printf '%P\n')" )
+declare -a ROOTHASHES
+ROOTHASHES=( "$(find "$OUTPUTDIR" -type f -name "*.roothash" -printf '%P\n')" )
-if ((${#UKIS[@]} == 0)) && ((${#KERNELS[@]} == 0)); then
+if ((${#UKIS[@]} == 0)) && ((${#KERNELS[@]} == 0)) && ((${#ROOTHASHES[@]} == 0)); then
echo "No unsigned files found, exiting"
exit 0
fi
pesign --force -n sql:"$nss_db" -i "${OUTPUTDIR}/${f}" -E "hashes/kernels/$f"
done
+for f in "${ROOTHASHES[@]}"; do
+ test -f "${OUTPUTDIR}/${f}" || continue
+ mkdir -p hashes/roothashes
+ cp "${OUTPUTDIR}/$f" hashes/roothashes/
+done
+
# Pack everything into a CPIO archive and place it where OBS expects it
pushd hashes
find . -type f | cpio -H newc -o >"$OUTPUTDIR/hashes.cpio.rsasign"