gta4xl-common: Extract firmware only if requested

* Since we have to support multiple models in firmware we can't really extract it
  together with blobs

Change-Id: Iaed2eaad1727d9b592476adb0f04fc3a8173b108
diff --git a/extract-files.sh b/extract-files.sh
index 84778c2..c7916be 100755
--- a/extract-files.sh
+++ b/extract-files.sh
@@ -26,7 +26,7 @@
 
 ONLY_COMMON=
 ONLY_TARGET=
-ONLY_FIRMWARE=
+FIRMWARE=
 KANG=
 SECTION=
 
@@ -38,8 +38,8 @@
         --only-target )
                 ONLY_TARGET=true
                 ;;
-        --only-firmware )
-                ONLY_FIRMWARE=true
+        --firmware )
+                FIRMWARE=true
                 ;;
         -n | --no-cleanup )
                 CLEAN_VENDOR=false
@@ -80,7 +80,7 @@
     # Initialize the helper for common device
     setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}"
 
-    if [ -z "${ONLY_FIRMWARE}" ]; then
+    if [ -z "${FIRMWARE}" ]; then
         extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
     fi
 fi
@@ -90,11 +90,11 @@
     source "${MY_DIR}/../${DEVICE}/extract-files.sh"
     setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}"
 
-    if [ -z "${ONLY_FIRMWARE}" ]; then
+    if [ -z "${FIRMWARE}" ]; then
         extract "${MY_DIR}/../${DEVICE}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
     fi
 
-    if [ -z "${SECTION}" ] && [ -f "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-firmware.txt" ]; then
+    if [ -z "${SECTION}" ] && [ ! -z "${FIRMWARE}" ] && [ -f "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-firmware.txt" ]; then
         extract_firmware "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-firmware.txt" "${SRC}"
     fi
 fi