OSDN Git Service

init.sh: check driver name instead of fb name
[android-x86/device-generic-common.git] / init.sh
diff --git a/init.sh b/init.sh
index 706ddfb..25f283b 100644 (file)
--- a/init.sh
+++ b/init.sh
@@ -36,7 +36,7 @@ function init_misc()
 
        # enable sdcardfs if /data is not mounted on tmpfs or 9p
        mount | grep /data\ | grep -qE 'tmpfs|9p'
-       [ $? -ne 0 ] && modprobe sdcardfs
+       [ $? -eq 0 ] && set_prop_if_empty ro.sys.sdcardfs false
 
        # remove wl if it's not used
        local wifi
@@ -128,11 +128,18 @@ function init_hal_bluetooth()
 
 function init_hal_camera()
 {
-       case "$PRODUCT" in
-               e-tab*Pro)
+       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
                        ;;
+               *LenovoideapadD330*)
+                       set_prop_if_empty hal.camera.0 0,90
+                       set_prop_if_empty hal.camera.2 1,90
+                       ;;
                *)
                        ;;
        esac
@@ -177,15 +184,15 @@ function init_hal_gralloc()
 {
        [ "$VULKAN" = "1" ] && GRALLOC=gbm
 
-       case "$(cat /proc/fb | head -1)" in
-               *virtiodrmfb|*DRM*emulated)
+       case "$(readlink /sys/class/graphics/fb0/device/driver)" in
+               *virtio_gpu)
                        HWC=${HWC:-drm}
                        GRALLOC=${GRALLOC:-gbm}
                        video=${video:-1280x768}
                        ;&
-               0*i915drmfb|0*inteldrmfb|0*radeondrmfb|0*nouveau*|0*svgadrmfb|0*amdgpudrmfb)
+               *i915|*radeon|*nouveau|*vmwgfx|*amdgpu)
                        if [ "$HWACCEL" != "0" ]; then
-                               set_property ro.hardware.hwcomposer ${HWC:-}
+                               ${HWC:+set_property ro.hardware.hwcomposer $HWC}
                                set_property ro.hardware.gralloc ${GRALLOC:-drm}
                                set_drm_mode
                        fi
@@ -193,7 +200,7 @@ function init_hal_gralloc()
                "")
                        init_uvesafb
                        ;&
-               0*)
+               *)
                        ;;
        esac
 
@@ -208,11 +215,11 @@ function init_hal_hwcomposer()
 
 function init_hal_vulkan()
 {
-       case "$(cat /proc/fb | head -1)" in
-               0*i915drmfb|0*inteldrmfb)
+       case "$(readlink /sys/class/graphics/fb0/device/driver)" in
+               *i915)
                        set_property ro.hardware.vulkan android-x86
                        ;;
-               0*amdgpudrmfb)
+               *amdgpu)
                        set_property ro.hardware.vulkan radv
                        ;;
                *)
@@ -309,6 +316,10 @@ function init_hal_sensors()
                        modprobe hdaps
                        hal_sensors=hdaps
                        ;;
+               *LenovoideapadD330*)
+                       set_property ro.iio.accel.quirks no-trig
+                       set_property ro.iio.accel.order 102
+                       ;&
                *LINX1010B*)
                        set_property ro.iio.accel.x.opt_scale -1
                        set_property ro.iio.accel.z.opt_scale -1
@@ -374,7 +385,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
                        ;;
@@ -511,7 +522,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