OSDN Git Service

init.sh: create missed /dev/input/event*
[android-x86/device-generic-common.git] / init.sh
diff --git a/init.sh b/init.sh
index 5d342e3..b06667c 100644 (file)
--- a/init.sh
+++ b/init.sh
@@ -27,6 +27,7 @@ function init_misc()
        # device information
        setprop ro.product.manufacturer "$(cat $DMIPATH/sys_vendor)"
        setprop ro.product.model "$PRODUCT"
+       setprop ro.serialno "$(cat $DMIPATH/product_serial)"
 
        # a hack for USB modem
        lsusb | grep 1a8d:1000 && eject
@@ -132,6 +133,9 @@ function init_hal_bluetooth()
 function init_hal_camera()
 {
        case "$UEVENT" in
+               *81EK*)
+                       set_prop_if_empty hal.camera.0 0,0
+                       ;;
                *e-tabPro*)
                        set_prop_if_empty hal.camera.0 0,270
                        set_prop_if_empty hal.camera.2 1,90
@@ -182,25 +186,23 @@ function init_uvesafb()
 
 function init_hal_gralloc()
 {
-       case "$(cat /proc/fb | head -1)" in
-               *virtiodrmfb)
-                       if [ "$HWACCEL" != "0" ]; then
-                               set_property ro.hardware.hwcomposer drm
-                               set_property ro.hardware.gralloc gbm
-                               set_property debug.drm.mode.force ${video:-1280x800}
-                       fi
-                       set_prop_if_empty sleep.state none
-                       ;;
-               0*inteldrmfb|0*radeondrmfb|0*nouveaufb|0*svgadrmfb|0*amdgpudrmfb)
+       case "$(readlink /sys/class/graphics/fb0/device/driver)" in
+               *virtio_gpu)
+                       HWC=${HWC:-drm}
+                       GRALLOC=${GRALLOC:-gbm}
+                       video=${video:-1280x768}
+                       ;&
+               *i915|*radeon|*nouveau|*vmwgfx|*amdgpu)
                        if [ "$HWACCEL" != "0" ]; then
-                               set_property ro.hardware.gralloc drm
+                               ${HWC:+set_property ro.hardware.hwcomposer $HWC}
+                               set_property ro.hardware.gralloc ${GRALLOC:-drm}
                                set_drm_mode
                        fi
                        ;;
                "")
                        init_uvesafb
                        ;&
-               0*)
+               *)
                        ;;
        esac
 
@@ -226,7 +228,7 @@ function init_hal_power()
 
        # TODO
        case "$PRODUCT" in
-               HP*Omni*|OEMB|Surface*3|T10*TA)
+               HP*Omni*|OEMB|Standard*PC*|Surface*3|T10*TA|VMware*)
                        set_prop_if_empty sleep.state none
                        ;;
                e-tab*Pro)
@@ -321,7 +323,7 @@ function init_hal_sensors()
                        set_property ro.iio.accel.x.opt_scale -1
                        set_property ro.iio.accel.y.opt_scale -1
                        ;;
-               *SP111-33*)
+               *SP111-33*|*TP300L*)
                        set_property ro.iio.accel.quirks no-trig
                        ;&
                *ST70416-6*)
@@ -371,7 +373,7 @@ function init_tscal()
                *ST70416-6*)
                        modprobe gslx680_ts_acpi
                        ;&
-               *T91*|*T101*|*ET2002*|*74499FU*|*945GSE-ITE8712*|*CF-19[CDYFGKLP]*|*TECLAST:rntPAD*)
+               *81EK*|*T91**|*T101*|*ET2002*|*74499FU*|*945GSE-ITE8712*|*CF-19[CDYFGKLP]*|*TECLAST:rntPAD*)
                        create_pointercal
                        return
                        ;;
@@ -504,7 +506,7 @@ function do_bootcomplete()
                        alsa_amixer -c $c set Speaker 100%
                        alsa_amixer -c $c set Capture 80%
                        alsa_amixer -c $c set Capture cap
-                       alsa_amixer -c $c set PCM 100 unmute
+                       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' 1
@@ -512,6 +514,10 @@ function do_bootcomplete()
                fi
        done
 
+       for e in /sys/class/input/event*; do
+               [ -c /dev/input/`basename $e` ] || echo add > $e/uevent
+       done
+
        post_bootcomplete
 }