device/generic/common
修訂 | 0a89b37e726046f8954bfbb9749c59b577a812c7 (tree) |
---|---|
時間 | 2017-10-10 04:08:40 |
作者 | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
nativebridge: support houdini 7.1
@@ -100,7 +100,6 @@ on property:debug.logcat=1 | ||
100 | 100 | class_start debug |
101 | 101 | |
102 | 102 | on property:persist.sys.nativebridge=1 |
103 | - mkdir /data/arm 0775 system system | |
104 | 103 | start nativebridge |
105 | 104 | |
106 | 105 | on property:persist.sys.nativebridge=0 |
@@ -18,6 +18,9 @@ LOCAL_CFLAGS := -Werror -Wall | ||
18 | 18 | LOCAL_CPPFLAGS := -std=c++11 |
19 | 19 | LOCAL_SHARED_LIBRARIES := libcutils libdl liblog |
20 | 20 | LOCAL_MULTILIB := both |
21 | -LOCAL_POST_INSTALL_CMD := mkdir -p $(TARGET_OUT)/{lib/arm,$(if $(filter true,$(TARGET_IS_64_BIT)),lib64/arm64)} | |
21 | +LOCAL_POST_INSTALL_CMD := $(hide) \ | |
22 | + rm -rf $(TARGET_OUT)/*/{arm*,*houdini*} {$(TARGET_OUT),$(PRODUCT_OUT)}/vendor/{*/arm*,*/*houdini*}; \ | |
23 | + mkdir -p $(TARGET_OUT)/{lib/arm,$(if $(filter true,$(TARGET_IS_64_BIT)),lib64/arm64)}; \ | |
24 | + touch $(TARGET_OUT)/lib/libhoudini.so $(if $(filter true,$(TARGET_IS_64_BIT)),$(TARGET_OUT)/lib64/libhoudini.so) | |
22 | 25 | |
23 | 26 | include $(BUILD_SHARED_LIBRARY) |
@@ -6,35 +6,41 @@ houdini_bin=0 | ||
6 | 6 | dest_dir=/system/lib$1/arm$1 |
7 | 7 | binfmt_misc_dir=/proc/sys/fs/binfmt_misc |
8 | 8 | |
9 | -cd /data/arm | |
10 | -if [ -e /system/lib$1/libhoudini.so ]; then | |
9 | +if [ -z "$1" ]; then | |
10 | + if [ "`uname -m`" = "x86_64" ]; then | |
11 | + v=7_y | |
12 | + url=http://goo.gl/SBU3is | |
13 | + else | |
14 | + v=7_x | |
15 | + url=http://goo.gl/0IJs40 | |
16 | + fi | |
17 | +else | |
18 | + v=7_z | |
19 | + url=http://goo.gl/FDrxVN | |
20 | +fi | |
21 | + | |
22 | +if [ -s /system/lib$1/libhoudini.so ]; then | |
11 | 23 | 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 | |
24 | +elif [ -e /system/etc/houdini$v.sfs ]; then | |
25 | + mount /system/etc/houdini$v.sfs $dest_dir | |
14 | 26 | else |
15 | 27 | if mountpoint -q $dest_dir; then |
16 | 28 | kill -9 `fuser -m $dest_dir` |
17 | 29 | umount -f $dest_dir |
18 | 30 | fi |
19 | - while ! busybox mount houdini$1.sfs $dest_dir; do | |
31 | + mkdir -p /data/arm | |
32 | + cd /data/arm | |
33 | + while ! mount houdini$v.sfs $dest_dir; do | |
20 | 34 | while [ "$(getprop net.dns1)" = "" ]; do |
21 | 35 | sleep 10 |
22 | 36 | done |
23 | - if [ -z "$1" ]; then | |
24 | - [ "`uname -m`" = "x86_64" ] && url=http://goo.gl/Knnmyl || url=http://goo.gl/JsoX2C | |
25 | - else | |
26 | - url=http://goo.gl/n6KtQa | |
27 | - fi | |
28 | - wget $url -cO houdini$1.sfs && continue | |
29 | - rm -f houdini$1.sfs | |
37 | + wget $url -cO houdini$v.sfs && continue | |
38 | + rm -f houdini$v.sfs | |
30 | 39 | sleep 30 |
31 | 40 | done |
32 | 41 | fi |
33 | 42 | |
34 | - | |
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 | |
43 | +[ -s /system/lib$1/libhoudini.so ] || mount --bind $dest_dir/libhoudini.so /system/lib$1/libhoudini.so | |
38 | 44 | |
39 | 45 | # this is to add the supported binary formats via binfmt_misc |
40 | 46 |
@@ -27,13 +27,11 @@ static NativeBridgeCallbacks *get_callbacks() | ||
27 | 27 | static NativeBridgeCallbacks *callbacks = nullptr; |
28 | 28 | |
29 | 29 | if (!callbacks) { |
30 | - const char *libnb = "/system/" | |
30 | + const char *libnb = "/system/lib" | |
31 | 31 | #ifdef __LP64__ |
32 | - "lib64/arm64/" | |
33 | -#else | |
34 | - "lib/arm/" | |
32 | + "64" | |
35 | 33 | #endif |
36 | - "libhoudini.so"; | |
34 | + "/libhoudini.so"; | |
37 | 35 | if (!native_handle) { |
38 | 36 | native_handle = dlopen(libnb, RTLD_LAZY); |
39 | 37 | if (!native_handle) { |