CommonInstaller: another try for A/B device support

merge-requests/23/head
Christopher Roy Bratusek 6 years ago
parent a3fc0766ad
commit d61ac7a164

@ -76,7 +76,7 @@ grep_prop() {
REGEX="${1}" REGEX="${1}"
shift shift
FILES="${@}" FILES="${@}"
[ -z "${@}" ] && FILES='/system/build.prop' [ -z "${@}" ] && FILES='/system/build.prop /system_root/build.prop'
sed -n "s/^${REGEX}=//p" ${FILES} | \ sed -n "s/^${REGEX}=//p" ${FILES} | \
head -n 1 head -n 1
} }
@ -196,21 +196,20 @@ mount_partitions () {
${BOOTMODE} || mount -o bind /dev/urandom /dev/random ${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 if [ ! -f /system/build.prop ]; then
SYSTEMBLOCK=$(find /dev/block -iname system${SLOT} | head -n 1) SYSTEMBLOCK=$(find /dev/block -iname system${SLOT} | head -n 1)
mount -t ext4 -o rw $SYSTEMBLOCK /system mount -t ext4 -o rw $SYSTEMBLOCK /system
fi fi
[ -f /system/build.prop ] || is_mounted /system || error "failed to mount /system"
if [ -f /system/init ]; then if [ -f /system/init ]; then
mkdir /system_root 2>/dev/null mkdir /system_root 2>/dev/null
mount --move /system /system_root mount --move /system /system_root
mount -o bind /system_root/system /system mount -o bind /system_root/system /system
fi fi
[ ! -f /system/build.prop ] && error "failed to mount /system (unsupported A/B device?)"
} }
detect_mode () { detect_mode () {

Loading…
Cancel
Save