From b7d4c6a0699ef3e53945e322234bfacece69088f Mon Sep 17 00:00:00 2001 From: Martin Kepplinger Date: Tue, 17 Apr 2018 19:52:12 +0200 Subject: [PATCH] rename flashrom_rpi_write to flashrom_rpi_top_write and add 4M check --- flashrom_rpi_write.sh => flashrom_rpi_top_write.sh | 5 +++++ 1 file changed, 5 insertions(+) rename flashrom_rpi_write.sh => flashrom_rpi_top_write.sh (93%) diff --git a/flashrom_rpi_write.sh b/flashrom_rpi_top_write.sh similarity index 93% rename from flashrom_rpi_write.sh rename to flashrom_rpi_top_write.sh index 360be5c..bffec47 100755 --- a/flashrom_rpi_write.sh +++ b/flashrom_rpi_top_write.sh @@ -71,6 +71,11 @@ fi INPUT_IMAGE_NAME=$(basename ${INPUT_IMAGE_PATH}) INPUT_IMAGE_SIZE=$(wc -c <"$INPUT_IMAGE_PATH") +reference_filesize=4194304 +if [ ! "$INPUT_IMAGE_SIZE" -eq "$reference_filesize" ] ; then + echo "Error: input file must be 4MB of size" + exit 1 +fi echo "verifying SPI connection by reading" TEMP_DIR=`mktemp -d`