forked from zossso/android_device_motorola_motus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.motus.rc
329 lines (276 loc) · 9.98 KB
/
init.motus.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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
on early-init
device mtd@misc 0460 radio diag
# Set timeout value for rmnet stats.
write /sys/devices/virtual/net/rmnet0/timeout_suspend 5000000
write /sys/devices/virtual/net/rmnet0/timeout 18000000
on boot
# unmap left alt to avoid console switch
setkey 0x0 0x38 0x0
# reset SEND+MENU+END
setkey 0x0 0xe7 0x706
setkey 0x0 0x8b 0x707
setkey 0x40 0xe7 0x706
setkey 0x40 0x8b 0x707
setkey 0x80 0xe7 0x706
setkey 0x80 0x8b 0x707
setkey 0xc0 0xe7 0x706
setkey 0xc0 0x8b 0x707
setkey 0xc0 0x6b 0x20c
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/state
# old kernel method:
chown bluetooth bluetooth /sys/module/board_motus/parameters/bluetooth_power_on
chmod 0660 /sys/module/board_motus/parameters/bluetooth_power_on
#proximity
chown system system /sys/devices/platform/sfh7743.-2/proximity
#radio
chown root radio /proc/cmdline
chown radio system /sys/android_power/state
chown radio system /sys/android_power/request_state
chown radio system /sys/android_power/acquire_full_wake_lock
chown radio system /sys/android_power/acquire_partial_wake_lock
chown radio system /sys/android_power/release_wake_lock
chown radio system /sys/power/state
chown radio system /sys/power/wake_lock
chown radio system /sys/power/wake_unlock
chmod 0664 /sys/power/state
chmod 0660 /sys/power/wake_lock
chmod 0660 /sys/power/wake_unlock
chown system system /sys/class/timed_output/vibrator/enable
chown system system /sys/class/leds/keyboard-backlight/brightness
chown system system /sys/class/leds/keyboard1-backlight/brightness
chown system system /sys/class/leds/keyboard2-backlight/brightness
chown system system /sys/class/leds/lcd-backlight/brightness
chown system system /sys/class/leds/lcd-backlight/suspend
chown system system /sys/class/leds/lcd-nr-backlight/brightness
chown system system /sys/class/leds/button-backlight/brightness
chown system system /sys/class/leds/messaging/brightness
chown system system /sys/class/leds/messaging/blink
chown system system /sys/class/leds/soc/brightness
chown system system /sys/class/leds/soc/blink
chown system system /dev/als
chmod 0664 /dev/als
chown system system /sys/class/timed_output/vibrator/enable
chown system system /sys/module/sco/parameters/disable_esco
chown system system /sys/kernel/ipv4/tcp_rmem_max
chown system system /dev/proximity
chown system system /sys/devices/platform/sfh7743.-2/proximity
chown root radio /proc/cmdline
chown bluetooth bluetooth /sys/module/bluetooth_power/parameters/power
chown bluetooth bluetooth /proc/bluetooth/sleep/proto
chown system system /sys/module/sco/parameters/disable_esco
chmod 0660 /sys/module/bluetooth_power/parameters/power
chmod 0660 /proc/bluetooth/sleep/proto
chmod 0660 /dev/ttyHS0
on init
# Vibrator
chown system system /sys/class/vibrator/vibrator/enable
# Broadcom stuff
mkdir /data/misc/wifi 0770 system wifi
mkdir /data/misc/dhcp 0770 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp
chown bluetooth bluetooth /sys/module/board_motus/parameters/bluetooth_power_on
chmod 0660 /sys/module/board_motus/parameters/bluetooth_power_on
chown bluetooth bluetooth /proc/bt_power
chmod 0666 /proc/bt_power
# 12m
mkdir /data/local/12m 0771 system system
mkdir /data/local/12m/batch 0771 system system
mkdir /data/local/12m/batch/log 0771 system system
# E-compass
chown system system /dev/akm8973_aot
chown system system /dev/akm8973_dev
# Accelerometer
chown system system /sys/class/i2c-adapter/i2c-0/0-0018/mode
chmod 0664 /sys/class/i2c-adapter/i2c-0/0-0018/mode
chown system system /dev/accelerometer
chmod 0664 /dev/accelerometer
chown system system /dev/lis331dlh
chmod 0664 /dev/lis331dlh
# minipad
chown system system /dev/minipad
chmod 0666 /dev/minipad
# Camera LED brightness attributes accessible to all
chmod 0666 /sys/class/leds/flashlight/brightness
chmod 0666 /sys/class/leds/cam-torch/brightness
# Old fast dormancy settings (needed for CDMA)
setprop ro.ril.fast.dormancy.rule 1
setprop ro.ril.fast.dormancy.timeout 2
# Fast dormancy settings
setprop ro.ril.fd.scron.timeout 3
setprop ro.ril.fd.scroff.timeout 4
# setprop ro.secure 1
# Wakelock debug
write /sys/module/wakelock/parameters/debug_mask 7
# Permissions changes needed for TCMD
chown system system /dev/blan_enable
chmod 0660 /dev/blan_enable
chown system system /dev/misc_helper
chmod 0660 /dev/misc_helper
chown system graphics /dev/graphics/fb0
# Google Skymap wants to copybit fb0 but requests no special privileges
chmod 0666 /dev/graphics/fb0
chmod 0644 /dev/block/mmcblk0p1
# Permissions needed for port_bridge
chown root system /dev/ttyHSUSB0
chmod 0660 /dev/ttyHSUSB0
# Clearing FM/BT reference count temp file contents
write /data/bluedroid_ref 123456
chmod 0777 /data/bluedroid_ref
# Set WiFi interface name
setprop wifi.interface eth0
# Set up touchpad
chown system system /dev/touchpad
chmod 0664 /dev/touchpad
#bluetooth
service hciattach /system/bin/brcm_patchram_plus --enable_hci --enable_lpm \
--baudrate 4000000 --patchram /etc/firmware/bcm4325.hcd /dev/ttyHS0
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
# bugreport is triggered by the KEY_LEFTSHIFT and KEY_MENU keycodes
service bugreport /system/bin/dumpstate -d -v -o /sdcard/bugreports/bugreport
disabled
oneshot
keycodes 42 139
# Modemlog
service modemlog /system/bin/modemlog
class TOOL
user system
oneshot
# MMClog
service mmclog /system/bin/mmclog
class TOOL
oneshot
chown system system /sys/class/timed_output/vibrator/enable
chown system system /sys/module/sco/parameters/disable_esco
chown system system /sys/kernel/ipv4/tcp_wmem_min
chown system system /sys/kernel/ipv4/tcp_wmem_def
chown system system /sys/kernel/ipv4/tcp_wmem_max
chown system system /sys/kernel/ipv4/tcp_rmem_min
chown system system /sys/kernel/ipv4/tcp_rmem_def
chown system system /sys/kernel/ipv4/tcp_rmem_max
# Touchpad driver
service touchpad /system/bin/touchpad -a /data/touchpad.log
class HW
user system
oneshot
#FMRadio Service
service fmradio /system/bin/fmradioserver
class BT
#service dhcpcd /system/bin/dhcpcd -ABKL
# disabled
# oneshot
service dhcpcd /system/bin/dhcpcd -B eth0
class WLAN
# user system - this makes socket() calls fail with permission denied
group dhcp
disabled
oneshot
# cpufreq configurations
# write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 245760
# write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ondemand
# write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 40000
# write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 85
write /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,9216,10240,10240
# enable insecure AGPS
setprop ro.ril.def.agps.mode 2
service wpa_supplicant /system/bin/wpa_supplicant -D wext -i eth0 -c /data/misc/wifi/wpa_supplicant.conf
class WLAN
# user system - this makes socket() calls fail with permission denied
group wifi
disabled
oneshot
# E-compass daemon
service akmd2 /system/bin/akmd2 -f /system/etc/akm/akmd_set.cfg
user system
group input
class HW
oneshot
# compass/accelerometer daemon
#service akmd /system/bin/akmd
# user compass
# group compass misc input
## TCMD
service tcmd /system/bin/tcmd_engine usb0
# user system - this makes reboot failing
# group system inet
class TCMD
service port_bridge /system/bin/port_bridge /dev/smd0 /dev/ttyHSUSB0
user radio
group system
class TCMD
service fuel_gauge /system/bin/fuel_gauge --all
class TCMD
oneshot
service qmuxd /system/bin/qmuxd
class HW
service minipadut /system/bin/minipadut -a
user system
group input misc
oneshot
on property:sys.motorola.suspended=1
class_stop zygote_services
on property:sys.motorola.suspended=0
class_start zygote_services
#on property:sys.motorola.infactory=1
# class_start ADB
# class_start TCMD
# class_start TOOL
# class_start ANDROID
# class_start MEDIA
# class_start BT
# class_start WLAN
# class_start HW
on property:sys.motorola.infactory=2
class_start ADB
class_start TCMD
class_start TOOL
class_start RIL
class_start pre-zygote_services
class_start zygote_services
class_start post-zygote_services
class_start ANDROID
class_start MEDIA
class_start BT
class_start WLAN
class_start HW
on property:sys.motorola.infactory=0
class_start ADB
class_start TOOL
class_start RIL
class_start pre-zygote_services
class_start zygote_services
class_start post-zygote_services
class_start ANDROID
class_start MEDIA
class_start BT
class_start WLAN
class_start HW
class_start TCMD
on property:persist.factorytest=1
stop zygote
on property:persist.factorytest=2
stop zygote
on property:persist.factorytest=0
start zygote