diff --git a/CommonInstaller b/CommonInstaller index 625c796..038840a 100644 --- a/CommonInstaller +++ b/CommonInstaller @@ -240,7 +240,8 @@ mount_partitions () { SYSTEM_AS_ROOT=$(getprop ro.build.system_root_image) SYSTEM_BLOCK=/dev/block/bootdevice/by-name/system - RUNTIME_APEX="" + APEX_FILE="" + APEX_DIR="" APEX_LOOP="" if [ "${SYSTEM_AS_ROOT}" == "true" ]; then @@ -268,21 +269,27 @@ mount_partitions () { [ ! -f /system/build.prop ] && error "failed to mount /system (unsupported A/B device?)" - if [ -f /system/apex/com.android.runtime.apex ]; then - RUNTIME_APEX="/system/apex/com.android.runtime.apex" - elif [ -f /system/apex/com.android.runtime.release.apex ]; then - RUNTIME_APEX="/system/apex/com.android.runtime.release.apex" - fi + for apex in com.android.runtime com.android.runtime.release com.android.runtime.debug; do + if [ -f /system/apex/${apex}.apex ]; then + APEX_FILE=/system/apex/${apex}.apex + break + elif [ -d /system/apex/${apex} ]; then + APEX_DIR=/system/apex/${apex} + break + fi + done - if [ -n "${RUNTIME_APEX}" ]; then + if [ -n "${APEX_FILE}" ]; then mkdir -p /dev/tmp/apex unzip "${RUNTIME_APEX}" -d /dev/tmp/apex mkdir -p /apex/com.android.runtime - mount -oloop,ro /dev/tmp/apex/apex_payload.img /apex/com.android.runtime APEX_LOOP=$(mount | awk '/com.android.runtime/{print $1}') + elif [ -n "${APEX_DIR}" ]; then + mkdir -p /apex + ln -sf "${APEX_DIR}" /apex/com.android.runtime fi ! is_mounted /vendor && mount /vendor