From c9b8090722e31d6e35ffa5a7819e5a4b109a5b28 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Mon, 19 Aug 2019 19:58:08 +0200 Subject: [PATCH] change in mount code --- CommonInstaller | 6 ++++-- patcher/CommonPatcher | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CommonInstaller b/CommonInstaller index 702f1b34..687f7c20 100644 --- a/CommonInstaller +++ b/CommonInstaller @@ -245,7 +245,8 @@ mount_partitions () { if [ ! -f /system/build.prop ]; then DEVICE_AB=TRUE - SYSTEMBLOCK=$(find /dev/block -iname system${SLOT} | head -n 1) + sys_tmp=$(find /dev/block -type l -iname system${SLOT} | head -n 1) + SYSTEMBLOCK=$(readlink -f ${sys_tmp}) mount -o rw ${SYSTEMBLOCK} /system fi @@ -266,7 +267,8 @@ mount_partitions () { if [ -L /system/vendor ]; then ! is_mounted /vendor && mount /vendor if ! is_mounted /vendor; then - VENDORBLOCK=$(find /dev/block -iname vendor${SLOT} | head -n 1) + vendor_tmp=$(find /dev/block -type l -iname vendor${SLOT} | head -n 1) + VENDORBLOCK=$(readlink -f ${vendor_tmp}) mount -o ro ${VENDORBLOCK} /vendor fi elif [ -d /system/vendor ]; then diff --git a/patcher/CommonPatcher b/patcher/CommonPatcher index 759fb643..c20a289a 100644 --- a/patcher/CommonPatcher +++ b/patcher/CommonPatcher @@ -65,8 +65,9 @@ mount_partitions () { ! is_mounted /system && mount -o rw /system || mount -o rw,remount /system - if [ ! -f /system/build.prop ]; then - SYSTEMBLOCK=$(find /dev/block -iname system${SLOT} | head -n 1) + if ! is_mounted /system; then + sys_tmp=$(find /dev/block -type l -iname system${SLOT} | head -n 1) + SYSTEMBLOCK=$(readlink -f ${sys_tmp}) mount -o rw ${SYSTEMBLOCK} /system fi @@ -82,7 +83,8 @@ mount_partitions () { if [ -L /system/vendor ]; then ! is_mounted /vendor && mount /vendor if ! is_mounted /vendor; then - VENDORBLOCK=$(find /dev/block -iname vendor${SLOT} | head -n 1) + vendor_tmp=$(find /dev/block -type l -iname vendor${SLOT} | head -n 1) + VENDORBLOCK=$(readlink -f ${vendor_tmp}) mount -o ro ${VENDORBLOCK} /vendor fi elif [ -d /system/vendor ]; then