blob: 18a432222d98d745133f1c553f5c23aaae2bd124 [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
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070047 chown bluetooth bluetooth /sys/module/hci_smd/parameters/hcismd_set
Sungmin Choi154f0e22012-07-25 17:34:52 -070048 chmod 0660 /sys/module/hci_smd/parameters/hcismd_set
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070049
50 #Create QMUX deamon socket area
51 mkdir /dev/socket/qmux_radio 0770 radio radio
52 chmod 2770 /dev/socket/qmux_radio
53 mkdir /dev/socket/qmux_audio 0770 media audio
54 chmod 2770 /dev/socket/qmux_audio
55 mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth
56 chmod 2770 /dev/socket/qmux_bluetooth
Ajay Dudanie1144092012-06-15 21:07:31 -070057 mkdir /dev/socket/qmux_gps 0770 gps gps
58 chmod 2770 /dev/socket/qmux_gps
59
Abhishek Adappad0e57532012-06-15 19:32:55 -070060 # Allow QMUX daemon to assign port open wait time
61 chown radio radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070062
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070063 #Remove SUID bit for iproute2 ip tool
64 chmod 0755 /system/bin/ip
65
66 #port-bridge
67 chmod 0660 /dev/smd0
68 chown system system /dev/smd0
69
70 #BT DUN port-bridge
71 chmod 0660 /dev/smd7
72 chown bluetooth bluetooth /dev/smd7
73
74 chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state
75
76 # create symlink for fb1 as HDMI
77 symlink /dev/graphics/fb1 /dev/graphics/hdmi
78
79 # Remove write permissions to video related nodes
80 chmod 0664 /sys/devices/virtual/graphics/fb1/hpd
81 chmod 0664 /sys/devices/virtual/graphics/fb1/video_mode
82 chmod 0664 /sys/devices/virtual/graphics/fb1/format_3d
83
84 # Change owner and group for media server and surface flinger
85 chown system system /sys/devices/virtual/graphics/fb1/format_3d
Sungmin Choi04a53b32012-07-23 23:14:29 -070086 chown system system /sys/devices/virtual/graphics/fb1/hpd
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070087
88 #For bridgemgr daemon to inform the USB driver of the correct transport
89 chown radio radio /sys/class/android_usb/f_rmnet_smd_sdio/transport
90
91 chmod 660 /dev/rtc0
92 chown system system /dev/rtc0
93
94 chown root system /proc/net/ip_conntrack
95
96
97 #To allow interfaces to get v6 address when tethering is enabled
98 write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2
99 write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2
100 write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2
101 write /proc/sys/net/ipv6/conf/rmnet3/accept_ra 2
102 write /proc/sys/net/ipv6/conf/rmnet4/accept_ra 2
103 write /proc/sys/net/ipv6/conf/rmnet5/accept_ra 2
104 write /proc/sys/net/ipv6/conf/rmnet6/accept_ra 2
105 write /proc/sys/net/ipv6/conf/rmnet7/accept_ra 2
106 write /proc/sys/net/ipv6/conf/rmnet_sdio0/accept_ra 2
107 write /proc/sys/net/ipv6/conf/rmnet_sdio1/accept_ra 2
108 write /proc/sys/net/ipv6/conf/rmnet_sdio2/accept_ra 2
109 write /proc/sys/net/ipv6/conf/rmnet_sdio3/accept_ra 2
110 write /proc/sys/net/ipv6/conf/rmnet_sdio4/accept_ra 2
111 write /proc/sys/net/ipv6/conf/rmnet_sdio5/accept_ra 2
112 write /proc/sys/net/ipv6/conf/rmnet_sdio6/accept_ra 2
113 write /proc/sys/net/ipv6/conf/rmnet_sdio7/accept_ra 2
114
115
Martijn Coenen6c11a692012-07-31 13:25:27 -0700116# NFC: create data/nfc for nv storage
117 mkdir /data/nfc 770 nfc nfc
118 mkdir /data/nfc/param 770 nfc nfc
wongab.jeon65212cc2012-07-23 14:04:12 +0900119
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700120# msm specific files that need to be created on /data
121on post-fs-data
122 # we will remap this as /mnt/sdcard with the sdcard fuse tool
123 mkdir /data/media 0775 media_rw media_rw
124 chown media_rw media_rw /data/media
125
126 mkdir /data/misc/bluetooth 0770 bluetooth bluetooth
127
128 # Create the directories used by the Wireless subsystem
129 mkdir /data/misc/wifi 0770 wifi wifi
130 mkdir /data/misc/wifi/sockets 0770 wifi wifi
131 mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi
132 mkdir /data/misc/dhcp 0770 dhcp dhcp
133# to observe dnsmasq.leases file for dhcp information of soft ap.
134 chown dhcp system /data/misc/dhcp
135
136 write /dev/wcnss_wlan 1
137
138 # Create directory used by audio subsystem
139 mkdir /data/misc/audio 0770 audio audio
140
141 # Mounting of persist is moved to 'on emmc-fs' and 'on fs' sections
142 # We chown/chmod /persist again so because mount is run as root + defaults
143 chown system system /persist
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700144 chmod 0664 /sys/devices/platform/msm_sdcc.1/polling
145 chmod 0664 /sys/devices/platform/msm_sdcc.2/polling
146 chmod 0664 /sys/devices/platform/msm_sdcc.3/polling
147 chmod 0664 /sys/devices/platform/msm_sdcc.4/polling
148
149 # Chown polling nodes as needed from UI running on system server
150 chown system system /sys/devices/platform/msm_sdcc.1/polling
151 chown system system /sys/devices/platform/msm_sdcc.2/polling
152 chown system system /sys/devices/platform/msm_sdcc.3/polling
153 chown system system /sys/devices/platform/msm_sdcc.4/polling
154
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700155 #Create the symlink to qcn wpa_supplicant folder for ar6000 wpa_supplicant
156 mkdir /data/system 0775 system system
Iliyan Malcheve011ca22012-06-14 14:58:24 -0700157 #symlink /data/misc/wifi/wpa_supplicant /data/system/wpa_supplicant
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700158
dongkeun1.lee39507ab2012-06-21 18:35:51 -0700159 #Create directory used by sensor subsystem(dsps)
160 mkdir /data/system/sensors
161 chmod 665 /data/system/sensors
162 write /data/system/sensors/settings 1
Sungmin Choi154f0e22012-07-25 17:34:52 -0700163 chmod 660 /data/system/sensors/settings
dongkeun1.lee39507ab2012-06-21 18:35:51 -0700164
165 mkdir /data/misc/sensors
166 chmod 775 /data/misc/sensors
167
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700168 #Create directories for gpsone_daemon services
169 mkdir /data/misc/gpsone_d 0770 system gps
170
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700171 #Create directories for Location services
172 mkdir /data/misc/location 0770 gps gps
173 mkdir /data/misc/location/mq 0770 gps gps
174
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700175 #Provide the access to hostapd.conf only to root and group
176 chmod 0660 /data/hostapd/hostapd.conf
177
178 # Create /data/time folder for time-services
179 mkdir /data/time/ 0700 system system
180
181 mkdir /data/audio 0770 media audio
182 # Enable the setgid bit on the directory
183 chmod 2770 /data/audio
184
185 mkdir /data/bluetooth 0770 bluetooth bluetooth
186 # Enable the setgid bit on the directory
187 chmod 2770 /data/bluetooth
188
Iliyan Malchev9ec760d2012-06-21 17:57:22 -0700189 mkdir /data/qcks 0770 system system
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700190 setprop vold.post_fs_data_done 1
191
roy.park178cd842012-07-02 14:09:26 -0700192 # Enable Power modes and set the CPU Freq Sampling rates
193 write /sys/module/rpm_resources/enable_low_power/L2_cache 1
194 write /sys/module/rpm_resources/enable_low_power/pxo 1
195 write /sys/module/rpm_resources/enable_low_power/vdd_dig 1
196 write /sys/module/rpm_resources/enable_low_power/vdd_mem 1
197 write /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled 1
198 write /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled 1
199 write /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled 1
200 write /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled 1
201 write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/suspend_enabled 1
202 write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/suspend_enabled 1
203 write /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/suspend_enabled 1
204 write /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/suspend_enabled 1
205 write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled 1
206 write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled 1
207 write /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/idle_enabled 1
208 write /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/idle_enabled 1
209 write /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled 1
210 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "ondemand"
211 write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "ondemand"
212 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "ondemand"
213 write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "ondemand"
214 write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 90
215 write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 50000
216 write /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy 1
217 write /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor 4
218 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 384000
219 write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 384000
220 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 384000
221 write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 384000
222 chown system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
223 chown system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
224 chown system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
225 chown system /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
226 chown system /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
227 chown system /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
228 chown system /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
229 chown system /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
230 chown system /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
231 chown root.system /sys/devices/system/cpu/mfreq
232 chmod 220 /sys/devices/system/cpu/mfreq
233 chown root.system /sys/devices/system/cpu/cpu1/online
234 chown root.system /sys/devices/system/cpu/cpu2/online
235 chown root.system /sys/devices/system/cpu/cpu3/online
236 chmod 664 /sys/devices/system/cpu/cpu1/online
237 chmod 664 /sys/devices/system/cpu/cpu2/online
238 chmod 664 /sys/devices/system/cpu/cpu3/online
239
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700240on property:init.svc.wpa_supplicant=stopped
241 stop dhcpcd
242
Abhishek Adappad0e57532012-06-15 19:32:55 -0700243service rmt_storage /system/bin/rmt_storage
244 class main
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700245 user root
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700246
jeonghoon.lim6a2ca5a2012-07-13 13:00:37 -0700247service hciattach /system/bin/sh /system/etc/init.mako.bt.sh
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700248 class late_start
249 user bluetooth
250 group qcom_oncrpc bluetooth net_bt_admin system
251 disabled
252 oneshot
253
jeonghoon.lim6a2ca5a2012-07-13 13:00:37 -0700254on property:bluetooth.hciattach=true
255 start hciattach
256
257on property:bluetooth.hciattach=false
258 write /sys/module/hci_smd/parameters/hcismd_set 0
259
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700260service bridgemgrd /system/bin/bridgemgrd
Abhishek Adappad0e57532012-06-15 19:32:55 -0700261 class main
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700262 user radio
263 group radio
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700264
265# QMUX must be in multiple groups to support external process connections
266service qmuxd /system/bin/qmuxd
Abhishek Adappad0e57532012-06-15 19:32:55 -0700267 class main
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700268 user radio
Ajay Dudanie1144092012-06-15 21:07:31 -0700269 group radio audio bluetooth gps
Abhishek Adappad0e57532012-06-15 19:32:55 -0700270
271service kickstart /system/bin/qcks -i /firmware/image/
272 class main
273 oneshot
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700274
275service netmgrd /system/bin/netmgrd
Abhishek Adappad0e57532012-06-15 19:32:55 -0700276 class main
277
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700278
279service sensors /system/bin/sensors.qcom
280 class late_start
281 user root
282 group root
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700283
Mekala Natarajancdea6b02012-06-26 18:59:03 -0700284service wpa_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant \
285 -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf \
Ajay Dudani4dd130b2012-07-19 09:07:31 -0700286 -C/data/misc/wifi/sockets
Mekala Natarajancdea6b02012-06-26 18:59:03 -0700287 class main
288 group wifi inet
289 socket wpa_wlan0 dgram 660 wifi wifi
290 disabled
291 oneshot
292
293service p2p_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant \
294 -Dnl80211 -iwlan0 -c/data/misc/wifi/p2p_supplicant.conf \
Ajay Dudani4dd130b2012-07-19 09:07:31 -0700295 -C/data/misc/wifi/sockets
Iliyan Malcheve011ca22012-06-14 14:58:24 -0700296 class main
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700297 group wifi inet
Iliyan Malcheve011ca22012-06-14 14:58:24 -0700298 socket wpa_wlan0 dgram 660 wifi wifi
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700299 disabled
300 oneshot
301
302service dhcpcd_wlan0 /system/bin/dhcpcd -ABKLG
303 class late_start
304 disabled
305 oneshot
306
307service dhcpcd_p2p /system/bin/dhcpcd -ABKLG
308 class late_start
309 disabled
310 oneshot
311
312service iprenew_wlan0 /system/bin/dhcpcd -n
313 class late_start
314 disabled
315 oneshot
316
317service iprenew_p2p /system/bin/dhcpcd -n p2p
318 class late_start
319 disabled
320 oneshot
321
322service dhcpcd_bnep0 /system/bin/dhcpcd -BKLG
323 disabled
324 oneshot
325
Ajay Dudani4dd130b2012-07-19 09:07:31 -0700326service hostapd /system/bin/hostapd -d /data/hostapd/hostapd.conf
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700327 class late_start
328 user root
329 group root
330 oneshot
331 disabled
332
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700333on property:ro.data.large_tcp_window_size=true
334 # Adjust socket buffer to enlarge TCP receive window for high bandwidth (e.g. DO-RevB)
335 write /proc/sys/net/ipv4/tcp_adv_win_scale 1
336
337service time_daemon /system/bin/time_daemon
338 class late_start
339 user root
340 group root
341 oneshot
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700342
343service ril-daemon1 /system/bin/rild -c 1
344 class late_start
345 socket rild1 stream 660 root radio
346 socket rild-debug1 stream 660 radio system
347 user root
348 disabled
349 group radio cache inet misc audio sdcard_rw qcom_oncrpc diag
350
351service profiler_daemon /system/bin/profiler_daemon
352 class late_start
353 user root
354 group root
355 disabled
356
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700357service charger /charger
358 class charger
359
Brian Muramatsu80018b22012-06-18 15:08:34 -0700360# create virtual SD card at /storage/sdcard0, based on the /data/media directory
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700361# daemon will drop to user/group system/media_rw after initializing
362# underlying files in /data/media will be created with user and group media_rw (1023)
363service sdcard /system/bin/sdcard /data/media 1023 1023
364 class late_start
Devin Kim693f9b12012-06-15 09:56:58 -0700365
366# Create ext4 filesystems when the partitions are empty or corrupted.
367service setup_fs /system/bin/setup_fs \
368 /dev/block/platform/msm_sdcc.1/by-name/userdata \
Devin Kimd64b8462012-06-25 10:01:04 -0700369 /dev/block/platform/msm_sdcc.1/by-name/cache \
jihyun.leeac9202f2012-06-27 18:13:10 -0700370 /dev/block/platform/msm_sdcc.1/by-name/tombstones
Devin Kim693f9b12012-06-15 09:56:58 -0700371 class core
372 user root
373 group root
374 oneshot
Ajay Dudani652bfde2012-07-08 13:31:43 -0700375
376service thermald /system/bin/thermald
377 class main
378
379service mpdecision /system/bin/mpdecision --no_sleep --avg_comp
380 class main
Ajay Dudanib3f2b962012-07-08 17:02:10 -0700381
382service qcamerasvr /system/bin/mm-qcamera-daemon
383 class late_start
384 user camera
385 group camera system inet input
386
Sungmin Choi5fd819d2012-07-18 01:49:40 -0700387service conn_init /system/bin/logwrapper /system/bin/conn_init
388 class late_start
389 user system
390 group system wifi
391 oneshot
Sungmin Choic7c04c62012-07-25 10:51:27 -0700392
393# bugreport is triggered by holding down volume down, volume up and power
394service bugreport /system/bin/bugmailer.sh -v
395 class main
396 disabled
397 oneshot
398 keycodes 114 115 116