diff options
author | dianlujitao <dianlujitao@lineageos.org> | 2020-04-21 23:03:20 +0800 |
---|---|---|
committer | Bruno Martins <bgcngm@gmail.com> | 2020-04-25 16:21:32 +0200 |
commit | 1dc00585532fd848e955445837e29ffb83797b74 (patch) | |
tree | 308500ee7c68cf5eff696e3ef203a51e4242eadf | |
parent | c6992a51da7d1269f300870390aba2476fbe3dff (diff) |
extract_utils: Support odm/product/vendor partition for zip extract
Change-Id: Iec06835f1703e276f8882c5ee327ef241a2f8f23
-rw-r--r-- | extract_utils.sh | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/extract_utils.sh b/extract_utils.sh index 47116b2..8ef2b3b 100644 --- a/extract_utils.sh +++ b/extract_utils.sh @@ -1474,18 +1474,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 "$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" |