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 () {