extract_utils: Support odm/product/vendor partition for zip extract
Change-Id: Iec06835f1703e276f8882c5ee327ef241a2f8f23
diff --git a/build/tools/extract_utils.sh b/build/tools/extract_utils.sh
index 47116b2..8ef2b3b 100644
--- a/build/tools/extract_utils.sh
+++ b/build/tools/extract_utils.sh
@@ -1474,18 +1474,23 @@
if [ -a "$DUMPDIR"/payload.bin ]; then
echo "A/B style OTA zip detected. This is not supported at this time. Stopping..."
exit 1
- # If OTA is block based, extract it.
- elif [ -a "$DUMPDIR"/system.new.dat ]; then
- echo "Converting system.new.dat to system.img"
- python "$LINEAGE_ROOT"/vendor/lineage/build/tools/sdat2img.py "$DUMPDIR"/system.transfer.list "$DUMPDIR"/system.new.dat "$DUMPDIR"/system.img 2>&1
- rm -rf "$DUMPDIR"/system.new.dat "$DUMPDIR"/system
- mkdir "$DUMPDIR"/system "$DUMPDIR"/tmp
- echo "Requesting sudo access to mount the system.img"
- sudo mount -o loop "$DUMPDIR"/system.img "$DUMPDIR"/tmp
- cp -r "$DUMPDIR"/tmp/* "$DUMPDIR"/system/
- sudo umount "$DUMPDIR"/tmp
- rm -rf "$DUMPDIR"/tmp "$DUMPDIR"/system.img
fi
+
+ for PARTITION in "system" "odm" "product" "vendor"
+ do
+ # If OTA is block based, extract it.
+ if [ -a "$DUMPDIR"/"$PARTITION".new.dat ]; then
+ echo "Converting "$PARTITION".new.dat to "$PARTITION".img"
+ python "$LINEAGE_ROOT"/vendor/lineage/build/tools/sdat2img.py "$DUMPDIR"/"$PARTITION".transfer.list "$DUMPDIR"/"$PARTITION".new.dat "$DUMPDIR"/"$PARTITION".img 2>&1
+ rm -rf "$DUMPDIR"/"$PARTITION".new.dat "$DUMPDIR"/"$PARTITION"
+ mkdir "$DUMPDIR"/"$PARTITION" "$DUMPDIR"/tmp
+ echo "Requesting sudo access to mount the "$PARTITION".img"
+ sudo mount -o loop "$DUMPDIR"/"$PARTITION".img "$DUMPDIR"/tmp
+ cp -r "$DUMPDIR"/tmp/* "$DUMPDIR"/"$PARTITION"/
+ sudo umount "$DUMPDIR"/tmp
+ rm -rf "$DUMPDIR"/tmp "$DUMPDIR"/"$PARTITION".img
+ fi
+ done
fi
SRC="$DUMPDIR"