Backend: attempt to fix system_root setup on oddball device recoveries

- TWRP for some devices has /system as a symlink, some do not; apparently some weird devices have /system_root as a symlink (somehow); attempt to fix them all
This commit is contained in:
osm0sis committed 2019-08-06 19:12:00 -03:00
1 parent 0e3b7304e6
commit 950b68a1d7
1 file changed
+7 -3
+7 -3
View File
@@ -45,7 +45,7 @@ debugging() {
is_mounted() { $bb mount | $bb grep -q " $1 "; }
unmount_all() {
($bb umount /system;
if [ -d /system_root -a ! -f /system/build.prop ]; then
if [ -e /system_root -a ! -f /system/build.prop ]; then
$bb umount /system_root;
fi;
$bb umount /system;
@@ -115,8 +115,12 @@ fi;
$bb mount /data) 2>/dev/null;
if [ -f /system/system/build.prop ]; then
$bb umount /system;
($bb umount /system;
mkdir /system_root) 2>/dev/null;
$bb umount /system 2>/dev/null;
for mntpt in /system /system_root; do
if [ -L $mntpt -o ! -d $mntpt ]; then
rm -f $mntpt;
mkdir $mntpt;
fi;
$bb mount -o ro -t auto /dev/block/bootdevice/by-name/system /system_root;
$bb mount -o bind /system_root/system /system;
fi;