From c629d4eaf709264f473310fa7546da9df95d4ee5 Mon Sep 17 00:00:00 2001 From: Martin Kepplinger Date: Tue, 17 Jul 2018 10:11:11 +0200 Subject: [PATCH] x230: fix flashrom chipname detection We've had a double-quote issue there --- x230/external_install_bottom.sh | 6 +++--- x230/external_install_top.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/x230/external_install_bottom.sh b/x230/external_install_bottom.sh index 609b794..bf7fe30 100755 --- a/x230/external_install_bottom.sh +++ b/x230/external_install_bottom.sh @@ -145,7 +145,7 @@ if [ ! "$have_chipname" -gt 0 ] ; then CHIPNAME="" chip_found=0 - CHIPNAME=$(cat "${TEMP_DIR}"/chips | grep Found | grep "MX25L6406E/MX25L6408E" | grep -o '".*"' || true) + CHIPNAME=$(cat "${TEMP_DIR}"/chips | grep Found | grep "MX25L6406E/MX25L6408E" | grep -oP '"\K[^"\047]+(?=["\047])' || true) if [ ! -z "${CHIPNAME}" ] ; then chip_found=1 fi @@ -191,8 +191,8 @@ if [ "$me_clean" -gt 0 ] ; then fi echo "Start reading 2 times. Please be patient..." -flashrom -p ${programmer} -c "${CHIPNAME}" -r "${TEMP_DIR}"/test1.rom -flashrom -p ${programmer} -c "${CHIPNAME}" -r "${TEMP_DIR}"/test2.rom +flashrom -p ${programmer} -c ${CHIPNAME} -r "${TEMP_DIR}"/test1.rom +flashrom -p ${programmer} -c ${CHIPNAME} -r "${TEMP_DIR}"/test2.rom cmp --silent "${TEMP_DIR}"/test1.rom "${TEMP_DIR}"/test2.rom if [ "$have_backupname" -gt 0 ] ; then cp "${TEMP_DIR}"/test1.rom "${BACKUPNAME}" diff --git a/x230/external_install_top.sh b/x230/external_install_top.sh index 1c5bd10..d8825f1 100755 --- a/x230/external_install_top.sh +++ b/x230/external_install_top.sh @@ -160,7 +160,7 @@ if [ ! "$have_chipname" -gt 0 ] ; then CHIPNAME="" chip_found=0 - CHIPNAME=$(cat "${TEMP_DIR}"/chips | grep Found | grep "MX25L3206E" | grep -o '".*"' || true) + CHIPNAME=$(cat "${TEMP_DIR}"/chips | grep Found | grep MX25L3206E | grep -oP '"\K[^"\047]+(?=["\047])' || true) if [ ! -z "${CHIPNAME}" ] ; then chip_found=1 fi @@ -184,8 +184,8 @@ if [ ! "$INPUT_IMAGE_SIZE" -eq "$reference_filesize" ] ; then fi echo "verifying SPI connection by reading 2 times. please wait." -flashrom -p ${programmer} -c "${CHIPNAME}" -r "${TEMP_DIR}"/test1.rom -flashrom -p ${programmer} -c "${CHIPNAME}" -r "${TEMP_DIR}"/test2.rom +flashrom -p ${programmer} -c ${CHIPNAME} -r ${TEMP_DIR}/test1.rom +flashrom -p ${programmer} -c ${CHIPNAME} -r ${TEMP_DIR}/test2.rom cmp --silent "${TEMP_DIR}"/test1.rom "${TEMP_DIR}"/test2.rom if [ "$have_backupname" -gt 0 ] ; then cp "${TEMP_DIR}"/test1.rom "${BACKUPNAME}"