Skip to content
Snippets Groups Projects
Unverified Commit 9e6cfaee authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

scripts: generate SHA256 manifest lines in addition to SHA512

The current autoupdater will only respect the last line for a given model
name, so we can add SHA256 checksums as long as they occur before the
corresponding SHA512 line.
parent b7651ee9
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ generate_line() {
local model="$1"
local file="$2"
[ ! -e "${GLUON_IMAGEDIR}/sysupgrade/$file" ] || echo "$model" "$GLUON_RELEASE" "$(scripts/sha256sum.sh "${GLUON_IMAGEDIR}/sysupgrade/$file")" "$file"
[ ! -e "${GLUON_IMAGEDIR}/sysupgrade/$file" ] || echo "$model" "$GLUON_RELEASE" "$(scripts/sha512sum.sh "${GLUON_IMAGEDIR}/sysupgrade/$file")" "$file"
}
......
#!/bin/sh
check_command() {
which "$1" >/dev/null 2>&1
}
if check_command sha256sum; then
ret="$(sha256sum "$@")"
elif check_command shasum; then
ret="$(shasum -a 256 "$@")"
elif check_command cksum; then
ret="$(cksum -q -a sha256 "$@")"
else
echo "$0: no suitable sha256sum implementation was found" >&2
exit 1
fi
[ "$?" -eq 0 ] || exit 1
echo "$ret" | awk '{ print $1 }'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment