Browse Source

x230: flashrom scripts: fix chip detection

we stick with set -e so we need to catch errors manually if need be
pull/35/head
Martin Kepplinger 6 years ago
parent
commit
8860fe6036
2 changed files with 5 additions and 5 deletions
  1. +3
    -3
      x230/flashrom_rpi_bottom_unlock.sh
  2. +2
    -2
      x230/flashrom_rpi_top_write.sh

+ 3
- 3
x230/flashrom_rpi_bottom_unlock.sh View File

@ -84,7 +84,7 @@ if [ ! "$have_chipname" -gt 0 ] ; then
echo "trying to detect the chip..."
flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=128 &> ${TEMP_DIR}/chips || true
flashrom_error=""
flashrom_error=$(cat ${TEMP_DIR}/chips | grep -i error)
flashrom_error=$(cat ${TEMP_DIR}/chips | grep -i error || true)
if [ ! -z "${flashrom_error}" ] ; then
cat ${TEMP_DIR}/chips
rm -rf ${TEMP_DIR}
@ -93,11 +93,11 @@ if [ ! "$have_chipname" -gt 0 ] ; then
CHIPNAME=""
chip_found=0
CHIPNAME=$(cat ${TEMP_DIR}/chips | grep Found | grep "MX25L6406E/MX25L6408E" | grep -o '".*"')
CHIPNAME=$(cat ${TEMP_DIR}/chips | grep Found | grep "MX25L6406E/MX25L6408E" | grep -o '".*"' || true)
if [ ! -z "${CHIPNAME}" ] ; then
chip_found=1
fi
CHIPNAME=$(cat ${TEMP_DIR}/chips | grep Found | grep "EN25QH64" | grep -o '".*"')
CHIPNAME=$(cat ${TEMP_DIR}/chips | grep Found | grep "EN25QH64" | grep -o '".*"' || true)
if [ ! -z "${CHIPNAME}" ] ; then
chip_found=1
fi


+ 2
- 2
x230/flashrom_rpi_top_write.sh View File

@ -85,7 +85,7 @@ if [ ! "$have_chipname" -gt 0 ] ; then
echo "trying to detect the chip..."
flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=128 &> ${TEMP_DIR}/chips || true
flashrom_error=""
flashrom_error=$(cat ${TEMP_DIR}/chips | grep -i error)
flashrom_error=$(cat ${TEMP_DIR}/chips | grep -i error || true)
if [ ! -z "${flashrom_error}" ] ; then
cat ${TEMP_DIR}/chips
rm -rf ${TEMP_DIR}
@ -94,7 +94,7 @@ if [ ! "$have_chipname" -gt 0 ] ; then
CHIPNAME=""
chip_found=0
CHIPNAME=$(cat ${TEMP_DIR}/chips | grep Found | grep "MX25L3206E" | grep -o '".*"')
CHIPNAME=$(cat ${TEMP_DIR}/chips | grep Found | grep "MX25L3206E" | grep -o '".*"' || true)
if [ ! -z "${CHIPNAME}" ] ; then
chip_found=1
fi


Loading…
Cancel
Save