OSDN Git Service

Merge remote-tracking branch 'x86/nougat-x86' into oreo-x86
authorChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 18 Oct 2017 11:08:12 +0000 (19:08 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 18 Oct 2017 11:08:12 +0000 (19:08 +0800)
init.sh
init.x86.rc
nativebridge/Android.mk
nativebridge/bin/enable_nativebridge
nativebridge/src/libnb.cpp
packages.mk

diff --git a/init.sh b/init.sh
index 626ab4b..6b41a50 100644 (file)
--- a/init.sh
+++ b/init.sh
@@ -21,6 +21,10 @@ function init_misc()
 
        # in case no cpu governor driver autoloads
        [ -d /sys/devices/system/cpu/cpu0/cpufreq ] || modprobe acpi-cpufreq
+
+       # enable sdcardfs if /data is not mounted on tmpfs or 9p
+       mount | grep /data\ | grep -qE 'tmpfs|9p'
+       [ $? -ne 0 ] && modprobe sdcardfs
 }
 
 function init_hal_audio()
index e0b2df9..bd6d033 100644 (file)
@@ -100,7 +100,6 @@ on property:debug.logcat=1
     class_start debug
 
 on property:persist.sys.nativebridge=1
-    mkdir /data/arm 0775 system system
     start nativebridge
 
 on property:persist.sys.nativebridge=0
index 11fc008..75cd99e 100644 (file)
@@ -18,6 +18,9 @@ LOCAL_CFLAGS := -Werror -Wall
 LOCAL_CPPFLAGS := -std=c++11
 LOCAL_SHARED_LIBRARIES := libcutils libdl liblog
 LOCAL_MULTILIB := both
-LOCAL_POST_INSTALL_CMD := mkdir -p $(TARGET_OUT)/{lib/arm,$(if $(filter true,$(TARGET_IS_64_BIT)),lib64/arm64)}
+LOCAL_POST_INSTALL_CMD := $(hide) \
+    rm -rf $(TARGET_OUT)/*/{arm*,*houdini*} {$(TARGET_OUT),$(PRODUCT_OUT)}/vendor/{*/arm*,*/*houdini*}; \
+    mkdir -p $(TARGET_OUT)/{lib/arm,$(if $(filter true,$(TARGET_IS_64_BIT)),lib64/arm64)}; \
+    touch $(TARGET_OUT)/lib/libhoudini.so $(if $(filter true,$(TARGET_IS_64_BIT)),$(TARGET_OUT)/lib64/libhoudini.so)
 
 include $(BUILD_SHARED_LIBRARY)
index 18a06db..0f8cd13 100644 (file)
@@ -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
 
index aa963cf..386a514 100644 (file)
@@ -27,13 +27,11 @@ static NativeBridgeCallbacks *get_callbacks()
     static NativeBridgeCallbacks *callbacks = nullptr;
 
     if (!callbacks) {
-        const char *libnb = "/system/"
+        const char *libnb = "/system/lib"
 #ifdef __LP64__
-                "lib64/arm64/"
-#else
-                "lib/arm/"
+                "64"
 #endif
-                "libhoudini.so";
+                "/libhoudini.so";
         if (!native_handle) {
             native_handle = dlopen(libnb, RTLD_LAZY);
             if (!native_handle) {
index dfa8566..661d329 100644 (file)
@@ -22,7 +22,6 @@ PRODUCT_PACKAGES := \
     Development \
     Galaxy4 \
     GlobalTime \
-    HardwareCollector \
     HoloSpiralWallpaper \
     Launcher3 \
     LiveWallpapers \