RM6785: Allow extracting only firmware images

Change-Id: Icab3f013661304e3a9ec89b0816a8139f6b8e8e5
diff --git a/extract-files.sh b/extract-files.sh
index 78e5ce1..ea243a5 100755
--- a/extract-files.sh
+++ b/extract-files.sh
@@ -80,6 +80,7 @@
 CLEAN_VENDOR=true
 
 ONLY_COMMON=
+ONLY_FIRMWARE=
 ONLY_TARGET=
 KANG=
 SECTION=
@@ -89,6 +90,9 @@
         --only-common )
                 ONLY_COMMON=true
                 ;;
+        --only-firmware )
+                ONLY_FIRMWARE=true
+                ;;
         --only-target )
                 ONLY_TARGET=true
                 ;;
@@ -117,7 +121,9 @@
     # Initialize the helper for common device
     setup_vendor "${DEVICE_COMMON}" "${VENDOR_COMMON:-$VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}"
 
-    extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
+    if [ -z "${ONLY_FIRMWARE}" ]; then
+        extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
+    fi
 fi
 
 if [ -z "${ONLY_COMMON}" ] && [ -s "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt" ]; then
@@ -125,7 +131,9 @@
     source "${MY_DIR}/../../${VENDOR}/${DEVICE}/extract-files.sh"
     setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}"
 
-    extract "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
+    if [ -z "${ONLY_FIRMWARE}" ]; then
+        extract "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
+    fi
 fi
 
 if [ -z "${SECTION}" ]; then