diff options
author | osm0sis <osm0sis@outlook.com> | 2016-01-17 07:47:30 -0400 |
---|---|---|
committer | osm0sis <osm0sis@outlook.com> | 2016-01-24 13:31:55 -0400 |
commit | c79016cd39b772a05e39ed5d0b52c4b942e46914 (patch) | |
tree | b7e619548d35eb851add7d56bfbb1bc7520546b5 /META-INF/com | |
parent | 65520217ef02a74630efca936ffaab83adade4d9 (diff) |
Backend: workaround toybox inclusion in Cyanogen Recovery
- add busybox to the zip to provide a uniform expected environment
- set up busybox symlinks in /tmp and execute anykernel.sh from a shell created with these at the front of the path, overriding the recovery applets
Diffstat (limited to 'META-INF/com')
-rwxr-xr-x | META-INF/com/google/android/update-binary | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary index ce82f97..549305d 100755 --- a/META-INF/com/google/android/update-binary +++ b/META-INF/com/google/android/update-binary @@ -27,7 +27,7 @@ abort() { ui_print "$*"; umount /system; umount /data; exit 1; } show_progress 1.34 4; ui_print " "; -mkdir -p /tmp/anykernel; +mkdir -p /tmp/anykernel/bin; cd /tmp/anykernel; unzip -o "$ZIP"; if [ $? != 0 -o -z "$(ls /tmp/anykernel)" ]; then @@ -38,8 +38,8 @@ ui_print "$(file_getprop /tmp/anykernel/anykernel.sh kernel.string)"; ui_print " "; ui_print "AnyKernel2 by osm0sis @ xda-developers"; ui_print " "; -/sbin/busybox mount -o ro /system; -/sbin/busybox mount /data; +mount -o ro /system; +mount /data; if [ "$(file_getprop /tmp/anykernel/anykernel.sh do.devicecheck)" == 1 ]; then ui_print "Checking device..."; @@ -59,14 +59,19 @@ fi; if [ "$(file_getprop /tmp/anykernel/anykernel.sh do.initd)" == 1 ]; then ui_print "Creating init.d..."; ui_print " "; - /sbin/busybox mount -o remount,rw /system; + mount -o remount,rw /system; mkdir /system/etc/init.d; set_perm_recursive 0 0 0755 0755 /system/etc/init.d; - /sbin/busybox mount -o remount,ro /system; + mount -o remount,ro /system; fi; ui_print "Installing kernel..."; -/sbin/sh /tmp/anykernel/anykernel.sh $2; +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; +PATH="/tmp/anykernel/bin:$PATH" $bb ash /tmp/anykernel/anykernel.sh $2; if [ $? != "0" ]; then abort; fi; @@ -74,10 +79,10 @@ fi; if [ "$(file_getprop /tmp/anykernel/anykernel.sh do.modules)" == 1 ]; then ui_print " "; ui_print "Pushing modules..."; - /sbin/busybox mount -o remount,rw /system; + mount -o remount,rw /system; cp -rf /tmp/anykernel/modules/* /system/lib/modules/; set_perm_recursive 0 0 0755 0644 /system/lib/modules; - /sbin/busybox mount -o remount,ro /system; + mount -o remount,ro /system; fi; if [ "$(file_getprop /tmp/anykernel/anykernel.sh do.cleanup)" == 1 ]; then |