From bcbffd18cda8b95daa2b37c5d0a3c9ae2d98581b Mon Sep 17 00:00:00 2001 From: Andreas Blaesius Date: Tue, 23 Feb 2016 13:39:04 -0800 Subject: espresso: set espresso and espressowifi variants to portrait mode PS1: initial setup, hwrotation on init for espresso and espressowifi variants PS2-5: proper Selinux rules for Android 5.1 and newer, move ramdisk to system/bin PS6: also set accelerometer and geomagnetic position via sysfs and update Selinux rules Change-Id: I43c662fe98f460e3380aeaa230b1d139d95bd262 --- init.espresso.variant.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 init.espresso.variant.sh (limited to 'init.espresso.variant.sh') diff --git a/init.espresso.variant.sh b/init.espresso.variant.sh new file mode 100644 index 0000000..81ff4e2 --- /dev/null +++ b/init.espresso.variant.sh @@ -0,0 +1,29 @@ +#!/system/bin/sh +# Copyright (c) 2016 OMAP4-AOSP +# Copyright (c) Ketut P. Kumajaya, Sept 2013 + +export PATH=/system/bin + +DEVICE=/sys/board_properties/type + +if [ -f "$DEVICE" ] +then + variant=`cat $DEVICE` + case "$variant" in + "espresso" | "espressowifi") + # set p31xx to portrait mode + setprop ro.sf.hwrotation 270 + + # set mms136 touchcreen driver orientation + echo 1 > /sys/devices/virtual/sec/tsp/pivot + + # set accelerometer position + position=$(find /sys/devices/virtual/input/ -type f -name name | xargs grep '^accelerometer$' | sed 's@name:accelerometer@position@') + echo -n 6 > $position + + # set geomagnetic position + position=$(find /sys/devices/platform/omap/omap_i2c.4/i2c-4/4-002e/input/ -type f -name name | xargs grep '^geomagnetic$' | sed 's@name:geomagnetic@position@') + echo -n 6 > $position + ;; + esac +fi -- cgit v1.1