OSDN Git Service

Merge remote-tracking branch 'x86/nougat-x86' into cm-14.1-x86
authorChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 26 Oct 2017 10:27:29 +0000 (18:27 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 26 Oct 2017 10:27:29 +0000 (18:27 +0800)
BoardConfig.mk
gpu/gpu_mesa.mk
init.sh
init.x86.rc
nativebridge/Android.mk
nativebridge/bin/enable_nativebridge
nativebridge/src/libnb.cpp
overlay/frameworks/base/core/res/res/values/config.xml

index 552e913..9dd7703 100644 (file)
@@ -69,7 +69,7 @@ BOARD_WPA_SUPPLICANT_DRIVER := NL80211
 WPA_SUPPLICANT_VERSION := VER_2_1_DEVEL
 WIFI_DRIVER_MODULE_NAME := brcmfmac
 
-BOARD_GPU_DRIVERS ?= i915 i965 nouveau r300g r600g radeonsi swrast virgl vmwgfx
+BOARD_GPU_DRIVERS ?= i915 i965 nouveau r300g r600g radeonsi virgl vmwgfx
 ifneq ($(strip $(BOARD_GPU_DRIVERS)),)
 TARGET_HARDWARE_3D := true
 endif
index ec2bdac..448d95d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2011 The Android-x86 Open Source Project
+# Copyright (C) 2011-2017 The Android-x86 Open Source Project
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -15,5 +15,10 @@ PRODUCT_PACKAGES := \
     libGLES_mesa    \
     libtxc_dxtn     \
 
+PRODUCT_PACKAGES += \
+    libEGL_swiftshader \
+    libGLESv1_CM_swiftshader \
+    libGLESv2_swiftshader \
+
 PRODUCT_PROPERTY_OVERRIDES := \
     ro.opengles.version = 196608
diff --git a/init.sh b/init.sh
index 8ca4e3b..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()
@@ -127,20 +131,23 @@ function init_uvesafb()
                        ;;
        esac
 
-       [ "$HWACCEL" = "0" ] && bpp=16 || bpp=32
-       modprobe uvesafb mode_option=${UVESA_MODE:-1024x768}-$bpp ${UVESA_OPTION:-mtrr=3 scroll=redraw}
+       modprobe uvesafb mode_option=${UVESA_MODE:-1024x768}-32 ${UVESA_OPTION:-mtrr=3 scroll=redraw}
 }
 
 function init_hal_gralloc()
 {
        case "$(cat /proc/fb | head -1)" in
                *virtiodrmfb)
-                       set_property ro.hardware.hwcomposer drm
-                       set_property ro.hardware.gralloc gbm
+                       if [ "$HWACCEL" != "0" ]; then
+                               set_property ro.hardware.hwcomposer drm
+                               set_property ro.hardware.gralloc gbm
+                       fi
                        ;;
                0*inteldrmfb|0*radeondrmfb|0*nouveaufb|0*svgadrmfb|0*amdgpudrmfb)
-                       set_property ro.hardware.gralloc drm
-                       set_drm_mode
+                       if [ "$HWACCEL" != "0" ]; then
+                               set_property ro.hardware.gralloc drm
+                               set_drm_mode
+                       fi
                        ;;
                "")
                        init_uvesafb
@@ -251,7 +258,7 @@ function init_hal_sensors()
                        set_property hal.sensors.iio.accel.matrix 0,1,0,1,0,0,0,0,-1
                        ;;
                *)
-                       #has_sensors=false
+                       has_sensors=false
                        ;;
        esac
 
@@ -412,6 +419,7 @@ function do_bootcomplete()
                        alsa_amixer -c $c set Capture cap
                        alsa_amixer -c $c set PCM 100 unmute
                        alsa_amixer -c $c set SPO unmute
+                       alsa_amixer -c $c set IEC958 on
                        alsa_amixer -c $c set 'Mic Boost' 3
                        alsa_amixer -c $c set 'Internal Mic Boost' 3
                fi
@@ -435,9 +443,6 @@ for c in `cat /proc/cmdline`; do
                        eval $c
                        if [ -z "$1" ]; then
                                case $c in
-                                       HWACCEL=*)
-                                               set_property debug.egl.hw $HWACCEL
-                                               ;;
                                        DEBUG=*)
                                                [ -n "$DEBUG" ] && set_property debug.logcat 1
                                                ;;
index 12678f7..738d98f 100644 (file)
@@ -10,8 +10,6 @@ on early-init
 #   export EGL_DRIVERS egl_dri2
 
 on init
-    symlink /sdcard /mnt/sdcard
-    symlink /sdcard /storage/sdcard0
 
 on fs
     mount_all /fstab.${ro.hardware}
@@ -104,11 +102,7 @@ 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
     stop nativebridge
-
-on property:debug.egl.hw=0
-    setprop ro.kernel.qemu 1
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 97274a8..306de9d 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
-               busybox wget $url -cO houdini$1.sfs && continue
-               rm -f houdini$1.sfs
+               busybox 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 a5e0aae..3e0fe2b 100644 (file)
 <!-- These resources are around just to allow their values to be customized
      for different hardware and product builds. -->
 <resources>
+    <!-- List of regexpressions describing the interface (if any) that represent tetherable
+         USB interfaces.  If the device doesn't want to support tething over USB this should
+         be empty.  An example would be "usb.*" -->
+    <string-array translatable="false" name="config_tether_usb_regexs">
+        <item>"usb\\d"</item>
+        <item>"rndis\\d"</item>
+    </string-array>
+
+    <!-- List of regexpressions describing the interface (if any) that represent tetherable
+         Wifi interfaces.  If the device doesn't want to support tethering over Wifi this
+         should be empty.  An example would be "softap.*" -->
+    <string-array translatable="false" name="config_tether_wifi_regexs">
+        <item>"wlan0"</item>
+    </string-array>
+
+    <!-- List of regexpressions describing the interface (if any) that represent tetherable
+         bluetooth interfaces.  If the device doesn't want to support tethering over bluetooth this
+         should be empty. -->
+    <string-array translatable="false" name="config_tether_bluetooth_regexs">
+           <item>"bt-pan"</item>
+    </string-array>
+
+    <!-- Array of allowable ConnectivityManager network types for tethering -->
+    <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
+         [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
+    <integer-array translatable="false" name="config_tether_upstream_types">
+        <item>0</item>
+        <item>1</item>
+        <item>5</item>
+        <item>7</item>
+    </integer-array>
+
     <!-- This string array should be overridden by the device to present a list of network
                   attributes.  This is used by the connectivity manager to decide which networks can coexist
          based on the hardware -->
@@ -36,6 +68,7 @@
         <item>"mobile_supl,3,0,2,60000,true"</item>
         <item>"mobile_hipri,5,0,3,60000,true"</item>
         <item>"ethernet,9,9,1,-1,true"</item>
+        <item>"bluetooth,7,7,2,-1,true"</item>
         <item>"mobile_fota,10,0,2,60000,true"</item>
         <item>"mobile_ims,11,0,2,60000,true"</item>
         <item>"mobile_cbs,12,0,2,60000,true"</item>
@@ -50,6 +83,7 @@
     <string-array translatable="false" name="radioAttributes">
         <item>"1,1"</item>
         <item>"0,1"</item>
+        <item>"7,1"</item>
         <item>"9,1"</item>
     </string-array>