From c2d3d2513bb7a649c84f8c6ee4384741ad12a8c6 Mon Sep 17 00:00:00 2001 From: osm0sis Date: Fri, 12 Jul 2019 21:07:16 -0300 Subject: [PATCH] Backend: speed up and simplify is_mounted use --- META-INF/com/google/android/update-binary | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary index 610c9b6..8f6258b 100755 --- a/META-INF/com/google/android/update-binary +++ b/META-INF/com/google/android/update-binary @@ -42,7 +42,7 @@ debugging() { ;; esac; } -is_mounted() { $bb mount | $bb grep " $1 "; } +is_mounted() { $bb mount | $bb grep -q " $1 "; } unmount_all() { ($bb umount /system; if [ -d /system_root -a ! -f /system/build.prop ]; then @@ -108,7 +108,7 @@ fi; ui_print " " "AnyKernel3 by osm0sis @ xda-developers" " " " "; unmount_all; -if [ ! "$(is_mounted /system)" ]; then +if ! is_mounted /system; then $bb mount -o ro -t auto /system; fi; ($bb mount -o ro -t auto /vendor; @@ -201,7 +201,7 @@ if [ "$(file_getprop anykernel.sh do.modules)" == 1 ]; then *) modcon=system;; esac; fi; - if [ "$(is_mounted $modtarget)" ]; then + if is_mounted $modtarget; then $bb mount -o rw,remount -t auto $modtarget; fi; mkdir -p $(dirname $modtarget); @@ -211,7 +211,7 @@ if [ "$(file_getprop anykernel.sh do.modules)" == 1 ]; then if [ "$modcon" ]; then chcon "u:object_r:${modcon}_file:s0" $modtarget; fi; - if [ "$(is_mounted $modtarget)" ]; then + if is_mounted $modtarget; then $bb mount -o ro,remount -t auto $modtarget; fi; done;