extract_firmware: Handle renamed firmware files
This allows to extract firmware from OTA images
instead of factory on FP4
Change-Id: Ie52e85f63a3a6e48551a0cd8b6899cc542444587
diff --git a/extract_utils.sh b/extract_utils.sh
index f830dee..793567d 100644
--- a/extract_utils.sh
+++ b/extract_utils.sh
@@ -1916,7 +1916,11 @@
if [ ! -d "$OUTPUT_DIR" ]; then
mkdir -p "$OUTPUT_DIR"
fi
- cp "$SRC/$SRC_FILE" "$OUTPUT_DIR/$DST_FILE"
+ if [ -f "$SRC/$SRC_FILE" ]; then
+ cp "$SRC/$SRC_FILE" "$OUTPUT_DIR/$DST_FILE"
+ else
+ cp "$SRC/$DST_FILE" "$OUTPUT_DIR/$DST_FILE"
+ fi
chmod 644 "$OUTPUT_DIR/$DST_FILE"
done
}