From 5c2ec90dab12f3fc5d5d46bef5d7397d76d99321 Mon Sep 17 00:00:00 2001 From: Martin Kepplinger Date: Fri, 13 Apr 2018 09:24:18 +0200 Subject: [PATCH] prepare_internal_flashing: add inputfilesize check --- prepare_internal_flashing.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/prepare_internal_flashing.sh b/prepare_internal_flashing.sh index bc0a3dd..e2bb976 100755 --- a/prepare_internal_flashing.sh +++ b/prepare_internal_flashing.sh @@ -56,6 +56,13 @@ else exit 1 fi +input_filesize=$(wc -c <"$INPUT_IMAGE") +reference_filesize=4194304 +if [ ! "$input_filesize" -eq "$reference_filesize" ] ; then + echo "Error: input file must be 4MB of size" + exit 1 +fi + rm -rf output mkdir output && cd output dd if=/dev/zero of=${OUTPUT_IMAGE} bs=4M count=2