summaryrefslogtreecommitdiff
path: root/META-INF/com/google/android/update-binary
diff options
context:
space:
mode:
authorosm0sis <osm0sis@outlook.com>2020-05-12 18:01:09 -0300
committerosm0sis <osm0sis@outlook.com>2020-05-12 18:02:30 -0300
commitb3767d19782c63de16b542fb4738690702ea7d85 (patch)
treea1ab98883de6dfef4ab30dc70a6ce96f1eb1f032 /META-INF/com/google/android/update-binary
parent2d5bba8584b1a71e98b5efa441bc4ff24a1e4566 (diff)
Backend: try to preserve a working /etc/fstab on AOSP Q-based recovery
Diffstat (limited to 'META-INF/com/google/android/update-binary')
-rwxr-xr-xMETA-INF/com/google/android/update-binary8
1 files changed, 7 insertions, 1 deletions
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;