Trivial script to generate a MANIFEST file for the runtime VM data
authorSteve McIntyre <steve.mcintyre@arm.com>
Tue, 5 May 2020 14:09:35 +0000 (15:09 +0100)
committerSteve McIntyre <steve.mcintyre@arm.com>
Tue, 5 May 2020 14:09:35 +0000 (15:09 +0100)
scripts/generate_MANIFEST [new file with mode: 0755]

diff --git a/scripts/generate_MANIFEST b/scripts/generate_MANIFEST
new file mode 100755 (executable)
index 0000000..e632aa2
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# generate_MANIFEST
+#
+# Simple helper script. Generate a MANIFEST file for stuff to
+# download. Each line is a file, described in the format:
+#
+# <FILENAME>:<MODE>:<BYTES>:<SHA256>
+#
+# Apart from the MANIFEST itself, all files offered up for download
+# should be compressed with gzip. In each case, the runtime script
+# will download $FILENAME.gz, decompress it and then validate the
+# checksum
+
+for FILENAME in $@; do
+    MODE=$(stat -c%a $FILENAME)
+    SHA_FILE=$(sha256sum $FILENAME | awk '{print $1}')
+    SIZE_FILE=$(stat -c%s $FILENAME)
+    echo "$FILENAME:$MODE:$SIZE_FILE:$SHA_FILE"
+done