summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorosm0sis <osm0sis@outlook.com>2020-01-27 15:28:11 -0400
committerosm0sis <osm0sis@outlook.com>2020-01-27 15:28:11 -0400
commit03af96a5415cd0b508e542a1ed8c9eb386c322a6 (patch)
treea4981eec65afa9900f0f1737feb2abc56f90f953
parentb772cca3ac3a7d8376829a2279c6200f68ea7dbf (diff)
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
-rwxr-xr-xMETA-INF/com/google/android/update-binary12
1 files 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;