summaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
authorshmalebx9 <thonkpeasant@protonmail.com>2023-04-02 18:06:08 -0600
committerLeah Rowe <leah@libreboot.org>2023-04-09 13:21:56 +0100
commit4719d733efd4a66063a667b816d62d178194f1c3 (patch)
tree01a64af1b4a17f7c46a8864bda9d816b18dbc974 /resources
parent49356c3dd7d880966cf14bb568cce2aa4712f03d (diff)
hash roms with blobs before stripping them
Diffstat (limited to 'resources')
-rwxr-xr-xresources/scripts/build/release/roms11
1 files changed, 11 insertions, 0 deletions
diff --git a/resources/scripts/build/release/roms b/resources/scripts/build/release/roms
index 38162a5d..5802b4db 100755
--- a/resources/scripts/build/release/roms
+++ b/resources/scripts/build/release/roms
@@ -86,6 +86,15 @@ for romdir in bin/*; do
rm -Rf "${romdir}_tmp" # dirty hack, to reduce disk io later
# rather than using /tmp, which might not be tmpfs
mkdir "${romdir}_tmp"
+
+ if [ ! -f "${romdir}/blobhashes" ]; then
+ printf "%s\n" "The roms in this archive should match the following hashes AFTER blobs are inserted" > "${romdir}/blobhashes"
+ fi
+
+ # Hash the rom before removing blobs
+ ( cd ${romdir}
+ sha1sum *.rom >> blobhashes
+ )
for romfile in "${romdir}"/*.rom
do
@@ -93,6 +102,7 @@ for romdir in bin/*; do
then
continue
fi
+
${ifdtool} --nuke me "${romfile}" || exit 1
mv "${romfile}" "${romdir}_tmp"/
mv "${romfile}.new" "${romfile}"
@@ -102,6 +112,7 @@ for romdir in bin/*; do
${cbfstool} "${romfile}" remove -n mrc.bin || exit 1
${cbfstool} "${romfile}" print
fi
+
done
fi