3 PATH=/system/bin:/system/xbin
6 dest_dir=/system/lib$1/arm$1
7 binfmt_misc_dir=/proc/sys/fs/binfmt_misc
10 if [ -e /system/lib$1/libhoudini.so ]; then
11 log -pi -thoudini "found /system/lib$1/libhoudini.so"
12 elif [ -e /system/etc/houdini$1.sfs ]; then
13 busybox mount /system/etc/houdini$1.sfs $dest_dir
15 if mountpoint -q $dest_dir; then
16 kill -9 `fuser -m $dest_dir`
19 while ! busybox mount houdini$1.sfs $dest_dir; do
20 while [ "$(getprop net.dns1)" = "" ]; do
24 [ "`uname -m`" = "x86_64" ] && url=http://goo.gl/Knnmyl || url=http://goo.gl/JsoX2C
26 url=http://goo.gl/n6KtQa
28 wget $url -cO houdini$1.sfs && continue
35 # if you don't see the files 'register' and 'status' in /proc/sys/fs/binfmt_misc
36 # then run the following command:
37 # mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
39 # this is to add the supported binary formats via binfmt_misc
41 if [ ! -e $binfmt_misc_dir/register ]; then
42 mount -t binfmt_misc none $binfmt_misc_dir
46 if [ -e register ]; then
47 # register Houdini for arm binaries
49 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
50 echo ':arm_dyn:M::\\x7f\\x45\\x4c\\x46\\x01\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x28::'"$dest_dir/houdini:P" > register
52 echo ':arm64_exe:M::\\x7f\\x45\\x4c\\x46\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\xb7::'"$dest_dir/houdini64:P" > register
53 echo ':arm64_dyn:M::\\x7f\\x45\\x4c\\x46\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\xb7::'"$dest_dir/houdini64:P" > register
55 if [ -e arm${1}_exe ]; then
59 log -pe -thoudini "No binfmt_misc support"
62 if [ $houdini_bin -eq 0 ]; then
63 log -pe -thoudini "houdini$1 enabling failed!"
65 log -pi -thoudini "houdini$1 enabled"
68 [ "$(getprop ro.zygote)" = "zygote64_32" -a -z "$1" ] && exec $0 64