diff --git a/scripts/filesize.sh b/scripts/filesize.sh new file mode 100755 index 00000000..1a6ea4dd --- /dev/null +++ b/scripts/filesize.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +check_command() { + which "$1" >/dev/null 2>&1 +} + +if check_command gnustat; then + gnustat -c%s "$@" +elif check_command gstat; then + gstat -c%s "$@" +elif check_command stat; then + stat -c%s "$@" +else + echo "$0: no suitable stat implementation was found" >&2 + exit 1 +fi diff --git a/scripts/generate_manifest.sh b/scripts/generate_manifest.sh index a9dfca3c..d0f1ce4e 100755 --- a/scripts/generate_manifest.sh +++ b/scripts/generate_manifest.sh @@ -21,8 +21,22 @@ 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" + [ ! -e "${GLUON_IMAGEDIR}/sysupgrade/$file" ] || echo \ + "$model" \ + "$GLUON_RELEASE" \ + "$(scripts/sha256sum.sh "${GLUON_IMAGEDIR}/sysupgrade/$file")" \ + "$(scripts/filesize.sh "${GLUON_IMAGEDIR}/sysupgrade/$file")" \ + "$file" + [ ! -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" } generate() {