From 03af96a5415cd0b508e542a1ed8c9eb386c322a6 Mon Sep 17 00:00:00 2001 From: osm0sis Date: Mon, 27 Jan 2020 15:28:11 -0400 Subject: Backend: fixes for mounting system on Lineage Recovery - Lineage has a mindboggling: /system_root as mountpoint in ramdisk, neither /system nor /system_root in fstab (it has / instead, which is useless), ANDROID_ROOT=/system, and a possible symlink from /system to /system_root/system - this failure to have a sensible, working fstab triggers the fallback to mounting directly from /dev/block/bootdevice which should exist on all modern devices which would need this SAR fallback - add basic slot support for the fallback mount, since Lineage Recovery also doesn't make symlinks to the active slot partitions --- META-INF/com/google/android/update-binary | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary index 709ef00..4fff323 100755 --- a/META-INF/com/google/android/update-binary +++ b/META-INF/com/google/android/update-binary @@ -97,11 +97,11 @@ mount_all() { elif [ -f /system/system/build.prop ]; then setup_mountpoint /system_root; $BB mount --move /system /system_root; - if [ $? != 0 ]; then - $BB umount /system; - $BB umount -l /system 2>/dev/null; - $BB mount -o ro -t auto /dev/block/bootdevice/by-name/system /system_root; - fi; + fi; + if [ $? != 0 ]; then + $BB umount /system; + $BB umount -l /system 2>/dev/null; + $BB mount -o ro -t auto /dev/block/bootdevice/by-name/system$(getprop ro.boot.slot_suffix 2>/dev/null) /system_root; fi; ;; esac; @@ -163,7 +163,7 @@ restore_env() { test "$OLDLDPRE" && export LD_PRELOAD="$OLDLDPRE"; umount_all; (for dir in /apex /system /system_root; do - if [ -e "${dir}_link" ]; then + if [ -L "${dir}_link" ]; then rmdir $dir; $BB mv -f ${dir}_link $dir; fi; -- cgit v1.2.3