blob: 5cbe767c1eacec564834577258110a01bcd0dcf1 [file] [log] [blame]
Keyur2a73fe72012-10-13 09:05:54 +05301import init.pecan.usb.rc
2
Keyur2a73fe72012-10-13 09:05:54 +05303on early-init
RonGokhale9a665712012-10-25 01:51:07 +05304
Keyur2a73fe72012-10-13 09:05:54 +05305 mkdir /system
6 mkdir /data 0771 system system
7 mkdir /cache 0771 system cache
8 mkdir /mnt/sdcard 0000 system system
9 mkdir /sd-ext 0771 system system
10
11
12on init
13
14# setup the global environment
15 export EXTERNAL_STORAGE /mnt/sdcard
16 export SD_EXT_DIRECTORY /sd-ext
17 export DOWNLOAD_CACHE /cache/download
18
19# Backwards Compat - XXX: Going away in G*
20 symlink /mnt/sdcard /sdcard
21
22# Add permissions for camera access
23 chmod 0666 /dev/msm_camera/config0
24 chmod 0666 /dev/msm_camera/control0
25 chmod 0666 /dev/msm_camera/frame0
26 chmod 0666 /dev/msm_camera/pic0
27
28# Define the memory thresholds at which the above process classes will
29# be killed. These numbers are in pages (4k).
30 setprop ro.FOREGROUND_APP_MEM 1536
31 setprop ro.VISIBLE_APP_MEM 2048
32 setprop ro.SECONDARY_SERVER_MEM 4096
33 setprop ro.BACKUP_APP_MEM 4096
34 setprop ro.HOME_APP_MEM 4096
35 setprop ro.HIDDEN_APP_MEM 5120
36 setprop ro.CONTENT_PROVIDER_MEM 5632
37 setprop ro.EMPTY_APP_MEM 6144
38
39# Import Froyo LMK settings due to its less aggressive nature
40 write /sys/module/lowmemorykiller/parameters/minfree 1536,2048,4096,5120,5632,6144
41# Enable low memory killer to check file pages
42 write /sys/module/lowmemorykiller/parameters/minfile 0,0,0,5120,5632,6144
43 write /sys/module/lowmemorykiller/parameters/check_filepages 1
44
45# fix for enropy service and some other that failed
46 chmod 0755 /data/system/appwidgets.xml
47 chmod 0755 /data/system/entropy.dat
48 chmod 0755 /data/system/wallpaper_info.xml
49
50
RonGokhale9a665712012-10-25 01:51:07 +053051on fs
52
53 # framebuffer permission for copybit
54 chmod 0666 /dev/graphics/fb0
Keyur2a73fe72012-10-13 09:05:54 +053055
56on post-fs
57
58# nv
59 mkdir /data/nv
60 chown system system /data/nv
61 chmod 0711 /data/nv
62
63 mkdir /data/local/download 0771 system cache
64 mkdir /cache/download 0771 system cache
65
66# wifi
67 chmod 0777 /data/misc/wifi/config_mac
68 mkdir /data/audioprop 0777 system system
69 mkdir /data/misc/wifi/sockets 0770 wifi wifi
70 setprop wifi.supplicant_scan_interval 20
71 setprop wifi.interface wlan0
72 mkdir /data/misc/dhcp 0777 system system
73
74
75on post-fs-data
76
77# wifi
78 mkdir /data/misc/wifi 0770 wifi wifi
79 mkdir /data/misc/wifi/sockets 0770 wifi wifi
80 mkdir /data/misc/dhcp 0770 dhcp dhcp
81 chown dhcp dhcp /data/misc/dhcp
82
83
84# last line for post-fs-data
85 setprop vold.post_fs_data_done 1
86
87
RonGokhale9a665712012-10-25 01:51:07 +053088on early-boot
89# set RLIMIT_MEMLOCK to 64MB
90 setrlimit 8 67108864 67108864
Keyur2a73fe72012-10-13 09:05:54 +053091
92on boot
93
RonGokhale9a665712012-10-25 01:51:07 +053094# Temporary hack to prevent framebuffer flicker
95 chmod 0777 /sys/class/graphics/fb0/state
96 write /sys/class/graphics/fb0/state 1
Keyur2a73fe72012-10-13 09:05:54 +053097
98# radio
99 mkdir /data/radio 0770 radio radio
100 chmod 2770 /data/radio
101
RonGokhale9a665712012-10-25 01:51:07 +0530102## SENSOR
103 mkdir /data/amit 0777 ami304d ami304d
104 chmod 0666 /data/amit/AMI306_Config.ini
105 chmod 0666 /data/amit/AMI306_Config2.ini
106
Keyur2a73fe72012-10-13 09:05:54 +0530107# liblights
108 chown system system /sys/class/leds/green/brightness
109 chown system system /sys/class/leds/green/blink
110 chown system system /sys/class/leds/amber/brightness
111 chown system system /sys/class/leds/amber/blink
112 chown system system /sys/class/leds/button-backlight/brightness
113 chown system system /sys/class/leds/flashlight/brightness
114 chown system system /sys/class/leds/lcd-backlight/brightness
115 chown system system /sys/class/leds/keyboard-backlight/brightness
116
117# wifi
118 mkdir /data/misc 01771 system misc
119 mkdir /data/misc/wifi 0770 system wifi
120 mkdir /data/misc/wifi/sockets
121 chmod 770 /data/misc/wifi/sockets
122 mkdir /data/misc/dhcp 0770 dhcp dhcp
123 chown dhcp dhcp /data/misc/dhcp
124 mkdir /data/system 0775 system system
125
126# bluetooth
127 chmod 0660 /dev/ttyHS0
128 chown bluetooth bluetooth /dev/ttyHS0
129 chown bluetooth bluetooth /proc/bluetooth/sleep/proto
130 chmod 0660 /sys/class/rfkill/rfkill0/state
131 chmod 0660 /sys/class/rfkill/rfkill0/type
132
133 chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
134 chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
135 write /sys/class/rfkill/rfkill0/state 0
136
RonGokhale9a665712012-10-25 01:51:07 +0530137 # allow interfaces to get IPv6 address when tethering is enabled
138 write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2
139 write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2
140 write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2
141
Keyur2a73fe72012-10-13 09:05:54 +0530142# Fast dormancy
143 setprop ro.ril.fast.dormancy.rule 1
144 setprop ro.ril.fd.scron.timeout 4
145 setprop ro.ril.fd.scroff.timeout 3
146
RonGokhale7a2c6f82012-12-03 00:48:41 +0530147
148# I/O scheduler
149 chown system system /sys/block/mmcblk0/queue/scheduler
150 chmod 0664 /sys/block/mmcblk0/queue/scheduler
151
Keyur2a73fe72012-10-13 09:05:54 +0530152# Wakelock debug
153 write /sys/module/wakelock/parameters/debug_mask 7
154
Keyur2a73fe72012-10-13 09:05:54 +0530155
Keyur2a73fe72012-10-13 09:05:54 +0530156
RonGokhale9a665712012-10-25 01:51:07 +0530157#############################################################################
158### S E R V I C E S ##
159#############################################################################
Keyur2a73fe72012-10-13 09:05:54 +0530160
161service qmuxd /system/bin/qmuxd
162 class core
163 user radio
164 group radio audio inet bluetooth
165
RonGokhale9a665712012-10-25 01:51:07 +0530166service ami304d /system/bin/ami304d
167 class main
168 user compass
169 group system
170
Keyur2a73fe72012-10-13 09:05:54 +0530171service hciattach /system/bin/sh /system/bin/init.qcom.bt.sh
172 class main
173 user bluetooth
174 group bluetooth net_bt_admin
175 disabled
176
177service wpa_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant -Dwext -iwlan0 -W -c/data/misc/wifi/wpa_supplicant.conf
178 class main
179 socket wpa_wlan0 dgram 660 wifi wifi
180 group system wifi inet
181 disabled
182 oneshot
183
184service dhcpcd_wlan0 /system/bin/dhcpcd -BKA
185 class core
186 disabled
187 oneshot
188
189service iprenew_wlan0 /system/bin/dhcpcd -n
190 class main
191 disabled
192 oneshot
193
194service dhcpcd_bnep0 /system/bin/dhcpcd -B
RonGokhale9a665712012-10-25 01:51:07 +0530195 class main
196 disabled
197 oneshot
Keyur2a73fe72012-10-13 09:05:54 +0530198
199service iprenew_bnep0 /system/bin/dhcpcd -n
RonGokhale9a665712012-10-25 01:51:07 +0530200 class main
201 disabled
202 oneshot
Keyur2a73fe72012-10-13 09:05:54 +0530203
204service dhcpservice /system/bin/netcfg wlan0 dhcp
205 class main
206 oneshot
207
RonGokhale9a665712012-10-25 01:51:07 +0530208on property:dev.bootcomplete=1
209 stop dhcp-service
210 start dhcp-service
Keyur2a73fe72012-10-13 09:05:54 +0530211
212service setapversion /system/bin/lgapversion
213 class main
214 user radio
215 group radio
216 disabled
217 oneshot
218
RonGokhale9a665712012-10-25 01:51:07 +0530219on property:gsm.version.baseband=V07u-000-000-MAR-23-2009
220 start setapversion
221
Keyur2a73fe72012-10-13 09:05:54 +0530222service hfag /system/bin/sdptool add --channel=10 HFAG
223 class main
224 user bluetooth
225 group bluetooth net_bt_admin
226 disabled
227 oneshot
228
229service hsag /system/bin/sdptool add --channel=11 HSAG
230 class main
231 user bluetooth
232 group bluetooth net_bt_admin
233 disabled
234 oneshot
235
236service opush /system/bin/sdptool add --channel=12 OPUSH
237 class main
238 user bluetooth
239 group bluetooth net_bt_admin
240 disabled
241 oneshot
242
243service pbap /system/bin/sdptool add --channel=19 PBAP
244 class main
245 user bluetooth
246 group bluetooth net_bt_admin
247 disabled
248 oneshot
249
250service map /system/bin/sdptool add --channel=16 MAS
251 class main
252 user bluetooth
253 group bluetooth net_bt_admin
254 disabled
255 oneshot
256
257service qcom-sh /system/bin/sh /init.qcom.sh
258 class core
259 user root
260 oneshot
261
262service qcom-post-boot /system/bin/sh /system/etc/init.qcom.post_boot.sh
263 class main
264 user root
265 disabled
266 oneshot
267
Keyur2a73fe72012-10-13 09:05:54 +0530268## Stop dhcpcd when wifi was stopped
269on property:init.svc.wpa_supplicant=stopped
270 stop dhcpcd_wlan0
271
272## start qcom-post-boot
273on property:init.svc.bootanim=stopped
274 start qcom-post-boot
275
276## Read BT address
277on property:service.brcm.bt.mac=*
278 exec /system/bin/hwaddrs
279
Keyur2a73fe72012-10-13 09:05:54 +0530280on property:gsm.current.phone-type=1
281 start setapversion
282
RonGokhaleedad6512012-12-08 09:44:22 +0530283on property:gsm.version.baseband=V07u-000-000-MAR-23-2009
284 start setapversion
285
RonGokhale9a665712012-10-25 01:51:07 +0530286# Triggered by the KEY_VOLUME_DOWN+KEY_MENU keycodes
287service bugreport /system/bin/logwrapper /system/bin/dumpstate -d -v -o /sdcard/bugreports/bugreport
288 keycodes 114 139
289 class main
290 disabled
291 oneshot