From 8860fe6036a7d857516e97c34ac216a38faf2c83 Mon Sep 17 00:00:00 2001 From: Martin Kepplinger Date: Thu, 17 May 2018 12:37:11 +0200 Subject: [PATCH] x230: flashrom scripts: fix chip detection we stick with set -e so we need to catch errors manually if need be --- x230/flashrom_rpi_bottom_unlock.sh | 6 +++--- x230/flashrom_rpi_top_write.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x230/flashrom_rpi_bottom_unlock.sh b/x230/flashrom_rpi_bottom_unlock.sh index 3d631b8..819ce7a 100755 --- a/x230/flashrom_rpi_bottom_unlock.sh +++ b/x230/flashrom_rpi_bottom_unlock.sh @@ -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 diff --git a/x230/flashrom_rpi_top_write.sh b/x230/flashrom_rpi_top_write.sh index 058543e..e255b9e 100755 --- a/x230/flashrom_rpi_top_write.sh +++ b/x230/flashrom_rpi_top_write.sh @@ -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