summaryrefslogtreecommitdiff
path: root/META-INF/com
diff options
context:
space:
mode:
authorosm0sis <osm0sis@outlook.com>2016-02-16 16:42:18 -0400
committerosm0sis <osm0sis@outlook.com>2016-02-16 16:42:18 -0400
commitcbcbc49e13a058af7d7c807f2e1490e35162c9e1 (patch)
tree5a0c3b54f7416629c1b42b6adf95c884747dfc0e /META-INF/com
parentd05847d1ec3473bd877913b08edf6f8c17548ab5 (diff)
Backend: Add check for whether busybox symlink setup succeeded, fixes
- fail on recoveries where symlinking our busybox environment doesn't work (CM Recovery on some devices) - use the included busybox for awk since toybox is lacking (CM Recovery)
Diffstat (limited to 'META-INF/com')
-rwxr-xr-xMETA-INF/com/google/android/update-binary9
1 files changed, 6 insertions, 3 deletions
diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary
index a8d54fa..8cf0a9b 100755
--- a/META-INF/com/google/android/update-binary
+++ b/META-INF/com/google/android/update-binary
@@ -14,7 +14,7 @@ ui_print() {
}
show_progress() { echo "progress $1 $2" > $OUTFD; }
set_perm_recursive() {
- dirs=$(echo $* | awk '{ print substr($0, index($0,$5)) }');
+ dirs=$(echo $* | $bb awk '{ print substr($0, index($0,$5)) }');
for i in $dirs; do
chown -R $1.$2 $i; chown -R $1:$2 $i;
find "$i" -type d -exec chmod $3 {} +;
@@ -33,6 +33,8 @@ unzip -o "$ZIP";
if [ $? != 0 -o -z "$(ls /tmp/anykernel/tools)" ]; then
abort "Unzip failed. Aborting...";
fi;
+chmod -R 755 /tmp/anykernel/tools /tmp/anykernel/bin;
+bb=/tmp/anykernel/tools/busybox;
ui_print "$(file_getprop /tmp/anykernel/anykernel.sh kernel.string)";
ui_print " ";
@@ -66,11 +68,12 @@ if [ "$(file_getprop /tmp/anykernel/anykernel.sh do.initd)" == 1 ]; then
fi;
ui_print "Installing kernel...";
-chmod -R 755 /tmp/anykernel/tools /tmp/anykernel/bin;
-bb=/tmp/anykernel/tools/busybox;
for i in $($bb --list); do
ln -s $bb /tmp/anykernel/bin/$i;
done;
+if [ $? != 0 -o -z "$(ls /tmp/anykernel/bin)" ]; then
+ abort "Recovery busybox setup failed. Aborting...";
+fi;
PATH="/tmp/anykernel/bin:$PATH" $bb ash /tmp/anykernel/anykernel.sh $2;
if [ $? != "0" ]; then
abort;