X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;ds=sidebyside;f=nativebridge%2Fbin%2Fenable_nativebridge;h=0f8cd13653e20263b536eaf657afcd359bd79a30;hb=409ee1298dd6c75a73deb9fbb261683b5e5f7bcf;hp=70fe1cd928f92f4110bb49c3a33dc6914a4b2ead;hpb=66510491d170867dfd28768cd5e385fe97a7fd9a;p=android-x86%2Fdevice-generic-common.git diff --git a/nativebridge/bin/enable_nativebridge b/nativebridge/bin/enable_nativebridge index 70fe1cd..0f8cd13 100644 --- a/nativebridge/bin/enable_nativebridge +++ b/nativebridge/bin/enable_nativebridge @@ -6,35 +6,41 @@ houdini_bin=0 dest_dir=/system/lib$1/arm$1 binfmt_misc_dir=/proc/sys/fs/binfmt_misc -cd /data/arm -if [ -e /system/lib$1/libhoudini.so ]; then +if [ -z "$1" ]; then + if [ "`uname -m`" = "x86_64" ]; then + v=7_y + url=http://goo.gl/SBU3is + else + v=7_x + url=http://goo.gl/0IJs40 + fi +else + v=7_z + url=http://goo.gl/FDrxVN +fi + +if [ -s /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 +elif [ -e /system/etc/houdini$v.sfs ]; then + mount /system/etc/houdini$v.sfs $dest_dir else if mountpoint -q $dest_dir; then kill -9 `fuser -m $dest_dir` umount -f $dest_dir fi - while ! busybox mount houdini$1.sfs $dest_dir; do + mkdir -p /data/arm + cd /data/arm + while ! mount houdini$v.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 + wget $url -cO houdini$v.sfs && continue + rm -f houdini$v.sfs sleep 30 done fi - -# if you don't see the files 'register' and 'status' in /proc/sys/fs/binfmt_misc -# then run the following command: -# mount -t binfmt_misc none /proc/sys/fs/binfmt_misc +[ -s /system/lib$1/libhoudini.so ] || mount --bind $dest_dir/libhoudini.so /system/lib$1/libhoudini.so # this is to add the supported binary formats via binfmt_misc @@ -44,6 +50,7 @@ fi cd $binfmt_misc_dir if [ -e register ]; then + [ -e /system/bin/houdini$1 ] && dest_dir=/system/bin # register Houdini for arm binaries if [ -z "$1" ]; then echo ':arm_exe:M::\\x7f\\x45\\x4c\\x46\\x01\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x28::'"$dest_dir/houdini:P" > register