util/chromeos/extract_blobs: allow passing dest dir as arg

Allow user to pass the output dir for the extracted blobs as the 2nd
argument to the script; if not provided, fall back to the existing
default.

Change-Id: I0f120b69e0b6d14c2763b9a3b2a622e77c4fe0d4
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72910
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
diff --git a/util/chromeos/extract_blobs.sh b/util/chromeos/extract_blobs.sh
index 669327d..ca0bdee 100755
--- a/util/chromeos/extract_blobs.sh
+++ b/util/chromeos/extract_blobs.sh
@@ -8,9 +8,14 @@
 fi
 
 IMAGE=$1
-# create new dir '$IMAGE-blobs' (less file extension)
-DIR=$(basename $IMAGE)
-DIR="${DIR%.*}-blobs"
+
+if [[ "$2" = "" ]]; then
+	# create new dir '$IMAGE-blobs' (less file extension)
+	DIR=$(basename $IMAGE)
+	DIR="${DIR%.*}-blobs"
+else
+	DIR=$2
+fi
 mkdir -p $DIR
 
 if [ -f ./cbfstool ]; then