|
|
|
@ -234,6 +234,9 @@ mount_partitions () {
|
|
|
|
|
SYSTEM_AS_ROOT=$(getprop ro.build.system_root_image)
|
|
|
|
|
SYSTEM_BLOCK=/dev/block/bootdevice/by-name/system
|
|
|
|
|
|
|
|
|
|
RUNTIME_APEX=""
|
|
|
|
|
APEX_LOOP=""
|
|
|
|
|
|
|
|
|
|
if [ "${SYSTEM_AS_ROOT}" == "true" ]; then
|
|
|
|
|
SLOT=$(grep_cmdline androidboot.slot_suffix)
|
|
|
|
|
if [ -n "${SLOT}" ]; then
|
|
|
|
@ -259,6 +262,23 @@ 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
|
|
|
|
|
|
|
|
|
|
if [ -n "${RUNTIME_APEX}" ]; 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}')
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
! is_mounted /vendor && mount /vendor
|
|
|
|
|
|
|
|
|
|
if [ -L /system/vendor ]; then
|
|
|
|
@ -405,6 +425,8 @@ nanodroid_finalize () {
|
|
|
|
|
umount -l /system 2>/dev/null
|
|
|
|
|
umount -l /vendor 2>/dev/null
|
|
|
|
|
umount -l /dev/random 2>/dev/null
|
|
|
|
|
umount -l /apex/com.android.runtime 2>/dev/null
|
|
|
|
|
losetup -d ${APEX_LOOP} 2>/dev/null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
##########################################################################################
|
|
|
|
|