From b3767d19782c63de16b542fb4738690702ea7d85 Mon Sep 17 00:00:00 2001 From: osm0sis Date: Tue, 12 May 2020 18:01:09 -0300 Subject: Backend: try to preserve a working /etc/fstab on AOSP Q-based recovery --- META-INF/com/google/android/update-binary | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary index 159e4c2..b30ed1b 100755 --- a/META-INF/com/google/android/update-binary +++ b/META-INF/com/google/android/update-binary @@ -142,6 +142,11 @@ umount_all() { setup_env() { $BOOTMODE && return 1; $BB mount -o bind /dev/urandom /dev/random; + if [ -L /etc ]; then + setup_mountpoint /etc; + $BB cp -af /etc_link/* /etc; + $BB sed -i 's; / ; /system_root ;' /etc/fstab; + fi; umount_all; mount_all; OLD_LD_PATH=$LD_LIBRARY_PATH; @@ -172,7 +177,8 @@ restore_env() { test "$OLD_LD_PRE" && export LD_PRELOAD=$OLD_LD_PRE; test "$OLD_LD_CFG" && export LD_CONFIG_FILE=$OLD_LD_CFG; umount_all; - (for dir in /apex /system /system_root; do + test -L /etc_link && $BB rm -rf /etc/*; + (for dir in /apex /system /system_root /etc; do if [ -L "${dir}_link" ]; then rmdir $dir; $BB mv -f ${dir}_link $dir; -- cgit v1.2.3