diff --git a/build/tools/extract_utils.sh b/build/tools/extract_utils.sh index 49c832e..cfbad5c 100755 --- a/build/tools/extract_utils.sh +++ b/build/tools/extract_utils.sh @@ -1473,18 +1473,23 @@ function extract() { 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 "$DU_ROOT"/vendor/du/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 "$DU_ROOT"/vendor/du/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"