From bd326a3edf9c0018ef61003828107644f108d20a Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Wed, 5 Aug 2020 11:00:31 +0200 Subject: [PATCH] blobs/*: Fix extract script Command returns a list of utilities found. This can happen if multiple coreboot folders are present. Use only one to fix a crash in the following lines. Test: Being able to extract blobs when two coreboot folders are present, both containing an IFDTOOL. Signed-off-by: Patrick Rudolph --- blobs/t420/extract.sh | 4 ++-- blobs/x220/extract.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/blobs/t420/extract.sh b/blobs/t420/extract.sh index e34c3f907..422924741 100755 --- a/blobs/t420/extract.sh +++ b/blobs/t420/extract.sh @@ -28,7 +28,7 @@ while getopts ":f:m:i:" opt; do done if [ -z "$MECLEAN" ]; then - MECLEAN=`command -v $BLOBDIR/../../build/coreboot-*/util/me_cleaner/me_cleaner.py 2>&1` + MECLEAN=`command -v $BLOBDIR/../../build/coreboot-*/util/me_cleaner/me_cleaner.py 2>&1|head -n1` if [ -z "$MECLEAN" ]; then echo "me_cleaner.py required but not found or specified with -m. Aborting." exit 1; @@ -36,7 +36,7 @@ if [ -z "$MECLEAN" ]; then fi if [ -z "$IFDTOOL" ]; then - IFDTOOL=`command -v $BLOBDIR/../../build/coreboot-*/util/ifdtool/ifdtool 2>&1` + IFDTOOL=`command -v $BLOBDIR/../../build/coreboot-*/util/ifdtool/ifdtool 2>&1|head -n1` if [ -z "$IFDTOOL" ]; then echo "ifdtool required but not found or specified with -m. Aborting." exit 1; diff --git a/blobs/x220/extract.sh b/blobs/x220/extract.sh index e34c3f907..422924741 100755 --- a/blobs/x220/extract.sh +++ b/blobs/x220/extract.sh @@ -28,7 +28,7 @@ while getopts ":f:m:i:" opt; do done if [ -z "$MECLEAN" ]; then - MECLEAN=`command -v $BLOBDIR/../../build/coreboot-*/util/me_cleaner/me_cleaner.py 2>&1` + MECLEAN=`command -v $BLOBDIR/../../build/coreboot-*/util/me_cleaner/me_cleaner.py 2>&1|head -n1` if [ -z "$MECLEAN" ]; then echo "me_cleaner.py required but not found or specified with -m. Aborting." exit 1; @@ -36,7 +36,7 @@ if [ -z "$MECLEAN" ]; then fi if [ -z "$IFDTOOL" ]; then - IFDTOOL=`command -v $BLOBDIR/../../build/coreboot-*/util/ifdtool/ifdtool 2>&1` + IFDTOOL=`command -v $BLOBDIR/../../build/coreboot-*/util/ifdtool/ifdtool 2>&1|head -n1` if [ -z "$IFDTOOL" ]; then echo "ifdtool required but not found or specified with -m. Aborting." exit 1;