blob: 84fa8c88070005bd327ee40a160e1c350a55a2d4 [file] [log] [blame]
Patrick Tjinea3b3cd2015-03-31 10:38:39 -07001#
2# Copyright 2015 The Android Open Source Project
3#
4# 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.
15#
16
17import init.angler.usb.rc
18import init.angler.diag.rc
Patrick Tjind18dd242015-05-21 23:43:58 -070019import init.angler.sensorhub.rc
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070020
21on early-init
22 mount debugfs debugfs /sys/kernel/debug
23 chown system system /sys/kernel/debug/kgsl/proc
24
25on init
Patrick Tjin435a3eb2015-06-10 11:37:52 -070026 # Load persistent dm-verity state
27 verity_load_state
28
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070029 # Set permissions for persist partition
30 mkdir /persist 0771 system system
31 mkdir /firmware 0771 system system
32
33 # Support legacy paths
34 symlink /sdcard /mnt/sdcard
35 symlink /sdcard /storage/sdcard0
36
37on fs
Mekala Natarajanb3d739e2015-07-24 00:10:04 -070038 symlink /dev/block/platform/soc.0/f9824900.sdhci /dev/block/bootdevice
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070039 mount_all ./fstab.angler
40
dcashman73d96702015-08-10 13:20:55 -070041 restorecon_recursive /persist
42
Naveen Ramaraj87018982015-04-24 21:10:40 -070043 # Enable rmnet data and aggregation
44 setprop persist.rmnet.mux enabled
45 setprop persist.rmnet.data.enable true
46 setprop persist.data.wda.enable true
47 setprop persist.data.df.agg.dl_pkt 10
48 setprop persist.data.df.agg.dl_size 4096
49
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070050on early-boot
51 # set RLIMIT_MEMLOCK to 64MB
52 setrlimit 8 67108864 67108864
53
Patrick Tjin435a3eb2015-06-10 11:37:52 -070054 # Adjust parameters for dm-verity device
55 write /sys/block/dm-0/queue/read_ahead_kb 2048
56
57 # Update dm-verity state and set partition.*.verified properties
58 verity_update_state
59
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070060on boot
Tim Murray6abb5fd2015-06-15 19:45:47 -070061 # execute script to set initial CPU settings
62 # don't run as a service to avoid race conditions
63 exec /system/bin/init.angler.power.sh
Zhihui Wu7d7b98c2015-04-24 00:40:19 -070064
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070065 # Enable DEBUG_SUSPEND, DEBUG_EXIT_SUSPEND, and DEBUG_WAKEUP
66 write /sys/module/wakelock/parameters/debug_mask 7
67
Tim Murray4e53f232015-06-04 16:18:03 -070068 # update foreground cpuset now that processors are up
69 write /dev/cpuset/foreground/cpus 0-7
70 write /dev/cpuset/background/cpus 0
71
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070072 # create symlink for fb1 as HDMI
73 symlink /dev/graphics/fb1 /dev/graphics/hdmi
74
75 # setup permissions for fb1 related nodes
76 chown system graphics /sys/class/graphics/fb1/hpd
77 chown system graphics /sys/class/graphics/fb1/vendor_name
78 chown system graphics /sys/class/graphics/fb1/product_description
79 chmod 0664 /sys/devices/virtual/graphics/fb1/hpd
80 chmod 0664 /sys/devices/virtual/graphics/fb1/vendor_name
81 chmod 0664 /sys/devices/virtual/graphics/fb1/product_description
82
Zhihui Wu9f08b862015-05-04 21:25:06 -070083 #config fingerprint
lijianzhao72688d42015-06-26 22:12:13 -070084 chown system system /sys/bus/spi/devices/spi12.0/spi_prepare
85 chown system system /sys/bus/spi/devices/spi12.0/wakeup_enable
86 chown system system /sys/bus/spi/devices/spi12.0/do_wakeup
Zhihui Wu9f08b862015-05-04 21:25:06 -070087
Naveen Ramaraj87018982015-04-24 21:10:40 -070088 #Create QMUX deamon socket
89 mkdir /dev/socket/qmux_radio 0770 radio radio
90 chmod 2770 /dev/socket/qmux_radio
91 mkdir /dev/socket/qmux_audio 0770 media audio
92 chmod 2770 /dev/socket/qmux_audio
93 mkdir /dev/socket/qmux_gps 0770 gps gps
94 chmod 2770 /dev/socket/qmux_gps
95
wang pingd69321a2015-05-13 00:11:24 +080096 setprop wifi.interface wlan0
97
wang ping123e0952015-07-27 21:24:03 -070098 #wifi sar
99 chown radio radio /sys/module/wifi_sar/parameters/wifi_tx_power_limit
100
Naveen Ramaraj87018982015-04-24 21:10:40 -0700101 write /sys/bus/platform/drivers/xhci_msm_hsic/unbind msm_hsic_host
102 write /sys/module/rmnet_usb/parameters/mux_enabled 1
103 write /sys/module/rmnet_usb/parameters/no_fwd_rmnet_links 8
104 write /sys/module/rmnet_usb/parameters/no_rmnet_insts_per_dev 17
105 write /sys/module/rmnet_usb/parameters/rmnet_data_init 1
106 chown radio radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait
107
zhaoyang yin5e075be2015-07-08 21:48:47 +0800108 #audio prop
109 setprop persist.audio.dualmic.config endfire
110 setprop persist.audio.fluence.voicecall true
111 setprop persist.audio.product.identify angler
zhaoyang yin5f91f5e2015-07-11 07:41:34 +0800112 setprop persist.audio.fluence.speaker true
zhaoyang yin5e075be2015-07-08 21:48:47 +0800113
Naveen Ramaraj87018982015-04-24 21:10:40 -0700114on property:init.svc.per_mgr=running
115 start per_proxy
116
117on property:sys.shutdown.requested=*
118 stop per_proxy
119
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700120on post-fs-data
121 write /sys/kernel/boot_adsp/boot 1
122
123 # Ecc_Handler qcril.db
Sooraj Sasindranafa352f2015-06-19 11:12:19 -0700124 mkdir /data/misc/radio 0770 system radio
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700125
126 setprop vold.post_fs_data_done 1
127
Mekala Natarajaneb9c2a32015-04-27 11:01:22 -0700128 mkdir /data/misc/qsee 0770 system system
dcashman73d96702015-08-10 13:20:55 -0700129 mkdir /data/fpc 0700 system system
Mekala Natarajaneb9c2a32015-04-27 11:01:22 -0700130
zhihui wuc17b9dc2015-07-24 23:21:14 -0700131 # Create a link /dev/stm_sensor for input device which name is "STM VL6180 proximity sensor"
132 exec /system/bin/init.angler.laser.sh
133
Zhihui Wu7055b3e2015-05-13 18:14:46 -0700134 #Create folder for mm-qcamera-daemon
135 mkdir /data/misc/camera 0770 camera camera
136
Naseer Ahmed1b0f56a2015-07-09 16:46:40 -0400137 #Create folder for display calibration data
138 mkdir /data/misc/display 0770 system graphics
139
Naveen Ramaraj4517b042015-07-29 20:02:42 -0700140 # Create /data/time folder for time-services
141 mkdir /data/time/ 0700 system system
142 mkdir /data/audio/ 0770 media audio
143
144 # Create folder for perf daemon
145 mkdir /data/misc/perfd 0755 root system
146 chmod 2755 /data/misc/perfd
147 mkdir /data/system/perfd 0770 root system
148 rm /data/system/perfd/default_values
149 chmod 2770 /data/system/perfd
150 setprop ro.min_freq_0 384000
151 setprop ro.min_freq_4 384000
152
Zhihui Wu5dd2b472015-05-20 16:31:35 -0700153 # Create the directories used by CnE subsystem
154 mkdir /data/connectivity 0771 system system
155 chown system system /data/connectivity
156
157 #Create directory from IMS services
158 mkdir /data/shared 0755
159 chown system system /data/shared
160
Naveen Ramaraj4517b042015-07-29 20:02:42 -0700161 # Mark the copy complete flag to not completed
162 write /data/misc/radio/copy_complete 0
163 chown radio radio /data/misc/radio/copy_complete
164 chmod 0660 /data/misc/radio/copy_complete
Zhenhua Ma786d29b2015-06-04 13:22:50 +0800165
wang pingdc7ea962015-05-09 00:37:27 +0800166 # Configure bluetooth
167 chmod 0660 /proc/bluetooth/sleep/lpm
168 chmod 0660 /proc/bluetooth/sleep/btwrite
169 chmod 0660 /sys/class/rfkill/rfkill0/state
170 chmod 0660 /dev/ttyHS0
171 chown bluetooth net_bt_stack /proc/bluetooth/sleep/lpm
172 chown bluetooth net_bt_stack /proc/bluetooth/sleep/btwrite
173 chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state
174 chown bluetooth net_bt_stack /dev/ttyHS0
175
wang ping0684e522015-05-20 22:58:34 +0800176 # Create nfc local data
177 mkdir /data/nfc 0770 nfc nfc
178
zhaoyang yin2928a3c2015-06-04 20:00:12 +0800179 #modify access for speaker calibdata
180 chown system system /persist/audio/speaker_calibdata.bin
181 chmod 0444 /persist/audio/speaker_calibdata.bin
182
zhihui wu81580032015-07-27 17:19:25 -0700183 #modify access for laser calibration data
184 chmod 0710 /persist/data
185 chmod 0440 /persist/data/st_offset
186 chmod 0440 /persist/data/st_xtalk
187
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700188on charger
Zhihui Wu13d03c62015-04-23 22:06:27 -0700189 #low power governing
zhen yuanf33b6422015-08-11 04:35:35 +0800190 write /sys/devices/soc.0/qcom,bcl.60/mode disable
191 write /sys/devices/soc.0/qcom,bcl.60/hotplug_mask 0
192 write /sys/devices/soc.0/qcom,bcl.60/hotplug_soc_mask 0
Zhihui Wu13d03c62015-04-23 22:06:27 -0700193 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
194 write /sys/devices/system/cpu/cpu1/online 0
195 write /sys/devices/system/cpu/cpu2/online 0
196 write /sys/devices/system/cpu/cpu3/online 0
197 write /sys/devices/system/cpu/cpu4/online 0
198 write /sys/devices/system/cpu/cpu5/online 0
199 write /sys/devices/system/cpu/cpu6/online 0
200 write /sys/devices/system/cpu/cpu7/online 0
201
Mekala Natarajan4f299632015-07-17 00:21:29 -0700202on property:sys.boot_completed=1
203 #allow CPUs to go in deeper idle state than C0
204 write /sys/module/lpm_levels/parameters/sleep_disabled 0
205
Zhenhua Ma739e45e2015-07-01 13:36:39 +0800206service ssr_setup /system/bin/ssr_setup
207 oneshot
208 disabled
209
210service ss_ramdump /system/bin/subsystem_ramdump
211 class main
212 user system
213 group system
214 disabled
215
216on property:persist.sys.ssr.restart_level=*
217 start ssr_setup
218
219on property:persist.sys.ssr.enable_ramdumps=1
220 write /sys/module/subsystem_restart/parameters/enable_ramdumps 1
221 start ss_ramdump
222
223on property:persist.sys.ssr.enable_ramdumps=0
224 write /sys/module/subsystem_restart/parameters/enable_ramdumps 0
225
Zhihui Wu13d03c62015-04-23 22:06:27 -0700226service charger /sbin/healthd -c
227 class charger
228 group log
229 seclabel u:r:healthd:s0
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700230
Naveen Ramaraj87018982015-04-24 21:10:40 -0700231service per_mgr /system/bin/pm-service
232 class core
233 user root
234 group system net_raw
235
236service per_proxy /system/bin/pm-proxy
237 class core
238 user root
239 group system net_raw
240 disabled
241
242service rmt_storage /system/bin/rmt_storage
243 class core
244 user root
dcashman6ac5c822015-08-14 11:43:14 -0700245 group system
Naveen Ramaraj87018982015-04-24 21:10:40 -0700246
Mekala Natarajaneb9c2a32015-04-27 11:01:22 -0700247service qseecomd /system/bin/qseecomd
248 class core
249 user root
250 group root
251
Naveen Ramaraj87018982015-04-24 21:10:40 -0700252service irsc_util /system/bin/irsc_util "/etc/sec_config"
253 class main
254 user root
255 oneshot
256
Naveen Ramaraj910680c2015-05-04 10:45:49 -0700257service thermal-engine /system/bin/thermal-engine
258 class main
259 user root
260 socket thermal-send-client stream 0660 system system
261 socket thermal-recv-client stream 0660 system system
262 socket thermal-recv-passive-client stream 0660 system system
dcashmana170fa32015-08-14 15:09:25 -0700263 group root radio
Naveen Ramaraj910680c2015-05-04 10:45:49 -0700264
Naveen Ramaraj87018982015-04-24 21:10:40 -0700265# QMUX must be in multiple groups to support external process connections
266service qmuxd /system/bin/qmuxd
267 class main
Tom Cherry858f6312015-06-05 11:07:58 -0700268 user radio
269 group radio audio bluetooth gps
Naveen Ramaraj87018982015-04-24 21:10:40 -0700270
Naveen Ramaraj84aa57d2015-06-11 18:37:03 -0700271service perfd /system/bin/perfd
272 class main
273 user root
274
Naveen Ramaraj87018982015-04-24 21:10:40 -0700275service netmgrd /system/bin/netmgrd
Ajay Dudani1faa3d32015-06-22 11:12:09 -0700276 class main
Naveen Ramaraj87018982015-04-24 21:10:40 -0700277 group radio
Naveen Ramaraj87018982015-04-24 21:10:40 -0700278
Zhihui Wu384b2222015-05-19 13:42:18 -0700279service qti /system/vendor/bin/qti
280 class main
281 user radio
282 group radio net_raw usb net_admin
Zhihui Wu384b2222015-05-19 13:42:18 -0700283
Naveen Ramaraj87018982015-04-24 21:10:40 -0700284service time_daemon /system/bin/time_daemon
285 class late_start
286 user root
287 group root
288
Mekala Natarajan19925592015-05-04 10:19:48 -0700289service loc_launcher /system/bin/loc_launcher
290 class late_start
291 group gps inet net_raw net_admin wifi
292
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700293# bugreport is triggered by holding down volume down, volume up and power
294service bugreport /system/bin/dumpstate -d -p -B \
295 -o /data/data/com.android.shell/files/bugreports/bugreport
296 class main
297 disabled
298 oneshot
299 keycodes 114 115 116
Zhihui Wu7055b3e2015-05-13 18:14:46 -0700300
301# start camera server as daemon
302service qcamerasvr /system/bin/mm-qcamera-daemon
303 class late_start
304 user camera
305 group camera system inet input graphics
Vineeta Srivastavaf6ab59a2015-05-20 17:29:44 -0700306
307service fingerprintd /system/bin/fingerprintd
308 class late_start
309 user system
lijianzhao72688d42015-06-26 22:12:13 -0700310 group input
wang pingd69321a2015-05-13 00:11:24 +0800311
312service p2p_supplicant /system/bin/wpa_supplicant \
313 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
314 -I/system/etc/wifi/p2p_supplicant_overlay.conf \
315 -O/data/misc/wifi/sockets \
316 -m/data/misc/wifi/p2p_supplicant.conf \
317 -puse_p2p_group_interface=1p2p_device=1 \
318 -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
319 class main
320 socket wpa_wlan0 dgram 660 wifi wifi
321 disabled
322 oneshot
323
324service wpa_supplicant /system/bin/wpa_supplicant \
325 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
326 -I/system/etc/wifi/wpa_supplicant_overlay.conf \
327 -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
328 class main
329 socket wpa_wlan0 dgram 660 wifi wifi
330 disabled
331 oneshot
332
333service dhcpcd_wlan0 /system/bin/dhcpcd -aABKL
334 class main
335 disabled
336 oneshot
337
338service dhcpcd_p2p /system/bin/dhcpcd -aABKL
339 class main
340 disabled
341 oneshot
342
343service iprenew_wlan0 /system/bin/dhcpcd -n
344 class main
345 disabled
346 oneshot
347
348service iprenew_p2p /system/bin/dhcpcd -n
349 class main
350 disabled
351 oneshot
Zhihui Wu5dd2b472015-05-20 16:31:35 -0700352
wang1f7df762015-06-19 18:14:47 +0800353service dhcpcd_bt-pan /system/bin/dhcpcd -BKLG
354 class main
355 disabled
356 oneshot
357
358service iprenew_bt-pan /system/bin/dhcpcd -n
359 class main
360 disabled
361 oneshot
362
Zhihui Wu5dd2b472015-05-20 16:31:35 -0700363service imsqmidaemon /system/bin/imsqmidaemon
364 class main
365 user system
366 socket ims_qmid stream 0660 system radio
367 group radio net_raw log diag
368
369service imsdatadaemon /system/bin/imsdatadaemon
370 class main
371 user system
372 socket ims_datad stream 0660 system radio
373 group system wifi radio inet net_raw log diag net_admin
374 disabled
375
376on property:sys.ims.QMI_DAEMON_STATUS=1
377 start imsdatadaemon
378
379service ims_rtp_daemon /system/bin/ims_rtp_daemon
380 class main
381 user system
382 socket ims_rtpd stream 0660 system radio
383 group radio net_raw diag diag log
384 disabled
385
386on property:sys.ims.DATA_DAEMON_STATUS=1
387 start ims_rtp_daemon
388
389service imscmservice /system/bin/imscmservice
390 class main
391 user system
392 group radio net_raw diag diag log
393
394service cnd /system/bin/cnd
395 class late_start
396 socket cnd stream 660 root inet
Patrick Tjin435a3eb2015-06-10 11:37:52 -0700397
wang ping04252d82015-06-10 22:55:51 -0700398on property:ro.boot.hardware.revision=ANGLER-V1
399 write /sys/module/bcmdhd/parameters/nvram_path \
400 /system/etc/wifi/bcmdhd-pme.cal
401
402on property:ro.boot.hardware.revision=ANGLER-V2
403 write /sys/module/bcmdhd/parameters/nvram_path \
404 /system/etc/wifi/bcmdhd-pme.cal
Zhenhua Ma786d29b2015-06-04 13:22:50 +0800405
406service mcfg-sh /system/bin/sh /system/etc/init.mcfg.sh
407 class late_start
408 user root
409 oneshot
renjie zhao0de37582015-06-05 14:22:37 +0800410
411service oem_qmi_server /vendor/bin/oem_qmi_server
renjie zhaob56cfa92015-07-23 11:17:05 +0800412 class main
renjie zhao0de37582015-06-05 14:22:37 +0800413 user root
Riley Andrewsa1399722015-06-22 15:53:18 -0700414
415service msm_irqbalance /system/bin/msm_irqbalance -f /system/etc/msm_irqbalance.conf
416 socket msm_irqbalance seqpacket 660 root system
417 class core
418 user root
419 group root
zhangmingzhenff53d442015-07-06 17:54:11 +0800420
421#start atfwd as daemon
422service atfwd /system/bin/ATFWD-daemon
423 class late_start
424 user system
425 group system radio
426
Naseer Ahmed1b0f56a2015-07-09 16:46:40 -0400427service ppd /system/bin/mm-pp-daemon
428 class late_start
429 user system
430 socket pps stream 0660 system system
431 group system graphics
432
433on property:init.svc.surfaceflinger=stopped
434 stop ppd
renjie zhao57797562015-07-18 11:58:58 +0800435
436service diag_test_server /vendor/bin/diag_test_server
437 class core
438 user root
439 disabled
440
441on property:ro.boot.mode=hw-factory
442 start diag_test_server
443