X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fdevice-generic-common.git;a=blobdiff_plain;f=nativebridge%2Fbin%2Fenable_nativebridge;h=70fe1cd928f92f4110bb49c3a33dc6914a4b2ead;hp=ef00891371777e8114c61d69aebbd7cafa53849d;hb=66510491d170867dfd28768cd5e385fe97a7fd9a;hpb=81475bc5b5714f0b5a3fc241de6f34acc6b79a68;ds=sidebyside diff --git a/nativebridge/bin/enable_nativebridge b/nativebridge/bin/enable_nativebridge index ef00891..70fe1cd 100644 --- a/nativebridge/bin/enable_nativebridge +++ b/nativebridge/bin/enable_nativebridge @@ -6,33 +6,30 @@ houdini_bin=0 dest_dir=/system/lib$1/arm$1 binfmt_misc_dir=/proc/sys/fs/binfmt_misc -cd $dest_dir - -if [ ! -s libhoudini.so ]; then - if touch .dl_houdini; then - rm -f .dl_houdini - else - cd .. && cp -a arm$1 /data/local/tmp - mount -t tmpfs tmpfs arm$1 && cd arm$1 && - cp -a /data/local/tmp/arm$1/* . && rm -rf /data/local/tmp/arm$1 +cd /data/arm +if [ -e /system/lib$1/libhoudini.so ]; then + log -pi -thoudini "found /system/lib$1/libhoudini.so" +elif [ -e /system/etc/houdini$1.sfs ]; then + busybox mount /system/etc/houdini$1.sfs $dest_dir +else + if mountpoint -q $dest_dir; then + kill -9 `fuser -m $dest_dir` + umount -f $dest_dir fi -fi - -cd /data/local/tmp -while [ ! -s $dest_dir/libhoudini.so ]; do - while [ "$(getprop net.dns1)" = "" ]; do - sleep 10 + while ! busybox mount houdini$1.sfs $dest_dir; do + while [ "$(getprop net.dns1)" = "" ]; do + sleep 10 + done + if [ -z "$1" ]; then + [ "`uname -m`" = "x86_64" ] && url=http://goo.gl/Knnmyl || url=http://goo.gl/JsoX2C + else + url=http://goo.gl/n6KtQa + fi + wget $url -cO houdini$1.sfs && continue + rm -f houdini$1.sfs + sleep 30 done - if [ -z "$1" ]; then - [ "`uname -m`" = "x86_64" ] && url=http://goo.gl/Xl1str || url=http://goo.gl/PA2qZ7 - else - url=http://goo.gl/L00S7l - fi - wget $url -cO houdini.tgz && - bzcat houdini.tgz | tar xvf - -C $dest_dir && rm -f houdini.tgz && break - rm -f houdini.tgz - sleep 30 -done +fi # if you don't see the files 'register' and 'status' in /proc/sys/fs/binfmt_misc