Browse Source

flashrom_rpi_bottom_unlock.sh: various fixes while testing

pull/35/head
Martin Kepplinger 6 years ago
parent
commit
f7fb9361e6
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      flashrom_rpi_bottom_unlock.sh

+ 4
- 4
flashrom_rpi_bottom_unlock.sh View File

@ -85,7 +85,7 @@ if [ "$me_clean" -gt 0 ] ; then
fi fi
fi fi
echo "start reading ..."
echo "Start reading 2 times. Please be patient."
TEMP_DIR=`mktemp -d` TEMP_DIR=`mktemp -d`
if [[ ! "$TEMP_DIR" || ! -d "$TEMP_DIR" ]]; then if [[ ! "$TEMP_DIR" || ! -d "$TEMP_DIR" ]]; then
echo -e "${RED}Error:${NC} Could not create temp dir" echo -e "${RED}Error:${NC} Could not create temp dir"
@ -95,8 +95,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
reference_size=8388608 reference_size=8388608
@ -117,7 +117,7 @@ else
fi fi
${IFDTOOL_PATH} -u ${TEMP_DIR}/work.rom ${IFDTOOL_PATH} -u ${TEMP_DIR}/work.rom
if if [ ! -e ${TEMP_DIR}/work.rom.new ] ; then
if [ ! -e ${TEMP_DIR}/work.rom.new ] ; then
echo -e "${RED}Error:${NC} Unlocking failed. ${TEMP_DIR}/work.rom.new not found." echo -e "${RED}Error:${NC} Unlocking failed. ${TEMP_DIR}/work.rom.new not found."
rm -rf ${TEMP_DIR} rm -rf ${TEMP_DIR}
exit 1 exit 1


Loading…
Cancel
Save