summaryrefslogtreecommitdiff
path: root/META-INF
diff options
context:
space:
mode:
authorosm0sis <osm0sis@outlook.com>2020-02-14 13:33:41 -0400
committerosm0sis <osm0sis@outlook.com>2020-02-14 13:33:41 -0400
commit273384db045b310faa5916d38df6d7be4729083e (patch)
treeabd25bd3487adbd6dc4f8cec78a5e3c2626c1fc4 /META-INF
parent5bec49dc98e3b227c27d6107588ecde3247f9d12 (diff)
Backend: fixes for booted flashing and addon.d-v2
- only do setup_env and restore_env when in recovery to prevent environment/mount issues post-install - use busybox [ for simple integer test to ensure known numerical operator behavior
Diffstat (limited to 'META-INF')
-rwxr-xr-xMETA-INF/com/google/android/update-binary24
1 files changed, 12 insertions, 12 deletions
diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary
index 6946fef..55d7625 100755
--- a/META-INF/com/google/android/update-binary
+++ b/META-INF/com/google/android/update-binary
@@ -120,18 +120,16 @@ mount_all() {
$BB mount -o bind /system_root/system /system;
fi;
fi;
- $BOOTMODE || mount_apex;
+ mount_apex;
}
umount_all() {
- (if ! $BOOTMODE; then
- umount_apex;
- if [ ! -d /postinstall/tmp ]; then
- $BB umount /system;
- $BB umount -l /system;
- if [ -e /system_root ]; then
- $BB umount /system_root;
- $BB umount -l /system_root;
- fi;
+ (umount_apex;
+ if [ ! -d /postinstall/tmp ]; then
+ $BB umount /system;
+ $BB umount -l /system;
+ if [ -e /system_root ]; then
+ $BB umount /system_root;
+ $BB umount -l /system_root;
fi;
fi;
umount /vendor;
@@ -142,7 +140,8 @@ umount_all() {
fi) 2>/dev/null;
}
setup_env() {
- $BOOTMODE || $BB mount -o bind /dev/urandom /dev/random;
+ $BOOTMODE && return 1;
+ $BB mount -o bind /dev/urandom /dev/random;
umount_all;
mount_all;
OLD_LD_PATH=$LD_LIBRARY_PATH;
@@ -166,6 +165,7 @@ setup_env() {
fi;
}
restore_env() {
+ $BOOTMODE && return 1;
local dir;
unset -f getprop;
test "$OLD_LD_PATH" && export LD_LIBRARY_PATH=$OLD_LD_PATH;
@@ -224,7 +224,7 @@ do_devicecheck() {
fi;
}
int2ver() {
- if [ "$1" -eq "$1" ] 2>/dev/null; then
+ if $BB [ "$1" -eq "$1" ] 2>/dev/null; then
echo "$1.0.0";
elif [ ! "$(echo "$1" | $BB cut -d. -f3)" ]; then
echo "$1.0";