summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorosm0sis <osm0sis@outlook.com>2018-12-11 13:34:37 -0400
committerosm0sis <osm0sis@outlook.com>2018-12-11 13:34:37 -0400
commitfd881bd8d7397a28346c99a0875eee3493341166 (patch)
tree32af3577c5e862ca387690948a593321f3c86975
parent6d5332e05468d508be1f6cb979264e1e65a3f4a1 (diff)
Backend: only attempt module bind remount if already mounted
- blindly attempting to remount broke module placement on some ROMs (e.g. Pocophone MIUI stock)
-rwxr-xr-xMETA-INF/com/google/android/update-binary10
1 files changed, 7 insertions, 3 deletions
diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary
index deb2b1a..d0ee4a8 100755
--- a/META-INF/com/google/android/update-binary
+++ b/META-INF/com/google/android/update-binary
@@ -13,7 +13,7 @@ ui_print() {
done;
}
show_progress() { echo "progress $1 $2" > $OUTFD; }
-file_getprop() { grep "^$2=" "$1" | cut -d= -f2; }
+file_getprop() { $bb grep "^$2=" "$1" | $bb cut -d= -f2; }
if [ ! "$(getprop 2>/dev/null)" ]; then
getprop() {
local propval="$(file_getprop /default.prop $1 2>/dev/null)";
@@ -147,7 +147,9 @@ if [ "$(file_getprop /tmp/anykernel/anykernel.sh do.modules)" == 1 ]; then
*) mod=system;;
esac;
fi;
- $bb mount -o rw,remount -t auto /$module 2>/dev/null;
+ if [ "$($bb mount | $bb grep " $(echo $module | $bb cut -c2-) ")" ]; then
+ $bb mount -o rw,remount -t auto /$module;
+ fi;
mkdir -p $(dirname /$module);
$bb cp -rLf $module /$module;
$bb chown 0:0 /$module;
@@ -155,7 +157,9 @@ if [ "$(file_getprop /tmp/anykernel/anykernel.sh do.modules)" == 1 ]; then
if [ "$mod" ]; then
chcon "u:object_r:${mod}_file:s0" /$module;
fi;
- $bb mount -o ro,remount -t auto /$module 2>/dev/null;
+ if [ "$($bb mount | $bb grep " $(echo $module | $bb cut -c2-) ")" ]; then
+ $bb mount -o ro,remount -t auto /$module;
+ fi;
done;
cd /tmp/anykernel;
$bb mount -o ro,remount -t auto /system;