-
Notifications
You must be signed in to change notification settings - Fork 6
/
init.otter-common.rc
145 lines (118 loc) · 4.36 KB
/
init.otter-common.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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
# run mac script
start fixmac
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
# 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