|
@ -70,6 +70,7 @@ if [ ! "$have_chipname" -gt 0 ] ; then |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
INPUT_IMAGE_NAME=$(basename ${INPUT_IMAGE_PATH}) |
|
|
INPUT_IMAGE_NAME=$(basename ${INPUT_IMAGE_PATH}) |
|
|
|
|
|
INPUT_IMAGE_SIZE=$(wc -c <"$INPUT_IMAGE_PATH") |
|
|
|
|
|
|
|
|
echo "verifying SPI connection by reading" |
|
|
echo "verifying SPI connection by reading" |
|
|
TEMP_DIR=`mktemp -d` |
|
|
TEMP_DIR=`mktemp -d` |
|
@ -84,6 +85,11 @@ if [ "$have_backupname" -gt 0 ] ; then |
|
|
mv ${TEMP_DIR}/test1.rom ${BACKUPNAME} |
|
|
mv ${TEMP_DIR}/test1.rom ${BACKUPNAME} |
|
|
echo "current image saved as ${BACKUPIMAGE}" |
|
|
echo "current image saved as ${BACKUPIMAGE}" |
|
|
fi |
|
|
fi |
|
|
|
|
|
TEMP_SIZE=$(wc -c <"$TEMP_DIR/test1.rom") |
|
|
|
|
|
if [ ! "$INPUT_IMAGE_SIZE" -eq "$TEMP_SIZE" ] ; then |
|
|
|
|
|
echo "Error: read image (${TEMP_SIZE}) has different size that new image $INPUT_IMAGE_NAME (${INPUT_IMAGE_SIZE})" |
|
|
|
|
|
exit 1 |
|
|
|
|
|
fi |
|
|
rm -rf ${TEMP_DIR} |
|
|
rm -rf ${TEMP_DIR} |
|
|
|
|
|
|
|
|
echo -e "connection ok. flashing ${GREEN}${INPUT_IMAGE_NAME}${NC}" |
|
|
echo -e "connection ok. flashing ${GREEN}${INPUT_IMAGE_NAME}${NC}" |
|
|