@@ -865,18 +865,22 @@ initialize()
865865 fi
866866
867867 if mount_partition_if_exist " ${SLOT: +product}${SLOT-}${NL:? } product${NL:? } " ' product' ; then
868+ PRODUCT_PATH=" ${LAST_MOUNTPOINT:? } "
868869 UNMOUNT_PRODUCT=" ${LAST_PARTITION_MUST_BE_UNMOUNTED:? } "
869870 remount_read_write_if_needed " ${LAST_MOUNTPOINT:? } " false && PRODUCT_WRITABLE=' true'
870871 fi
871872 if mount_partition_if_exist " ${SLOT: +vendor}${SLOT-}${NL:? } vendor${NL:? } " ' vendor' ; then
873+ VENDOR_PATH=" ${LAST_MOUNTPOINT:? } "
872874 UNMOUNT_VENDOR=" ${LAST_PARTITION_MUST_BE_UNMOUNTED:? } "
873875 remount_read_write_if_needed " ${LAST_MOUNTPOINT:? } " false && VENDOR_WRITABLE=' true'
874876 fi
875877 if mount_partition_if_exist " ${SLOT: +system_ext}${SLOT-}${NL:? } system_ext${NL:? } " ' system_ext' ; then
878+ SYS_EXT_PATH=" ${LAST_MOUNTPOINT:? } "
876879 UNMOUNT_SYS_EXT=" ${LAST_PARTITION_MUST_BE_UNMOUNTED:? } "
877880 remount_read_write_if_needed " ${LAST_MOUNTPOINT:? } " false
878881 fi
879882 if mount_partition_if_exist " ${SLOT: +odm}${SLOT-}${NL:? } odm${NL:? } " ' odm' ; then
883+ ODM_PATH=" ${LAST_MOUNTPOINT:? } "
880884 UNMOUNT_ODM=" ${LAST_PARTITION_MUST_BE_UNMOUNTED:? } "
881885 remount_read_write_if_needed " ${LAST_MOUNTPOINT:? } " false
882886 fi
@@ -885,7 +889,7 @@ initialize()
885889 if mount_partition_if_exist " userdata${NL:? } DATAFS${NL:? } " ' data' " ${ANDROID_DATA-} " ; then
886890 DATA_PATH=" ${LAST_MOUNTPOINT:? } "
887891 UNMOUNT_DATA=" ${LAST_PARTITION_MUST_BE_UNMOUNTED:? } "
888- remount_read_write_if_needed " ${DATA_PATH :? } " true
892+ remount_read_write_if_needed " ${LAST_MOUNTPOINT :? } " true
889893 else
890894 ui_warning " The data partition cannot be mounted, so updates of installed / removed apps cannot be automatically deleted and their Dalvik cache cannot be automatically cleaned. I suggest to manually do a factory reset after flashing this ZIP."
891895 fi
@@ -1345,8 +1349,8 @@ verify_disk_space()
13451349 _free_space_bytes=" $( get_free_disk_space_of_partition " ${1:? } " ) " || _free_space_bytes=' -1'
13461350 display_free_space " ${1:? } " " ${_free_space_bytes?} " || :
13471351
1348- if test " ${PRODUCT_WRITABLE:? } " = ' true' ; then display_free_space ' /product ' " $( get_free_disk_space_of_partition ' /product ' || :) " ; fi
1349- if test " ${VENDOR_WRITABLE:? } " = ' true' ; then display_free_space ' /vendor ' " $( get_free_disk_space_of_partition ' /vendor ' || :) " ; fi
1352+ if test " ${PRODUCT_WRITABLE:? } " = ' true' ; then display_free_space " ${PRODUCT_PATH :? } " " $( get_free_disk_space_of_partition " ${PRODUCT_PATH :? } " || :) " ; fi
1353+ if test " ${VENDOR_WRITABLE:? } " = ' true' ; then display_free_space " ${VENDOR_PATH :? } " " $( get_free_disk_space_of_partition " ${VENDOR_PATH :? } " || :) " ; fi
13501354
13511355 if test " ${_needed_space_bytes:? } " -ge 0 && test " ${_free_space_bytes:? } " -ge 0; then
13521356 : # OK
@@ -1603,17 +1607,17 @@ unmount()
16031607
16041608unmount_extra_partitions ()
16051609{
1606- if test " ${UNMOUNT_PRODUCT:? } " = ' 1' ; then
1607- unmount ' /product '
1610+ if test " ${UNMOUNT_PRODUCT:? } " = ' 1' && test -n " ${PRODUCT_PATH-} " ; then
1611+ unmount " ${PRODUCT_PATH :? } "
16081612 fi
1609- if test " ${UNMOUNT_VENDOR:? } " = ' 1' ; then
1610- unmount ' /vendor '
1613+ if test " ${UNMOUNT_VENDOR:? } " = ' 1' && test -n " ${VENDOR_PATH-} " ; then
1614+ unmount " ${VENDOR_PATH :? } "
16111615 fi
1612- if test " ${UNMOUNT_SYS_EXT:? } " = ' 1' ; then
1613- unmount ' /system_ext '
1616+ if test " ${UNMOUNT_SYS_EXT:? } " = ' 1' && test -n " ${SYS_EXT_PATH-} " ; then
1617+ unmount " ${SYS_EXT_PATH :? } "
16141618 fi
1615- if test " ${UNMOUNT_ODM:? } " = ' 1' ; then
1616- unmount ' /odm '
1619+ if test " ${UNMOUNT_ODM:? } " = ' 1' && test -n " ${ODM_PATH-} " ; then
1620+ unmount " ${ODM_PATH :? } "
16171621 fi
16181622
16191623 return 0 # Never fail
0 commit comments