• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

device/generic/common


Commit MetaInfo

修訂0a89b37e726046f8954bfbb9749c59b577a812c7 (tree)
時間2017-10-10 04:08:40
作者Chih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

nativebridge: support houdini 7.1

Change Summary

差異

--- a/init.x86.rc
+++ b/init.x86.rc
@@ -100,7 +100,6 @@ on property:debug.logcat=1
100100 class_start debug
101101
102102 on property:persist.sys.nativebridge=1
103- mkdir /data/arm 0775 system system
104103 start nativebridge
105104
106105 on property:persist.sys.nativebridge=0
--- a/nativebridge/Android.mk
+++ b/nativebridge/Android.mk
@@ -18,6 +18,9 @@ LOCAL_CFLAGS := -Werror -Wall
1818 LOCAL_CPPFLAGS := -std=c++11
1919 LOCAL_SHARED_LIBRARIES := libcutils libdl liblog
2020 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)
2225
2326 include $(BUILD_SHARED_LIBRARY)
--- a/nativebridge/bin/enable_nativebridge
+++ b/nativebridge/bin/enable_nativebridge
@@ -6,35 +6,41 @@ houdini_bin=0
66 dest_dir=/system/lib$1/arm$1
77 binfmt_misc_dir=/proc/sys/fs/binfmt_misc
88
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
1123 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
1426 else
1527 if mountpoint -q $dest_dir; then
1628 kill -9 `fuser -m $dest_dir`
1729 umount -f $dest_dir
1830 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
2034 while [ "$(getprop net.dns1)" = "" ]; do
2135 sleep 10
2236 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
3039 sleep 30
3140 done
3241 fi
3342
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
3844
3945 # this is to add the supported binary formats via binfmt_misc
4046
--- a/nativebridge/src/libnb.cpp
+++ b/nativebridge/src/libnb.cpp
@@ -27,13 +27,11 @@ static NativeBridgeCallbacks *get_callbacks()
2727 static NativeBridgeCallbacks *callbacks = nullptr;
2828
2929 if (!callbacks) {
30- const char *libnb = "/system/"
30+ const char *libnb = "/system/lib"
3131 #ifdef __LP64__
32- "lib64/arm64/"
33-#else
34- "lib/arm/"
32+ "64"
3533 #endif
36- "libhoudini.so";
34+ "/libhoudini.so";
3735 if (!native_handle) {
3836 native_handle = dlopen(libnb, RTLD_LAZY);
3937 if (!native_handle) {