OSDN Git Service

Merge remote-tracking branch 'x86/nougat-x86' into oreo-x86
[android-x86/device-generic-common.git] / init.sh
diff --git a/init.sh b/init.sh
index 2ae69af..c92f375 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
@@ -250,15 +257,22 @@ function init_hal_sensors()
                *ONDATablet*)
                        set_property hal.sensors.iio.accel.matrix 0,1,0,1,0,0,0,0,-1
                        ;;
+               *Surface.3*|*svnOEMB*)
+                       set_property ro.iio.accel.y.opt_scale -1
+                       ;&
+               *T10*TA*)
+                       set_property ro.iio.accel.x.opt_scale -1
+                       set_property ro.iio.accel.z.opt_scale -1
+                       ;;
                *)
-                       #has_sensors=false
+                       has_sensors=false
                        ;;
        esac
 
        # has iio sensor-hub?
        if [ -n "`ls /sys/bus/iio/devices/iio:device* 2> /dev/null`" ]; then
                busybox chown -R 1000.1000 /sys/bus/iio/devices/iio:device*/
-               lsmod | grep -q hid_sensor_accel_3d && hal_sensors=hsb || hal_sensors=iio
+               hal_sensors=iio
        elif lsmod | grep -q lis3lv02d_i2c; then
                hal_sensors=hdaps
        fi
@@ -436,9 +450,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
                                                ;;