blob: 01e324d7cd606551455662ba4d2d5143c45611f4 [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
Glenn Kasten48d58952012-08-03 09:40:02 -070020 mount debugfs debugfs /sys/kernel/debug
21
Jeff Sharkey3fc7e002012-08-16 14:05:42 -070022on init
23 mkdir /mnt/secure/sdcard0 0700 root root
24
Brian Muramatsu80018b22012-06-18 15:08:34 -070025 export EXTERNAL_STORAGE /storage/sdcard0
Jeff Sharkey3fc7e002012-08-16 14:05:42 -070026 mkdir /storage 0711 root root
27 mkdir /storage/sdcard0 0000 root root
Brian Muramatsu80018b22012-06-18 15:08:34 -070028 symlink /storage/sdcard0 /sdcard
29 symlink /storage/sdcard0 /mnt/sdcard
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070030
Jeff Sharkey3fc7e002012-08-16 14:05:42 -070031 # Save bugreports as owner
32 export BUGREPORT_WRITE_PATH /mnt/secure/sdcard0/0
33 export BUGREPORT_READ_PATH /storage/sdcard0
34
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070035on init
36 # Set permissions for persist partition
37 mkdir /persist 0771 system system
Sungmin Choie87b04d2012-07-12 20:42:14 -070038 mkdir /tombstones 0771 system system
39 mkdir /firmware 0771 system system
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070040
41on fs
Brian Muramatsu482dad72012-06-18 18:58:21 -070042 mount_all ./fstab.mako
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070043 setprop ro.crypto.fuse_sdcard true
44
45on early-boot
46 # set RLIMIT_MEMLOCK to 64MB
47 setrlimit 8 67108864 67108864
48
49on boot
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070050 chown bluetooth bluetooth /sys/module/hci_smd/parameters/hcismd_set
Sungmin Choi154f0e22012-07-25 17:34:52 -070051 chmod 0660 /sys/module/hci_smd/parameters/hcismd_set
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070052
53 #Create QMUX deamon socket area
54 mkdir /dev/socket/qmux_radio 0770 radio radio
55 chmod 2770 /dev/socket/qmux_radio
56 mkdir /dev/socket/qmux_audio 0770 media audio
57 chmod 2770 /dev/socket/qmux_audio
58 mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth
59 chmod 2770 /dev/socket/qmux_bluetooth
Ajay Dudanie1144092012-06-15 21:07:31 -070060 mkdir /dev/socket/qmux_gps 0770 gps gps
61 chmod 2770 /dev/socket/qmux_gps
62
Abhishek Adappad0e57532012-06-15 19:32:55 -070063 # Allow QMUX daemon to assign port open wait time
64 chown radio radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070065
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070066 #Remove SUID bit for iproute2 ip tool
67 chmod 0755 /system/bin/ip
68
69 #port-bridge
70 chmod 0660 /dev/smd0
71 chown system system /dev/smd0
72
73 #BT DUN port-bridge
74 chmod 0660 /dev/smd7
75 chown bluetooth bluetooth /dev/smd7
76
77 chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state
78
79 # create symlink for fb1 as HDMI
80 symlink /dev/graphics/fb1 /dev/graphics/hdmi
81
82 # Remove write permissions to video related nodes
83 chmod 0664 /sys/devices/virtual/graphics/fb1/hpd
84 chmod 0664 /sys/devices/virtual/graphics/fb1/video_mode
85 chmod 0664 /sys/devices/virtual/graphics/fb1/format_3d
86
87 # Change owner and group for media server and surface flinger
88 chown system system /sys/devices/virtual/graphics/fb1/format_3d
Sungmin Choi04a53b32012-07-23 23:14:29 -070089 chown system system /sys/devices/virtual/graphics/fb1/hpd
Iliyan Malchevfefe23c2012-06-08 10:36:25 -070090
91 #For bridgemgr daemon to inform the USB driver of the correct transport
92 chown radio radio /sys/class/android_usb/f_rmnet_smd_sdio/transport
93
94 chmod 660 /dev/rtc0
95 chown system system /dev/rtc0
96
97 chown root system /proc/net/ip_conntrack
98
99
100 #To allow interfaces to get v6 address when tethering is enabled
101 write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2
102 write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2
103 write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2
104 write /proc/sys/net/ipv6/conf/rmnet3/accept_ra 2
105 write /proc/sys/net/ipv6/conf/rmnet4/accept_ra 2
106 write /proc/sys/net/ipv6/conf/rmnet5/accept_ra 2
107 write /proc/sys/net/ipv6/conf/rmnet6/accept_ra 2
108 write /proc/sys/net/ipv6/conf/rmnet7/accept_ra 2
109 write /proc/sys/net/ipv6/conf/rmnet_sdio0/accept_ra 2
110 write /proc/sys/net/ipv6/conf/rmnet_sdio1/accept_ra 2
111 write /proc/sys/net/ipv6/conf/rmnet_sdio2/accept_ra 2
112 write /proc/sys/net/ipv6/conf/rmnet_sdio3/accept_ra 2
113 write /proc/sys/net/ipv6/conf/rmnet_sdio4/accept_ra 2
114 write /proc/sys/net/ipv6/conf/rmnet_sdio5/accept_ra 2
115 write /proc/sys/net/ipv6/conf/rmnet_sdio6/accept_ra 2
116 write /proc/sys/net/ipv6/conf/rmnet_sdio7/accept_ra 2
117
118
Martijn Coenen6c11a692012-07-31 13:25:27 -0700119# NFC: create data/nfc for nv storage
120 mkdir /data/nfc 770 nfc nfc
121 mkdir /data/nfc/param 770 nfc nfc
wongab.jeon65212cc2012-07-23 14:04:12 +0900122
jewon.lee06d6a3d2012-08-01 12:54:31 +0900123# Assign TCP buffer thresholds to be ceiling value of technology maximums
124# Increased technology maximums should be reflected here.
125 write /proc/sys/net/core/rmem_max 1220608
126 write /proc/sys/net/core/wmem_max 1220608
127
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700128# msm specific files that need to be created on /data
129on post-fs-data
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700130 mkdir /data/media 0775 media_rw media_rw
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700131
132 mkdir /data/misc/bluetooth 0770 bluetooth bluetooth
133
134 # Create the directories used by the Wireless subsystem
135 mkdir /data/misc/wifi 0770 wifi wifi
136 mkdir /data/misc/wifi/sockets 0770 wifi wifi
137 mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi
138 mkdir /data/misc/dhcp 0770 dhcp dhcp
139# to observe dnsmasq.leases file for dhcp information of soft ap.
140 chown dhcp system /data/misc/dhcp
141
142 write /dev/wcnss_wlan 1
143
144 # Create directory used by audio subsystem
145 mkdir /data/misc/audio 0770 audio audio
146
147 # Mounting of persist is moved to 'on emmc-fs' and 'on fs' sections
148 # We chown/chmod /persist again so because mount is run as root + defaults
149 chown system system /persist
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700150 chmod 0664 /sys/devices/platform/msm_sdcc.1/polling
151 chmod 0664 /sys/devices/platform/msm_sdcc.2/polling
152 chmod 0664 /sys/devices/platform/msm_sdcc.3/polling
153 chmod 0664 /sys/devices/platform/msm_sdcc.4/polling
154
155 # Chown polling nodes as needed from UI running on system server
156 chown system system /sys/devices/platform/msm_sdcc.1/polling
157 chown system system /sys/devices/platform/msm_sdcc.2/polling
158 chown system system /sys/devices/platform/msm_sdcc.3/polling
159 chown system system /sys/devices/platform/msm_sdcc.4/polling
160
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700161 #Create the symlink to qcn wpa_supplicant folder for ar6000 wpa_supplicant
162 mkdir /data/system 0775 system system
Iliyan Malcheve011ca22012-06-14 14:58:24 -0700163 #symlink /data/misc/wifi/wpa_supplicant /data/system/wpa_supplicant
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700164
dongkeun1.lee39507ab2012-06-21 18:35:51 -0700165 #Create directory used by sensor subsystem(dsps)
166 mkdir /data/system/sensors
167 chmod 665 /data/system/sensors
168 write /data/system/sensors/settings 1
Sungmin Choi154f0e22012-07-25 17:34:52 -0700169 chmod 660 /data/system/sensors/settings
dongkeun1.lee39507ab2012-06-21 18:35:51 -0700170
171 mkdir /data/misc/sensors
172 chmod 775 /data/misc/sensors
173
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700174 #Create directories for gpsone_daemon services
175 mkdir /data/misc/gpsone_d 0770 system gps
176
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700177 #Create directories for Location services
178 mkdir /data/misc/location 0770 gps gps
179 mkdir /data/misc/location/mq 0770 gps gps
180
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700181 #Provide the access to hostapd.conf only to root and group
182 chmod 0660 /data/hostapd/hostapd.conf
183
184 # Create /data/time folder for time-services
185 mkdir /data/time/ 0700 system system
186
187 mkdir /data/audio 0770 media audio
188 # Enable the setgid bit on the directory
189 chmod 2770 /data/audio
190
191 mkdir /data/bluetooth 0770 bluetooth bluetooth
192 # Enable the setgid bit on the directory
193 chmod 2770 /data/bluetooth
194
Iliyan Malchev9ec760d2012-06-21 17:57:22 -0700195 mkdir /data/qcks 0770 system system
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700196 setprop vold.post_fs_data_done 1
197
Iliyan Malchev4b2f22f2012-08-16 14:38:51 -0700198 mkdir /data/local 0770 root root
199 mkdir /data/local/tmp 0770 shell shell
200 rm /data/local/tmp/adreno_config.txt
201 write /data/local/tmp/adreno_config.txt "enableRotationShaderPatching=0
202"
203 chmod 0777 /data/local
204 chmod 0777 /data/local/tmp
205 chmod 0444 /data/local/tmp/adreno_config.txt
206
samin.ryu60606b02012-08-04 10:34:39 +0900207 # LED On/Off synchronization
208 chown system system /sys/class/leds/red/device/lock
209
roy.park178cd842012-07-02 14:09:26 -0700210 # Enable Power modes and set the CPU Freq Sampling rates
211 write /sys/module/rpm_resources/enable_low_power/L2_cache 1
212 write /sys/module/rpm_resources/enable_low_power/pxo 1
213 write /sys/module/rpm_resources/enable_low_power/vdd_dig 1
214 write /sys/module/rpm_resources/enable_low_power/vdd_mem 1
215 write /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled 1
216 write /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled 1
217 write /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled 1
218 write /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled 1
219 write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/suspend_enabled 1
220 write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/suspend_enabled 1
221 write /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/suspend_enabled 1
222 write /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/suspend_enabled 1
223 write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled 1
224 write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled 1
225 write /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/idle_enabled 1
226 write /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/idle_enabled 1
227 write /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled 1
228 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "ondemand"
229 write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "ondemand"
230 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "ondemand"
231 write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "ondemand"
232 write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 90
233 write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 50000
234 write /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy 1
235 write /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor 4
236 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 384000
237 write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 384000
238 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 384000
239 write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 384000
240 chown system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
241 chown system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
242 chown system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
243 chown system /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
244 chown system /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
245 chown system /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
246 chown system /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
247 chown system /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
248 chown system /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
249 chown root.system /sys/devices/system/cpu/mfreq
250 chmod 220 /sys/devices/system/cpu/mfreq
251 chown root.system /sys/devices/system/cpu/cpu1/online
252 chown root.system /sys/devices/system/cpu/cpu2/online
253 chown root.system /sys/devices/system/cpu/cpu3/online
254 chmod 664 /sys/devices/system/cpu/cpu1/online
255 chmod 664 /sys/devices/system/cpu/cpu2/online
256 chmod 664 /sys/devices/system/cpu/cpu3/online
257
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700258on property:init.svc.wpa_supplicant=stopped
259 stop dhcpcd
260
Abhishek Adappad0e57532012-06-15 19:32:55 -0700261service rmt_storage /system/bin/rmt_storage
262 class main
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700263 user root
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700264
jeonghoon.lim6a2ca5a2012-07-13 13:00:37 -0700265service hciattach /system/bin/sh /system/etc/init.mako.bt.sh
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700266 class late_start
267 user bluetooth
268 group qcom_oncrpc bluetooth net_bt_admin system
269 disabled
270 oneshot
271
jeonghoon.lim6a2ca5a2012-07-13 13:00:37 -0700272on property:bluetooth.hciattach=true
273 start hciattach
274
275on property:bluetooth.hciattach=false
Jeonghoon lim0a3bd802012-08-14 18:08:24 -0700276 setprop bluetooth.status off
jeonghoon.lim6a2ca5a2012-07-13 13:00:37 -0700277
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700278service bridgemgrd /system/bin/bridgemgrd
Abhishek Adappad0e57532012-06-15 19:32:55 -0700279 class main
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700280 user radio
281 group radio
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700282
283# QMUX must be in multiple groups to support external process connections
284service qmuxd /system/bin/qmuxd
Abhishek Adappad0e57532012-06-15 19:32:55 -0700285 class main
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700286 user radio
Ajay Dudanie1144092012-06-15 21:07:31 -0700287 group radio audio bluetooth gps
Abhishek Adappad0e57532012-06-15 19:32:55 -0700288
289service kickstart /system/bin/qcks -i /firmware/image/
290 class main
291 oneshot
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700292
293service netmgrd /system/bin/netmgrd
Abhishek Adappad0e57532012-06-15 19:32:55 -0700294 class main
295
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700296
297service sensors /system/bin/sensors.qcom
298 class late_start
299 user root
300 group root
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700301
Mekala Natarajancdea6b02012-06-26 18:59:03 -0700302service wpa_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant \
303 -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf \
Ajay Dudani4dd130b2012-07-19 09:07:31 -0700304 -C/data/misc/wifi/sockets
Mekala Natarajancdea6b02012-06-26 18:59:03 -0700305 class main
306 group wifi inet
307 socket wpa_wlan0 dgram 660 wifi wifi
308 disabled
309 oneshot
310
311service p2p_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant \
312 -Dnl80211 -iwlan0 -c/data/misc/wifi/p2p_supplicant.conf \
Ajay Dudani4dd130b2012-07-19 09:07:31 -0700313 -C/data/misc/wifi/sockets
Iliyan Malcheve011ca22012-06-14 14:58:24 -0700314 class main
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700315 group wifi inet
Iliyan Malcheve011ca22012-06-14 14:58:24 -0700316 socket wpa_wlan0 dgram 660 wifi wifi
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700317 disabled
318 oneshot
319
320service dhcpcd_wlan0 /system/bin/dhcpcd -ABKLG
321 class late_start
322 disabled
323 oneshot
324
325service dhcpcd_p2p /system/bin/dhcpcd -ABKLG
326 class late_start
327 disabled
328 oneshot
329
330service iprenew_wlan0 /system/bin/dhcpcd -n
331 class late_start
332 disabled
333 oneshot
334
335service iprenew_p2p /system/bin/dhcpcd -n p2p
336 class late_start
337 disabled
338 oneshot
339
340service dhcpcd_bnep0 /system/bin/dhcpcd -BKLG
341 disabled
342 oneshot
343
Ajay Dudani4dd130b2012-07-19 09:07:31 -0700344service hostapd /system/bin/hostapd -d /data/hostapd/hostapd.conf
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700345 class late_start
346 user root
347 group root
348 oneshot
349 disabled
350
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700351on property:ro.data.large_tcp_window_size=true
352 # Adjust socket buffer to enlarge TCP receive window for high bandwidth (e.g. DO-RevB)
353 write /proc/sys/net/ipv4/tcp_adv_win_scale 1
354
355service time_daemon /system/bin/time_daemon
356 class late_start
357 user root
358 group root
359 oneshot
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700360
361service ril-daemon1 /system/bin/rild -c 1
362 class late_start
363 socket rild1 stream 660 root radio
364 socket rild-debug1 stream 660 radio system
365 user root
366 disabled
367 group radio cache inet misc audio sdcard_rw qcom_oncrpc diag
368
369service profiler_daemon /system/bin/profiler_daemon
370 class late_start
371 user root
372 group root
373 disabled
374
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700375service charger /charger
376 class charger
377
Jeff Sharkey3fc7e002012-08-16 14:05:42 -0700378# virtual sdcard daemon running as media_rw (1023)
379service sdcard /system/bin/sdcard /data/media /mnt/secure/sdcard0 1023 1023
Iliyan Malchevfefe23c2012-06-08 10:36:25 -0700380 class late_start
Devin Kim693f9b12012-06-15 09:56:58 -0700381
382# Create ext4 filesystems when the partitions are empty or corrupted.
383service setup_fs /system/bin/setup_fs \
384 /dev/block/platform/msm_sdcc.1/by-name/userdata \
Devin Kimd64b8462012-06-25 10:01:04 -0700385 /dev/block/platform/msm_sdcc.1/by-name/cache \
jihyun.leeac9202f2012-06-27 18:13:10 -0700386 /dev/block/platform/msm_sdcc.1/by-name/tombstones
Devin Kim693f9b12012-06-15 09:56:58 -0700387 class core
388 user root
389 group root
390 oneshot
Ajay Dudani652bfde2012-07-08 13:31:43 -0700391
392service thermald /system/bin/thermald
393 class main
394
395service mpdecision /system/bin/mpdecision --no_sleep --avg_comp
396 class main
Ajay Dudanib3f2b962012-07-08 17:02:10 -0700397
398service qcamerasvr /system/bin/mm-qcamera-daemon
399 class late_start
400 user camera
401 group camera system inet input
402
Sungmin Choi5fd819d2012-07-18 01:49:40 -0700403service conn_init /system/bin/logwrapper /system/bin/conn_init
bill.jungcf534392012-07-24 20:02:34 +0900404 class main
Sungmin Choi5fd819d2012-07-18 01:49:40 -0700405 user system
406 group system wifi
407 oneshot
Sungmin Choic7c04c62012-07-25 10:51:27 -0700408
409# bugreport is triggered by holding down volume down, volume up and power
410service bugreport /system/bin/bugmailer.sh -v
411 class main
412 disabled
413 oneshot
414 keycodes 114 115 116
Sungmin Choi8e134362012-07-10 16:19:28 -0700415
416service qseecomd /system/bin/qseecomd
417 class late_start
418 user system
419 group system