blob: af2ef1d1f071c425687930a3d268fcfcb9ec6e06 [file] [log] [blame]
Iliyan Malchevfefe23c2012-06-08 10:36:25 -07001#
Sungmin Choicb14b4d2012-07-05 19:07:56 -07002# Copyright 2012 The Android Open Source Project
Iliyan Malchevfefe23c2012-06-08 10:36:25 -07003#
Sungmin Choicb14b4d2012-07-05 19:07:56 -07004# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070015#
16
17import init.mako.usb.rc
18
19on early-init
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070020 # for backwards compatibility
Brian Muramatsu80018b22012-06-18 15:08:34 -070021 export EXTERNAL_STORAGE /storage/sdcard0
22 mkdir /storage 0050 system sdcard_r
23 mkdir /storage/sdcard0 0000 system system
24 symlink /storage/sdcard0 /sdcard
25 symlink /storage/sdcard0 /mnt/sdcard
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070026
27on init
28 # Set permissions for persist partition
29 mkdir /persist 0771 system system
Sungmin Choie87b04d2012-07-12 20:42:14 -070030 mkdir /tombstones 0771 system system
31 mkdir /firmware 0771 system system
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070032
33on fs
Brian Muramatsu482dad72012-06-18 18:58:21 -070034 mount_all ./fstab.mako
35
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070036 #modem firmware files
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070037 wait /dev/block/platform/msm_sdcc.1/by-name/modem
Ajay Dudani1cecc8d2012-06-17 12:31:08 -070038 mount vfat /dev/block/platform/msm_sdcc.1/by-name/modem /firmware ro dmask=177 fmask=177
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070039
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070040 setprop ro.crypto.fuse_sdcard true
41
42on early-boot
43 # set RLIMIT_MEMLOCK to 64MB
44 setrlimit 8 67108864 67108864
45
46on boot
47 chown bluetooth bluetooth /sys/module/bluetooth_power/parameters/power
48 chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
49 chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
50 chown bluetooth bluetooth /proc/bluetooth/sleep/proto
51 chown system system /sys/module/sco/parameters/disable_esco
52 chown bluetooth bluetooth /sys/module/hci_smd/parameters/hcismd_set
53 chmod 0660 /sys/module/bluetooth_power/parameters/power
54 chmod 0666 /sys/module/hci_smd/parameters/hcismd_set
55 chmod 0660 /sys/class/rfkill/rfkill0/state
56 chmod 0660 /proc/bluetooth/sleep/proto
57 chown bluetooth bluetooth /dev/ttyHS0
58 chmod 0660 /dev/ttyHS0
59 chown bluetooth bluetooth /sys/devices/platform/msm_serial_hs.0/clock
60 chmod 0660 /sys/devices/platform/msm_serial_hs.0/clock
61
62 #Create QMUX deamon socket area
63 mkdir /dev/socket/qmux_radio 0770 radio radio
64 chmod 2770 /dev/socket/qmux_radio
65 mkdir /dev/socket/qmux_audio 0770 media audio
66 chmod 2770 /dev/socket/qmux_audio
67 mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth
68 chmod 2770 /dev/socket/qmux_bluetooth
Ajay Dudanie1144092012-06-15 21:07:31 -070069 mkdir /dev/socket/qmux_gps 0770 gps gps
70 chmod 2770 /dev/socket/qmux_gps
71
Abhishek Adappad0e57532012-06-15 19:32:55 -070072 # Allow QMUX daemon to assign port open wait time
73 chown radio radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070074
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070075 #Remove SUID bit for iproute2 ip tool
76 chmod 0755 /system/bin/ip
77
78 #port-bridge
79 chmod 0660 /dev/smd0
80 chown system system /dev/smd0
81
82 #BT DUN port-bridge
83 chmod 0660 /dev/smd7
84 chown bluetooth bluetooth /dev/smd7
85
86 chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state
87
88 # create symlink for fb1 as HDMI
89 symlink /dev/graphics/fb1 /dev/graphics/hdmi
90
91 # Remove write permissions to video related nodes
92 chmod 0664 /sys/devices/virtual/graphics/fb1/hpd
93 chmod 0664 /sys/devices/virtual/graphics/fb1/video_mode
94 chmod 0664 /sys/devices/virtual/graphics/fb1/format_3d
95
96 # Change owner and group for media server and surface flinger
97 chown system system /sys/devices/virtual/graphics/fb1/format_3d
Sungmin Choi04a53b32012-07-23 23:14:29 -070098 chown system system /sys/devices/virtual/graphics/fb1/hpd
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070099
100 #For bridgemgr daemon to inform the USB driver of the correct transport
101 chown radio radio /sys/class/android_usb/f_rmnet_smd_sdio/transport
102
103 chmod 660 /dev/rtc0
104 chown system system /dev/rtc0
105
106 chown root system /proc/net/ip_conntrack
107
108
109 #To allow interfaces to get v6 address when tethering is enabled
110 write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2
111 write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2
112 write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2
113 write /proc/sys/net/ipv6/conf/rmnet3/accept_ra 2
114 write /proc/sys/net/ipv6/conf/rmnet4/accept_ra 2
115 write /proc/sys/net/ipv6/conf/rmnet5/accept_ra 2
116 write /proc/sys/net/ipv6/conf/rmnet6/accept_ra 2
117 write /proc/sys/net/ipv6/conf/rmnet7/accept_ra 2
118 write /proc/sys/net/ipv6/conf/rmnet_sdio0/accept_ra 2
119 write /proc/sys/net/ipv6/conf/rmnet_sdio1/accept_ra 2
120 write /proc/sys/net/ipv6/conf/rmnet_sdio2/accept_ra 2
121 write /proc/sys/net/ipv6/conf/rmnet_sdio3/accept_ra 2
122 write /proc/sys/net/ipv6/conf/rmnet_sdio4/accept_ra 2
123 write /proc/sys/net/ipv6/conf/rmnet_sdio5/accept_ra 2
124 write /proc/sys/net/ipv6/conf/rmnet_sdio6/accept_ra 2
125 write /proc/sys/net/ipv6/conf/rmnet_sdio7/accept_ra 2
126
Iliyan Malchev5319dd92012-06-29 17:20:48 -0700127 # do not panic when a subsystem crashes
128 write /sys/module/subsystem_restart/parameters/restart_level 3
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700129
wongab.jeon65212cc2012-07-23 14:04:12 +0900130# NFC Feature
131 chmod 0600 /dev/bcm2079x-i2c
132 chown nfc system /dev/bcm2079x-i2c
133 setprop ro.nfc.port I2C
134
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700135# msm specific files that need to be created on /data
136on post-fs-data
137 # we will remap this as /mnt/sdcard with the sdcard fuse tool
138 mkdir /data/media 0775 media_rw media_rw
139 chown media_rw media_rw /data/media
140
141 mkdir /data/misc/bluetooth 0770 bluetooth bluetooth
142
143 # Create the directories used by the Wireless subsystem
144 mkdir /data/misc/wifi 0770 wifi wifi
145 mkdir /data/misc/wifi/sockets 0770 wifi wifi
146 mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi
147 mkdir /data/misc/dhcp 0770 dhcp dhcp
148# to observe dnsmasq.leases file for dhcp information of soft ap.
149 chown dhcp system /data/misc/dhcp
150
151 write /dev/wcnss_wlan 1
152
153 # Create directory used by audio subsystem
154 mkdir /data/misc/audio 0770 audio audio
155
156 # Mounting of persist is moved to 'on emmc-fs' and 'on fs' sections
157 # We chown/chmod /persist again so because mount is run as root + defaults
158 chown system system /persist
159 chmod 0771 /persist
160 chmod 0664 /sys/devices/platform/msm_sdcc.1/polling
161 chmod 0664 /sys/devices/platform/msm_sdcc.2/polling
162 chmod 0664 /sys/devices/platform/msm_sdcc.3/polling
163 chmod 0664 /sys/devices/platform/msm_sdcc.4/polling
164
165 # Chown polling nodes as needed from UI running on system server
166 chown system system /sys/devices/platform/msm_sdcc.1/polling
167 chown system system /sys/devices/platform/msm_sdcc.2/polling
168 chown system system /sys/devices/platform/msm_sdcc.3/polling
169 chown system system /sys/devices/platform/msm_sdcc.4/polling
170
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700171 #Create the symlink to qcn wpa_supplicant folder for ar6000 wpa_supplicant
172 mkdir /data/system 0775 system system
Iliyan Malcheve011ca22012-06-14 14:58:24 -0700173 #symlink /data/misc/wifi/wpa_supplicant /data/system/wpa_supplicant
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700174
dongkeun1.lee39507ab2012-06-21 18:35:51 -0700175 #Create directory used by sensor subsystem(dsps)
176 mkdir /data/system/sensors
177 chmod 665 /data/system/sensors
178 write /data/system/sensors/settings 1
179 chmod 666 /data/system/sensors/settings
180
181 mkdir /data/misc/sensors
182 chmod 775 /data/misc/sensors
183
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700184 #Create directories for gpsone_daemon services
185 mkdir /data/misc/gpsone_d 0770 system gps
186
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700187 #Create directories for Location services
188 mkdir /data/misc/location 0770 gps gps
189 mkdir /data/misc/location/mq 0770 gps gps
190
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700191 #Provide the access to hostapd.conf only to root and group
192 chmod 0660 /data/hostapd/hostapd.conf
193
194 # Create /data/time folder for time-services
195 mkdir /data/time/ 0700 system system
196
197 mkdir /data/audio 0770 media audio
198 # Enable the setgid bit on the directory
199 chmod 2770 /data/audio
200
201 mkdir /data/bluetooth 0770 bluetooth bluetooth
202 # Enable the setgid bit on the directory
203 chmod 2770 /data/bluetooth
204
Iliyan Malchev9ec760d2012-06-21 17:57:22 -0700205 mkdir /data/qcks 0770 system system
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700206 setprop vold.post_fs_data_done 1
207
roy.park178cd842012-07-02 14:09:26 -0700208 # Enable Power modes and set the CPU Freq Sampling rates
209 write /sys/module/rpm_resources/enable_low_power/L2_cache 1
210 write /sys/module/rpm_resources/enable_low_power/pxo 1
211 write /sys/module/rpm_resources/enable_low_power/vdd_dig 1
212 write /sys/module/rpm_resources/enable_low_power/vdd_mem 1
213 write /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled 1
214 write /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled 1
215 write /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled 1
216 write /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled 1
217 write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/suspend_enabled 1
218 write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/suspend_enabled 1
219 write /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/suspend_enabled 1
220 write /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/suspend_enabled 1
221 write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled 1
222 write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled 1
223 write /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/idle_enabled 1
224 write /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/idle_enabled 1
225 write /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled 1
226 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "ondemand"
227 write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "ondemand"
228 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "ondemand"
229 write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "ondemand"
230 write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 90
231 write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 50000
232 write /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy 1
233 write /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor 4
234 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 384000
235 write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 384000
236 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 384000
237 write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 384000
238 chown system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
239 chown system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
240 chown system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
241 chown system /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
242 chown system /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
243 chown system /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
244 chown system /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
245 chown system /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
246 chown system /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
247 chown root.system /sys/devices/system/cpu/mfreq
248 chmod 220 /sys/devices/system/cpu/mfreq
249 chown root.system /sys/devices/system/cpu/cpu1/online
250 chown root.system /sys/devices/system/cpu/cpu2/online
251 chown root.system /sys/devices/system/cpu/cpu3/online
252 chmod 664 /sys/devices/system/cpu/cpu1/online
253 chmod 664 /sys/devices/system/cpu/cpu2/online
254 chmod 664 /sys/devices/system/cpu/cpu3/online
255
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700256on property:init.svc.wpa_supplicant=stopped
257 stop dhcpcd
258
Abhishek Adappad0e57532012-06-15 19:32:55 -0700259service rmt_storage /system/bin/rmt_storage
260 class main
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700261 user root
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700262
jeonghoon.lim6a2ca5a2012-07-13 13:00:37 -0700263service hciattach /system/bin/sh /system/etc/init.mako.bt.sh
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700264 class late_start
265 user bluetooth
266 group qcom_oncrpc bluetooth net_bt_admin system
267 disabled
268 oneshot
269
jeonghoon.lim6a2ca5a2012-07-13 13:00:37 -0700270on property:bluetooth.hciattach=true
271 start hciattach
272
273on property:bluetooth.hciattach=false
274 write /sys/module/hci_smd/parameters/hcismd_set 0
275
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700276service bridgemgrd /system/bin/bridgemgrd
Abhishek Adappad0e57532012-06-15 19:32:55 -0700277 class main
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700278 user radio
279 group radio
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700280
281# QMUX must be in multiple groups to support external process connections
282service qmuxd /system/bin/qmuxd
Abhishek Adappad0e57532012-06-15 19:32:55 -0700283 class main
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700284 user radio
Ajay Dudanie1144092012-06-15 21:07:31 -0700285 group radio audio bluetooth gps
Abhishek Adappad0e57532012-06-15 19:32:55 -0700286
287service kickstart /system/bin/qcks -i /firmware/image/
288 class main
289 oneshot
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700290
291service netmgrd /system/bin/netmgrd
Abhishek Adappad0e57532012-06-15 19:32:55 -0700292 class main
293
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700294
295service sensors /system/bin/sensors.qcom
296 class late_start
297 user root
298 group root
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700299
Mekala Natarajancdea6b02012-06-26 18:59:03 -0700300service wpa_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant \
301 -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf \
Ajay Dudani4dd130b2012-07-19 09:07:31 -0700302 -C/data/misc/wifi/sockets
Mekala Natarajancdea6b02012-06-26 18:59:03 -0700303 class main
304 group wifi inet
305 socket wpa_wlan0 dgram 660 wifi wifi
306 disabled
307 oneshot
308
309service p2p_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant \
310 -Dnl80211 -iwlan0 -c/data/misc/wifi/p2p_supplicant.conf \
Ajay Dudani4dd130b2012-07-19 09:07:31 -0700311 -C/data/misc/wifi/sockets
Iliyan Malcheve011ca22012-06-14 14:58:24 -0700312 class main
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700313 group wifi inet
Iliyan Malcheve011ca22012-06-14 14:58:24 -0700314 socket wpa_wlan0 dgram 660 wifi wifi
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700315 disabled
316 oneshot
317
318service dhcpcd_wlan0 /system/bin/dhcpcd -ABKLG
319 class late_start
320 disabled
321 oneshot
322
323service dhcpcd_p2p /system/bin/dhcpcd -ABKLG
324 class late_start
325 disabled
326 oneshot
327
328service iprenew_wlan0 /system/bin/dhcpcd -n
329 class late_start
330 disabled
331 oneshot
332
333service iprenew_p2p /system/bin/dhcpcd -n p2p
334 class late_start
335 disabled
336 oneshot
337
338service dhcpcd_bnep0 /system/bin/dhcpcd -BKLG
339 disabled
340 oneshot
341
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700342service hdmid /system/bin/hdmid
343 class late_start
344 socket hdmid stream 0660 root system graphics
345 disabled
346
Ajay Dudani4dd130b2012-07-19 09:07:31 -0700347service hostapd /system/bin/hostapd -d /data/hostapd/hostapd.conf
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700348 class late_start
349 user root
350 group root
351 oneshot
352 disabled
353
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700354on property:ro.data.large_tcp_window_size=true
355 # Adjust socket buffer to enlarge TCP receive window for high bandwidth (e.g. DO-RevB)
356 write /proc/sys/net/ipv4/tcp_adv_win_scale 1
357
358service time_daemon /system/bin/time_daemon
359 class late_start
360 user root
361 group root
362 oneshot
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700363
364service ril-daemon1 /system/bin/rild -c 1
365 class late_start
366 socket rild1 stream 660 root radio
367 socket rild-debug1 stream 660 radio system
368 user root
369 disabled
370 group radio cache inet misc audio sdcard_rw qcom_oncrpc diag
371
372service profiler_daemon /system/bin/profiler_daemon
373 class late_start
374 user root
375 group root
376 disabled
377
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700378service charger /charger
379 class charger
380
Brian Muramatsu80018b22012-06-18 15:08:34 -0700381# create virtual SD card at /storage/sdcard0, based on the /data/media directory
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700382# daemon will drop to user/group system/media_rw after initializing
383# underlying files in /data/media will be created with user and group media_rw (1023)
384service sdcard /system/bin/sdcard /data/media 1023 1023
385 class late_start
Devin Kim693f9b12012-06-15 09:56:58 -0700386
387# Create ext4 filesystems when the partitions are empty or corrupted.
388service setup_fs /system/bin/setup_fs \
389 /dev/block/platform/msm_sdcc.1/by-name/userdata \
Devin Kimd64b8462012-06-25 10:01:04 -0700390 /dev/block/platform/msm_sdcc.1/by-name/cache \
jihyun.leeac9202f2012-06-27 18:13:10 -0700391 /dev/block/platform/msm_sdcc.1/by-name/tombstones
Devin Kim693f9b12012-06-15 09:56:58 -0700392 class core
393 user root
394 group root
395 oneshot
Ajay Dudani652bfde2012-07-08 13:31:43 -0700396
397service thermald /system/bin/thermald
398 class main
399
400service mpdecision /system/bin/mpdecision --no_sleep --avg_comp
401 class main
Ajay Dudanib3f2b962012-07-08 17:02:10 -0700402
403service qcamerasvr /system/bin/mm-qcamera-daemon
404 class late_start
405 user camera
406 group camera system inet input
407
Sungmin Choi5fd819d2012-07-18 01:49:40 -0700408service conn_init /system/bin/logwrapper /system/bin/conn_init
409 class late_start
410 user system
411 group system wifi
412 oneshot