From d61ac7a1647efd41bc8c121535f54a90361800dc Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sat, 4 Aug 2018 08:44:54 +0200 Subject: [PATCH] CommonInstaller: another try for A/B device support --- CommonInstaller | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CommonInstaller b/CommonInstaller index 1a49a8a..0c70408 100644 --- a/CommonInstaller +++ b/CommonInstaller @@ -76,7 +76,7 @@ grep_prop() { REGEX="${1}" shift FILES="${@}" - [ -z "${@}" ] && FILES='/system/build.prop' + [ -z "${@}" ] && FILES='/system/build.prop /system_root/build.prop' sed -n "s/^${REGEX}=//p" ${FILES} | \ head -n 1 } @@ -196,21 +196,20 @@ mount_partitions () { ${BOOTMODE} || mount -o bind /dev/urandom /dev/random - [ ! -f /system/build.prop ] && mount -o rw /system 2>/dev/null + ! is_mounted /system && mount -o rw /system 2>/dev/null if [ ! -f /system/build.prop ]; then SYSTEMBLOCK=$(find /dev/block -iname system${SLOT} | head -n 1) mount -t ext4 -o rw $SYSTEMBLOCK /system fi + [ -f /system/build.prop ] || is_mounted /system || error "failed to mount /system" + if [ -f /system/init ]; then mkdir /system_root 2>/dev/null mount --move /system /system_root mount -o bind /system_root/system /system fi - - [ ! -f /system/build.prop ] && error "failed to mount /system (unsupported A/B device?)" - } detect_mode () {