forked from lgics/cm_device_lge_p500
-
Notifications
You must be signed in to change notification settings - Fork 2
/
init.qcom.rc
310 lines (244 loc) · 7.54 KB
/
init.qcom.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
import init.qcom.usb.rc
###################
## 1: EARLY-INIT ##
###################
on early-init
# create dirs
mkdir /system
mkdir /data 0771 system system
mkdir /cache 0771 system cache
mkdir /mnt/sdcard 0000 system system
mkdir /sd-ext 0771 system system
#############
## 2: INIT ##
#############
on init
# setup the global environment
export EXTERNAL_STORAGE /mnt/sdcard
export SD_EXT_DIRECTORY /sd-ext
export DOWNLOAD_CACHE /cache/download
# Backwards Compat - XXX: Going away in G*
symlink /mnt/sdcard /sdcard
# Add permissions for camera access
chmod 0666 /dev/msm_camera/config0
chmod 0666 /dev/msm_camera/control0
chmod 0666 /dev/msm_camera/frame0
chmod 0666 /dev/msm_camera/pic0
# Define the memory thresholds at which the above process classes will
# be killed. These numbers are in pages (4k).
setprop ro.FOREGROUND_APP_MEM 1536
setprop ro.VISIBLE_APP_MEM 2048
setprop ro.SECONDARY_SERVER_MEM 4096
setprop ro.BACKUP_APP_MEM 4096
setprop ro.HOME_APP_MEM 4096
setprop ro.HIDDEN_APP_MEM 5120
setprop ro.CONTENT_PROVIDER_MEM 5632
setprop ro.EMPTY_APP_MEM 6144
# Import Froyo LMK settings due to its less aggressive nature
write /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,5120,5632,6144
# Enable low memory killer to check file pages
write /sys/module/lowmemorykiller/parameters/minfile 0,0,0,5120,5632,6144
write /sys/module/lowmemorykiller/parameters/check_filepages 1
# fix for enropy service and some other that failed
chmod 0755 /data/system/appwidgets.xml
chmod 0755 /data/system/entropy.dat
chmod 0755 /data/system/wallpaper_info.xml
#################
## 3: EARLY-FS ##
#################
## on early-fs
################
## 4: EMMC-FS ##
################
## on emmc-fs
###########
## 5: FS ##
###########
on fs
# framebuffer permission for copybit
chmod 0666 /dev/graphics/fb0
################
## 6: POST-FS ##
################
on post-fs
# nv
mkdir /data/nv
chown system system /data/nv
chmod 0711 /data/nv
chmod 0771 /cache
mkdir /data/local/download 0771 system cache
mkdir /cache/download 0771 system cache
# wifi
chmod 0777 /data/misc/wifi/config_mac
mkdir /data/audioprop 0777 system system
mkdir /data/misc/wifi/sockets 0770 wifi wifi
setprop wifi.supplicant_scan_interval 20
setprop wifi.interface wlan0
mkdir /data/misc/dhcp 0777 system system
#####################
## 7: POST-FS-DATA ##
#####################
on post-fs-data
# 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
mkdir /data/misc/hotspot 0770 system hotspot
# last line for post-fs-data
setprop vold.post_fs_data_done 1
###################
## 8: EARLY-BOOT ##
###################
on early-boot
# set RLIMIT_MEMLOCK to 64MB
setrlimit 8 67108864 67108864
#############
## 9: BOOT ##
#############
on boot
# radio
mkdir /data/radio 0770 radio radio
chmod 2770 /data/radio
# liblights
chown system system /sys/class/leds/green/brightness
chown system system /sys/class/leds/green/blink
chown system system /sys/class/leds/amber/brightness
chown system system /sys/class/leds/amber/blink
chown system system /sys/class/leds/button-backlight/brightness
chown system system /sys/class/leds/flashlight/brightness
chown system system /sys/class/leds/lcd-backlight/brightness
chown system system /sys/class/leds/keyboard-backlight/brightness
# wifi
mkdir /data/misc 01771 system misc
mkdir /data/misc/wifi 0770 system wifi
mkdir /data/misc/wifi/sockets
chmod 770 /data/misc/wifi/sockets
mkdir /data/misc/dhcp 0770 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp
mkdir /data/system 0775 system system
# bluetooth
chmod 0660 /dev/ttyHS0
chown bluetooth bluetooth /dev/ttyHS0
chown bluetooth bluetooth /proc/bluetooth/sleep/proto
chmod 0660 /sys/class/rfkill/rfkill0/state
chmod 0660 /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
write /sys/class/rfkill/rfkill0/state 0
# allow interfaces to get IPv6 address when tethering is enabled
write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2
# Fast dormancy
setprop ro.ril.fast.dormancy.rule 1
setprop ro.ril.fd.scron.timeout 4
setprop ro.ril.fd.scroff.timeout 3
# Wakelock debug
write /sys/module/wakelock/parameters/debug_mask 7
#############################################################################
### S E R V I C E S ##
#############################################################################
service qmuxd /system/bin/qmuxd
class core
user radio
group radio audio inet bluetooth
service hciattach /system/bin/sh /system/bin/init.qcom.bt.sh
class main
# user bluetooth
group bluetooth net_bt_admin
disabled
on property:service.brcm.bt.mac=*
exec /system/bin/hwaddrs
service wpa_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant -Dwext -iwlan0 -W -c/data/misc/wifi/wpa_supplicant.conf
class main
socket wpa_wlan0 dgram 660 wifi wifi
group system wifi inet
disabled
oneshot
service dhcpcd_wlan0 /system/bin/dhcpcd -BKA
class core
disabled
oneshot
on property:init.svc.wpa_supplicant=stopped
stop dhcpcd_wlan0
service iprenew_wlan0 /system/bin/dhcpcd -n
class main
disabled
oneshot
service dhcpcd_bnep0 /system/bin/dhcpcd -B
class main
disabled
oneshot
service iprenew_bnep0 /system/bin/dhcpcd -n
class main
disabled
oneshot
service dhcp-service /system/bin/netcfg wlan0 dhcp
class main
oneshot
on property:dev.bootcomplete=1
stop dhcp-service
start dhcp-service
service setapversion /system/bin/lgapversion
class main
user radio
group radio
disabled
oneshot
on property:gsm.version.baseband=V07u-000-000-MAR-23-2009
start setapversion
service hfag /system/bin/sdptool add --channel=10 HFAG
class main
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service hsag /system/bin/sdptool add --channel=11 HSAG
class main
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service opush /system/bin/sdptool add --channel=12 OPUSH
class main
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service pbap /system/bin/sdptool add --channel=19 PBAP
class main
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service map /system/bin/sdptool add --channel=16 MAS
class main
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service qcom-sh /system/bin/sh /init.qcom.sh
class core
user root
oneshot
service qcom-post-boot /system/bin/sh /system/etc/init.qcom.post_boot.sh
class main
user root
disabled
oneshot
on property:init.svc.bootanim=stopped
start qcom-post-boot
service bugreport /system/bin/logwrapper /system/bin/dumpstate -d -v -o /sdcard/bugreports/bugreport
# Triggered by the KEY_VOLUME_DOWN+KEY_MENU keycodes
keycodes 114 139
class main
disabled
oneshot
# Adb over Network
on property:service.adb.tcp.port=5555
stop adbd
start adbd
on property:service.adb.tcp.port=-1
stop adbd
start adbd