-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathinit.startablet.rc
executable file
·294 lines (247 loc) · 9.87 KB
/
init.startablet.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
import init.startablet.usb.rc
on early-init
mount debugfs debugfs /sys/kernel/debug
write /sys/class/firmware/timeout 5
# for backwards compatibility
export EXTERNAL_STORAGE /storage/sdcard0
mkdir /storage 0050 system sdcard_r
mkdir /storage/sdcard0 0000 system system
symlink /storage/sdcard0 /sdcard
symlink /storage/sdcard0 /mnt/sdcard
mkdir /usbdisk 0000 system system
export EXTERNAL_STORAGE_UDISK /mnt/udisk
mkdir /mnt/usbdisk 0000 system system
symlink /mnt/usbdisk /usbdisk
on fs
mount_all /fstab.v909
on post-fs-data
# we will remap this as /storage/sdcard0 with the sdcard fuse tool
mkdir /data/media 0775 media_rw media_rw
chown media_rw media_rw /data/media
# Set indication (checked by vold) that we have finished this action
setprop vold.post_fs_data_done 1
on init
# display
chown system system /sys/class/backlight/tegralm1bl.0/brightness
chmod 0644 /sys/class/backlight/tegralm1bl.0/brightness
chown system system /sys/devices/platform/tegra_displaytest/connection
chmod 0644 /sys/devices/platform/tegra_displaytest/connection
chown system system /sys/devices/platform/tegra_displaytest/control
chmod 0644 /sys/devices/platform/tegra_displaytest/control
chown system system /sys/devices/platform/tegra_leds/led_rgb_brightness
chmod 0644 /sys/devices/platform/tegra_leds/led_rgb_brightness
chown system system /sys/devices/platform/tegra_leds/led_blink
chmod 0644 /sys/devices/platform/tegra_leds/led_blink
chown system system /sys/devices/platform/tegra-i2c.1/i2c-1/1-0023/ledstate
chmod 0644 /sys/devices/platform/tegra-i2c.1/i2c-1/1-0023/ledstate
chown system system /sys/devices/platform/tegra-i2c.1/i2c-1/1-0023/debug
chmod 0644 /sys/devices/platform/tegra-i2c.1/i2c-1/1-0023/debug
chown system system /sys/devices/platform/tegra-i2c.1/i2c-1/1-0023/control
chmod 0644 /sys/devices/platform/tegra-i2c.1/i2c-1/1-0023/control
chown system system /sys/devices/platform/tegra-i2c.1/i2c-1/1-0023/data
chmod 0644 /sys/devices/platform/tegra-i2c.1/i2c-1/1-0023/data
on boot
# wifi
mkdir /data/misc/wifi 0770 wifi wifi
mkdir /data/misc/wifi/sockets 0770 wifi wifi
mkdir /data/misc/dhcp 0770 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp
# bluetooth
# power up/down interface
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chmod 0660 /sys/class/rfkill/rfkill0/type
chmod 0660 /sys/class/rfkill/rfkill0/state
# default power down
write /sys/class/rfkill/rfkill0/state 0
# Bluetooth BDADDR path
setprop ro.bt.bdaddr_path /proc/nvdata/BDADDR
# Define TCP buffer sizes for various networks (TMUS only)
# ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
setprop net.tcp.buffersize.default 4096,87380,196608,4096,16384,110208
setprop net.tcp.buffersize.wifi 4096,87380,393216,4096,16384,110208
setprop net.tcp.buffersize.umts 4096,87380,393216,4096,16384,110208
setprop net.tcp.buffersize.edge 4096,26280,393216,4096,16384,35040
setprop net.tcp.buffersize.gprs 4096,8760,393216,4096,8760,11680
setprop net.tcp.buffersize.hspa 4096,87380,393216,4096,16384,110208
# gps
chown system system /sys/devices/platform/tegra_gps_gpio/poweron
chmod 644 /sys/devices/platform/tegra_gps_gpio/poweron
# backlight
chown system system /sys/class/backlight/tegra-pwm-bl/brightness
# Sensor
chown system system /sys/class/input/input0/sensor_onoff
chmod 0644 /sys/class/input/input0/sensor_onoff
chown system system /sys/class/input/input0/set_sensor_delay
chmod 0644 /sys/class/input/input0/set_sensor_delay
chown system system /sys/class/input/input0/factory_test_onoff
chmod 0644 /sys/class/input/input0/factory_test_onoff
chown system system /sys/class/input/input0/factory_test_result
chmod 0644 /sys/class/input/input0/factory_test_result
chown system system /sys/class/input/input0/set_sensor_disable
chmod 0644 /sys/class/input/input0/set_sensor_disable
# Camera
#CAMERA_FLASH_FINH 0 //GPIO_PA0
#CAMERA_FLASH_ENSET 154 //GPIO_PT2
#CAMERA_FLASH_EN 220 //GPIO_PBB4
chown media camera /sys/devices/virtual/gpio/gpio0/value
chmod 660 /sys/devices/virtual/gpio/gpio0/value
chown media camera /sys/devices/virtual/gpio/gpio154/value
chmod 660 /sys/devices/virtual/gpio/gpio154/value
chown media camera /sys/devices/virtual/gpio/gpio220/value
chmod 660 /sys/devices/virtual/gpio/gpio220/value
chown system system /sys/devices/platform/tegra_camera_flash/camera_flash_onoff
chmod 0644 /sys/devices/platform/tegra_camera_flash/camera_flash_onoff
mkdir /data/media/DCIM 775 media_rw media_rw
mkdir /data/media/DCIM/Camera 775 media_rw media_rw
# MUIC
chown system /sys/bus/i2c/devices/0-0044/mode
# Power Management Settings
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 216000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 1504000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 216000
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq 1504000
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load 80
# AUDIO
chown system system /sys/devices/platform/tegra_misc/spk_switch
chmod 660 /sys/devices/platform/tegra_misc/spk_switch
chown system system /sys/devices/platform/i2c-gpio.7/i2c-7/7-0060/fm31_bypass
chmod 660 /sys/devices/platform/i2c-gpio.7/i2c-7/7-0060/fm31_bypass
chown system system /sys/devices/platform/i2c-gpio.7/i2c-7/7-0060/fm31_reg
chmod 660 /sys/devices/platform/i2c-gpio.7/i2c-7/7-0060/fm31_reg
service wpa_supplicant /system/bin/wpa_supplicant \
-Dnl80211 -ieth0 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin
# we will start as root and wpa_supplicant will switch to user wifi
# after setting up the capabilities required for WEXT
# user wifi
# group wifi inet keystore
class main
socket wpa_eth0 dgram 660 wifi wifi
disabled
oneshot
service p2p_supplicant /system/bin/wpa_supplicant \
-Dnl80211 -ieth0 -puse_p2p_group_interface=1 -c/data/misc/wifi/wpa_supplicant.conf
# we will start as root and wpa_supplicant will switch to user wifi
# after setting up the capabilities required for WEXT
# user wifi
# group wifi inet keystore
class main
socket wpa_eth0 dgram 660 wifi wifi
disabled
oneshot
service dhcpcd_eth0 /system/bin/dhcpcd -ABKL
class main
disabled
oneshot
service dhcpcd_bnep0 /system/bin/dhcpcd -ABKL
class main
disabled
oneshot
service dhcpcd_p2p /system/bin/dhcpcd -aABKL
class main
disabled
oneshot
service iprenew_eth0 /system/bin/dhcpcd -n
class main
disabled
oneshot
service iprenew_bnep0 /system/bin/dhcpcd -n
class main
disabled
oneshot
service iprenew_p2p /system/bin/dhcpcd -n
class main
disabled
oneshot
service hciattach /system/bin/brcm_patchram_plus_lge --enable_hci --enable_lpm --pcm_role slave \
--baudrate 3000000 --patchram /system/etc/bluetooth/BCM4329B1_002.002.023.0875.0883.hcd /dev/ttyHS2
class main
user bluetooth
group bluetooth net_admin system
disabled
oneshot
# Initializing Bluetooth Address
service bdaddr_init /system/bin/bdaddr_init
class main
oneshot
# blueset : DUT daemon
service bluetoothhiddend /system/bin/bluetoothhiddend
class main
disabled
oneshot
# Wi-Fi Hidden Menu daemon
service wifihiddend /system/bin/wifihiddend
class main
disabled
oneshot
# Gyro Sensor daemon
service motion /system/bin/motion
class late_start
user system
group system
service sdcard /system/bin/sdcard /data/media 1023 1023
class late_start
# lgesystemd daemon
service lgesystemd /system/bin/lgesystemd
class late_start
service eventd /system/bin/eventd
class late_start
# bugreport is triggered by the VOLUME-DOWN and VOLUME-UP keys
service bugreport /system/bin/dumpstate -d -v -o /storage/sdcard0/bugreports/bugreport
class late_start
disabled
oneshot
keycodes 115 114
# Logging service
service log-kernel /system/bin/sh /etc/save_kernel_log.sh
class late_start
disabled
oneshot
on property:persist.service.kernel.enable=1
start log-kernel
on property:persist.service.kernel.enable=0
stop log-kernel
service clear-kernel-log /system/bin/clear-kernel-log
class late_start
disabled
oneshot
service logcat-main /system/bin/logcat -v time -b main -f /storage/sdcard0/logger/main.log -n 4 -r 4096
class late_start
disabled
oneshot
on property:persist.service.main.enable=1
start logcat-main
on property:persist.service.main.enable=0
stop logcat-main
service logcat-system /system/bin/logcat -v time -b system -f /storage/sdcard0/logger/system.log -n 4 -r 4096
class late_start
disabled
oneshot
on property:persist.service.system.enable=1
start logcat-system
on property:persist.service.system.enable=0
stop logcat-system
service logcat-radio /system/bin/logcat -v time -b radio -f /storage/sdcard0/logger/radio.log -n 4 -r 4096
class late_start
disabled
oneshot
on property:persist.service.radio.enable=1
start logcat-radio
on property:persist.service.radio.enable=0
stop logcat-radio
service logcat-events /system/bin/logcat -v time -b events -f /storage/sdcard0/logger/events.log -n 4 -r 4096
class late_start
disabled
oneshot
on property:persist.service.events.enable=1
start logcat-events
on property:persist.service.events.enable=0
stop logcat-events
# End of Logging service
# Start RescueStarter for Rescue+Mobile (tmus only)
service RescueStarter /system/bin/RescueStarter
class late_start
user root
group input graphics