Browse Source

flashrom_rpi_top_write.sh: Minor fix

pull/35/head
Martin Kepplinger 6 years ago
parent
commit
db6172bd2d
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      flashrom_rpi_top_write.sh

+ 3
- 3
flashrom_rpi_top_write.sh View File

@ -77,7 +77,7 @@ if [ ! "$INPUT_IMAGE_SIZE" -eq "$reference_filesize" ] ; then
exit 1 exit 1
fi fi
echo "verifying SPI connection by reading"
echo "verifying SPI connection by reading 2 times. please wait."
TEMP_DIR=`mktemp -d` TEMP_DIR=`mktemp -d`
if [[ ! "$TEMP_DIR" || ! -d "$TEMP_DIR" ]]; then if [[ ! "$TEMP_DIR" || ! -d "$TEMP_DIR" ]]; then
echo "Could not create temp dir" echo "Could not create temp dir"
@ -87,8 +87,8 @@ flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=128 -c ${CHIPNAME} -r ${TEMP_D
flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=128 -c ${CHIPNAME} -r ${TEMP_DIR}/test2.rom flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=128 -c ${CHIPNAME} -r ${TEMP_DIR}/test2.rom
cmp --silent ${TEMP_DIR}/test1.rom ${TEMP_DIR}/test2.rom cmp --silent ${TEMP_DIR}/test1.rom ${TEMP_DIR}/test2.rom
if [ "$have_backupname" -gt 0 ] ; then if [ "$have_backupname" -gt 0 ] ; then
mv ${TEMP_DIR}/test1.rom ${BACKUPNAME}
echo "current image saved as ${BACKUPIMAGE}"
cp ${TEMP_DIR}/test1.rom ${BACKUPNAME}
echo "current image saved as ${BACKUPNAME}"
fi fi
TEMP_SIZE=$(wc -c <"$TEMP_DIR/test1.rom") TEMP_SIZE=$(wc -c <"$TEMP_DIR/test1.rom")
if [ ! "$INPUT_IMAGE_SIZE" -eq "$TEMP_SIZE" ] ; then if [ ! "$INPUT_IMAGE_SIZE" -eq "$TEMP_SIZE" ] ; then


Loading…
Cancel
Save