diff options
| author | Hashcode <hashcode0f@gmail.com> | 2014-12-23 12:00:22 -0800 |
|---|---|---|
| committer | doc <doc.divxm@gmail.com> | 2014-12-27 02:27:53 +0200 |
| commit | b2455e563f84e32b977e99cde48cd5ed9847ac1b (patch) | |
| tree | eb99b4d8b6c104ab44d6aa2fe8c8dd66e0eedf1d | |
| parent | cfb19738aaad4b261b999450a16185eea24122a4 (diff) | |
otter-common: add init.otter-common.rc for common 1st/2nd gen KC1 settings
In each sub-device "import init.otter-common.rc" to use this file
Change-Id: Iddf497af47c66da3932e1a47aedcf85c46297acc
| -rw-r--r-- | common.mk | 4 | ||||
| -rw-r--r-- | init.otter-common.rc | 145 |
2 files changed, 149 insertions, 0 deletions
@@ -35,6 +35,10 @@ PRODUCT_PACKAGES += \ # frameworks/native/data/etc/android.hardware.wifi.direct.xml:system/etc/permissions/android.hardware.wifi.direct.xml #endif +# Rootfs +PRODUCT_COPY_FILES += \ + $(OTTER_COMMON_FOLDER)/init.otter-common.rc:/root/init.otter-common.rc + # Prebuilts /system/bin PRODUCT_COPY_FILES += \ $(OTTER_COMMON_FOLDER)/prebuilt/bin/bbx:/system/bin/bbx diff --git a/init.otter-common.rc b/init.otter-common.rc new file mode 100644 index 0000000..3b39841 --- /dev/null +++ b/init.otter-common.rc @@ -0,0 +1,145 @@ +on fs + # change permissions for i2c-2 device + chmod 0660 /dev/i2c-2 + chown media media /dev/i2c-2 + + # change permissions for rfkill + chmod 0777 /dev/rfkill + + # change permissions for Sensors + # bma250 + chown system system /sys/bus/i2c/devices/4-0018/delay + chmod 0771 /sys/bus/i2c/devices/4-0018/delay + chown system system /sys/bus/i2c/devices/4-0018/enable + chmod 0771 /sys/bus/i2c/devices/4-0018/enable + # stk-als22x7 + chown system system /sys/bus/i2c/devices/4-0010/enable + chmod 0771 /sys/bus/i2c/devices/4-0010/enable + + # change permissions for Thermal sensor TMP105 + chmod 0777 /sys/class/hwmon/hwmon0/device/temp1_max + chmod 0777 /sys/class/hwmon/hwmon0/device/temp1_max_hyst + + # LEDs + chmod 0777 /dev/ilitek_ctrl + chmod 0777 /sys/class/leds/lcd-backlight/brightness + chmod 0666 /sys/class/leds/led-green/brightness + chmod 0666 /sys/class/leds/led-orange/brightness + chown system system /sys/class/leds/lcd-backlight/brightness + chown system system /sys/class/leds/led-green/brightness + chown system system /sys/class/leds/led-orange/brightness + + # Set default maximum of 1008 on cpu0 (peformance settings will change this if set by user) +# write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 1008000 + + #Give system ownership and permission to boost clock for specified timeout + #Note boost_timeout cannot be changed from application because of dynamic sysfs creation. It will have default value of 3 sec. + chown system system /sys/devices/system/cpu/cpu0/cpufreq/boost_cpufreq + chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/boost_cpufreq + + # Set current permissions for charge protection + chown system system /sys/class/power_supply/usb/device/charge_command + chown system system /sys/class/power_supply/usb/device/charge_current + chown system system /sys/class/power_supply/usb/device/float_voltage + chown system system /sys/class/power_supply/usb/device/bad_battery + +on post-fs + # wi-fi + setprop wifi.interface "wlan0" + setprop softap.interface "wlan0" + insmod /system/lib/modules/compat.ko + insmod /system/lib/modules/cfg80211.ko + insmod /system/lib/modules/mac80211.ko + insmod /system/lib/modules/wl12xx.ko + insmod /system/lib/modules/wl12xx_sdio.ko + +on post-fs-data + mkdir /data/tmp 0777 system system + symlink /data/tmp /tmp + + # smc + mkdir /data/smc 0770 drmrpc drmrpc + chown drmrpc drmrpc /data/smc/counter.bin + chown drmrpc drmrpc /data/smc/storage.bin + chown drmrpc drmrpc /data/smc/system.bin + + # run mac script + start fixmac + + # mount system ro + mount ext4 /dev/block/platform/omap/omap_hsmmc.1/by-name/system /system ro remount + + setprop vold.post_fs_data_done 1 + +on boot + setprop ro.radio.noril yes + + # fake some battery state + setprop status.battery.state Slow + setprop status.battery.level 5 + setprop status.battery.level_raw 50 + setprop status.battery.level_scale 9 + +service fixmac /system/bin/fix-mac.sh + class core + user root + group root + oneshot + disabled + +# wifi services +service p2p_supplicant /system/bin/wpa_supplicant -e/data/misc/wifi/entropy.bin \ + -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -N \ + -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \ + -I/system/etc/wifi/p2p_supplicant_overlay.conf \ + -O/data/misc/wifi/sockets -puse_p2p_group_interface=1 \ + -g@android:wpa_wlan0 + class main + socket wpa_wlan0 dgram 660 wifi wifi + disabled + oneshot + +service wpa_supplicant /system/bin/wpa_supplicant \ + -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin \ + -O/data/misc/wifi/sockets -g@android:wpa_wlan0 + class main + socket wpa_wlan0 dgram 660 wifi wifi + disabled + oneshot + +service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL + class main + disabled + oneshot + +service iprenew_wlan0 /system/bin/dhcpcd -n + class main + disabled + oneshot + +service dhcpcd_p2p /system/bin/dhcpcd -aABKL + class main + disabled + oneshot + +service iprenew_p2p /system/bin/dhcpcd -n + class main + disabled + oneshot + +service dhcpcd_bnep0 /system/bin/dhcpcd -ABKL + class main + disabled + oneshot + +service iprenew_bnep0 /system/bin/dhcpcd -n + class main + disabled + oneshot + +service hostapd_bin /system/bin/hostapd -d -e/data/misc/wifi/entropy.bin /data/misc/wifi/hostapd.conf + socket wpa_wlan0 dgram 660 wifi wifi + class main + disabled + oneshot + |
