blob: 0537ef0d3d5b079ecf76b0e86afcab7756a15690 [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
Tim Murray882bedb2015-09-13 13:17:34 -070037 # Setup zram options
38 write /sys/block/zram0/comp_algorithm lz4
39 write /sys/block/zram0/max_comp_streams 4
40
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070041on fs
Mekala Natarajanb3d739e2015-07-24 00:10:04 -070042 symlink /dev/block/platform/soc.0/f9824900.sdhci /dev/block/bootdevice
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070043 mount_all ./fstab.angler
Tim Murray882bedb2015-09-13 13:17:34 -070044 swapon_all ./fstab.angler
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070045
dcashman73d96702015-08-10 13:20:55 -070046 restorecon_recursive /persist
dcashman66ac8042015-08-31 15:21:24 -070047 mkdir /persist/data/sfs 0700 system system
48 mkdir /persist/data/tz 0700 system system
dcashman73d96702015-08-10 13:20:55 -070049
Naveen Ramaraj87018982015-04-24 21:10:40 -070050 # Enable rmnet data and aggregation
51 setprop persist.rmnet.mux enabled
52 setprop persist.rmnet.data.enable true
53 setprop persist.data.wda.enable true
54 setprop persist.data.df.agg.dl_pkt 10
55 setprop persist.data.df.agg.dl_size 4096
56
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070057on early-boot
58 # set RLIMIT_MEMLOCK to 64MB
59 setrlimit 8 67108864 67108864
60
Patrick Tjin435a3eb2015-06-10 11:37:52 -070061 # Adjust parameters for dm-verity device
62 write /sys/block/dm-0/queue/read_ahead_kb 2048
63
64 # Update dm-verity state and set partition.*.verified properties
65 verity_update_state
66
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070067on boot
Tim Murray6abb5fd2015-06-15 19:45:47 -070068 # execute script to set initial CPU settings
69 # don't run as a service to avoid race conditions
dcashman1bca35b2015-08-26 10:16:51 -070070 exec - root system -- /system/bin/init.angler.power.sh
Zhihui Wu7d7b98c2015-04-24 00:40:19 -070071
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070072 # Enable DEBUG_SUSPEND, DEBUG_EXIT_SUSPEND, and DEBUG_WAKEUP
73 write /sys/module/wakelock/parameters/debug_mask 7
74
Tim Murray4e53f232015-06-04 16:18:03 -070075 # update foreground cpuset now that processors are up
76 write /dev/cpuset/foreground/cpus 0-7
Tim Murray12a88062015-09-01 14:24:18 -070077 write /dev/cpuset/foreground/boost/cpus 4-7
Tim Murray4e53f232015-06-04 16:18:03 -070078 write /dev/cpuset/background/cpus 0
79
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070080 # create symlink for fb1 as HDMI
81 symlink /dev/graphics/fb1 /dev/graphics/hdmi
82
83 # setup permissions for fb1 related nodes
84 chown system graphics /sys/class/graphics/fb1/hpd
85 chown system graphics /sys/class/graphics/fb1/vendor_name
86 chown system graphics /sys/class/graphics/fb1/product_description
87 chmod 0664 /sys/devices/virtual/graphics/fb1/hpd
88 chmod 0664 /sys/devices/virtual/graphics/fb1/vendor_name
89 chmod 0664 /sys/devices/virtual/graphics/fb1/product_description
90
Zhihui Wu9f08b862015-05-04 21:25:06 -070091 #config fingerprint
lijianzhao72688d42015-06-26 22:12:13 -070092 chown system system /sys/bus/spi/devices/spi12.0/spi_prepare
93 chown system system /sys/bus/spi/devices/spi12.0/wakeup_enable
94 chown system system /sys/bus/spi/devices/spi12.0/do_wakeup
Zhihui Wu9f08b862015-05-04 21:25:06 -070095
Naveen Ramaraj87018982015-04-24 21:10:40 -070096 #Create QMUX deamon socket
97 mkdir /dev/socket/qmux_radio 0770 radio radio
98 chmod 2770 /dev/socket/qmux_radio
99 mkdir /dev/socket/qmux_audio 0770 media audio
100 chmod 2770 /dev/socket/qmux_audio
101 mkdir /dev/socket/qmux_gps 0770 gps gps
102 chmod 2770 /dev/socket/qmux_gps
103
wang pingd69321a2015-05-13 00:11:24 +0800104 setprop wifi.interface wlan0
105
wang ping123e0952015-07-27 21:24:03 -0700106 #wifi sar
107 chown radio radio /sys/module/wifi_sar/parameters/wifi_tx_power_limit
108
lijianzhaoeed67ea2015-08-18 10:12:16 -0700109 #compass compensation
110 chown root system /sys/class/power_supply/battery/compass_compensation
111
Naveen Ramaraj87018982015-04-24 21:10:40 -0700112 write /sys/bus/platform/drivers/xhci_msm_hsic/unbind msm_hsic_host
113 write /sys/module/rmnet_usb/parameters/mux_enabled 1
114 write /sys/module/rmnet_usb/parameters/no_fwd_rmnet_links 8
115 write /sys/module/rmnet_usb/parameters/no_rmnet_insts_per_dev 17
116 write /sys/module/rmnet_usb/parameters/rmnet_data_init 1
117 chown radio radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait
118
Patrick Tjincd0180c2015-09-10 11:35:13 -0700119 # Assign TCP buffer thresholds to be ceiling value of technology maximums
120 # Increased technology maximums should be reflected here.
121 write /proc/sys/net/core/rmem_max 8388608
122 write /proc/sys/net/core/wmem_max 8388608
123
Patrick Tjinaec86752015-08-25 00:15:08 -0700124 # Leds
125 chown system system /sys/class/leds/red/on_off_ms
126 chown system system /sys/class/leds/green/on_off_ms
127 chown system system /sys/class/leds/blue/on_off_ms
128 chown system system /sys/class/leds/red/rgb_start
129
Naveen Ramaraj87018982015-04-24 21:10:40 -0700130on property:init.svc.per_mgr=running
131 start per_proxy
132
133on property:sys.shutdown.requested=*
134 stop per_proxy
135
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700136on post-fs-data
137 write /sys/kernel/boot_adsp/boot 1
138
139 # Ecc_Handler qcril.db
Sooraj Sasindranafa352f2015-06-19 11:12:19 -0700140 mkdir /data/misc/radio 0770 system radio
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700141
142 setprop vold.post_fs_data_done 1
143
Mekala Natarajaneb9c2a32015-04-27 11:01:22 -0700144 mkdir /data/misc/qsee 0770 system system
dcashman73d96702015-08-10 13:20:55 -0700145 mkdir /data/fpc 0700 system system
Mekala Natarajaneb9c2a32015-04-27 11:01:22 -0700146
Zhihui Wu7055b3e2015-05-13 18:14:46 -0700147 #Create folder for mm-qcamera-daemon
148 mkdir /data/misc/camera 0770 camera camera
149
Naseer Ahmed1b0f56a2015-07-09 16:46:40 -0400150 #Create folder for display calibration data
151 mkdir /data/misc/display 0770 system graphics
152
Naveen Ramaraj4517b042015-07-29 20:02:42 -0700153 # Create /data/time folder for time-services
154 mkdir /data/time/ 0700 system system
155 mkdir /data/audio/ 0770 media audio
156
157 # Create folder for perf daemon
158 mkdir /data/misc/perfd 0755 root system
159 chmod 2755 /data/misc/perfd
160 mkdir /data/system/perfd 0770 root system
161 rm /data/system/perfd/default_values
162 chmod 2770 /data/system/perfd
163 setprop ro.min_freq_0 384000
164 setprop ro.min_freq_4 384000
165
Zhihui Wu5dd2b472015-05-20 16:31:35 -0700166 # Create the directories used by CnE subsystem
167 mkdir /data/connectivity 0771 system system
168 chown system system /data/connectivity
169
170 #Create directory from IMS services
171 mkdir /data/shared 0755
172 chown system system /data/shared
173
Naveen Ramaraj4517b042015-07-29 20:02:42 -0700174 # Mark the copy complete flag to not completed
175 write /data/misc/radio/copy_complete 0
176 chown radio radio /data/misc/radio/copy_complete
177 chmod 0660 /data/misc/radio/copy_complete
Zhenhua Ma786d29b2015-06-04 13:22:50 +0800178
wang pingdc7ea962015-05-09 00:37:27 +0800179 # Configure bluetooth
180 chmod 0660 /proc/bluetooth/sleep/lpm
181 chmod 0660 /proc/bluetooth/sleep/btwrite
182 chmod 0660 /sys/class/rfkill/rfkill0/state
183 chmod 0660 /dev/ttyHS0
184 chown bluetooth net_bt_stack /proc/bluetooth/sleep/lpm
185 chown bluetooth net_bt_stack /proc/bluetooth/sleep/btwrite
186 chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state
187 chown bluetooth net_bt_stack /dev/ttyHS0
188
wang ping0684e522015-05-20 22:58:34 +0800189 # Create nfc local data
190 mkdir /data/nfc 0770 nfc nfc
191
zhaoyang yin2928a3c2015-06-04 20:00:12 +0800192 #modify access for speaker calibdata
193 chown system system /persist/audio/speaker_calibdata.bin
194 chmod 0444 /persist/audio/speaker_calibdata.bin
195
zhihui wu81580032015-07-27 17:19:25 -0700196 #modify access for laser calibration data
197 chmod 0710 /persist/data
198 chmod 0440 /persist/data/st_offset
199 chmod 0440 /persist/data/st_xtalk
200
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700201on charger
zhen yuanda5e00b2015-08-25 12:07:05 +0800202 #set cpu4,5 online first, or they can't get into low power consumption mode
203 write /sys/devices/system/cpu/cpu4/online 1
204 write /sys/devices/system/cpu/cpu5/online 1
Zhihui Wu13d03c62015-04-23 22:06:27 -0700205 #low power governing
zhen yuanf33b6422015-08-11 04:35:35 +0800206 write /sys/devices/soc.0/qcom,bcl.60/mode disable
207 write /sys/devices/soc.0/qcom,bcl.60/hotplug_mask 0
208 write /sys/devices/soc.0/qcom,bcl.60/hotplug_soc_mask 0
Zhihui Wu13d03c62015-04-23 22:06:27 -0700209 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
210 write /sys/devices/system/cpu/cpu1/online 0
211 write /sys/devices/system/cpu/cpu2/online 0
212 write /sys/devices/system/cpu/cpu3/online 0
213 write /sys/devices/system/cpu/cpu4/online 0
214 write /sys/devices/system/cpu/cpu5/online 0
215 write /sys/devices/system/cpu/cpu6/online 0
216 write /sys/devices/system/cpu/cpu7/online 0
217
Mekala Natarajan4f299632015-07-17 00:21:29 -0700218on property:sys.boot_completed=1
219 #allow CPUs to go in deeper idle state than C0
220 write /sys/module/lpm_levels/parameters/sleep_disabled 0
221
hongfengluo01109622015-08-26 23:42:39 +0800222# Search the laser device under /dev/input, then create symlink
223service InputEventFind /system/bin/InputEventFind
224 class main
225 oneshot
226
Zhenhua Ma739e45e2015-07-01 13:36:39 +0800227service ssr_setup /system/bin/ssr_setup
228 oneshot
229 disabled
230
231service ss_ramdump /system/bin/subsystem_ramdump
232 class main
233 user system
234 group system
235 disabled
236
237on property:persist.sys.ssr.restart_level=*
238 start ssr_setup
239
240on property:persist.sys.ssr.enable_ramdumps=1
241 write /sys/module/subsystem_restart/parameters/enable_ramdumps 1
242 start ss_ramdump
243
244on property:persist.sys.ssr.enable_ramdumps=0
245 write /sys/module/subsystem_restart/parameters/enable_ramdumps 0
246
Zhihui Wu13d03c62015-04-23 22:06:27 -0700247service charger /sbin/healthd -c
248 class charger
249 group log
250 seclabel u:r:healthd:s0
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700251
Naveen Ramaraj87018982015-04-24 21:10:40 -0700252service per_mgr /system/bin/pm-service
253 class core
254 user root
255 group system net_raw
256
257service per_proxy /system/bin/pm-proxy
258 class core
259 user root
260 group system net_raw
261 disabled
262
263service rmt_storage /system/bin/rmt_storage
264 class core
265 user root
dcashman6ac5c822015-08-14 11:43:14 -0700266 group system
Naveen Ramaraj87018982015-04-24 21:10:40 -0700267
Mekala Natarajaneb9c2a32015-04-27 11:01:22 -0700268service qseecomd /system/bin/qseecomd
269 class core
270 user root
271 group root
272
Naveen Ramaraj87018982015-04-24 21:10:40 -0700273service irsc_util /system/bin/irsc_util "/etc/sec_config"
274 class main
275 user root
276 oneshot
277
Naveen Ramaraj910680c2015-05-04 10:45:49 -0700278service thermal-engine /system/bin/thermal-engine
279 class main
280 user root
281 socket thermal-send-client stream 0660 system system
282 socket thermal-recv-client stream 0660 system system
283 socket thermal-recv-passive-client stream 0660 system system
dcashmana170fa32015-08-14 15:09:25 -0700284 group root radio
Naveen Ramaraj910680c2015-05-04 10:45:49 -0700285
Naveen Ramaraj87018982015-04-24 21:10:40 -0700286# QMUX must be in multiple groups to support external process connections
287service qmuxd /system/bin/qmuxd
288 class main
Tom Cherry858f6312015-06-05 11:07:58 -0700289 user radio
290 group radio audio bluetooth gps
Naveen Ramaraj87018982015-04-24 21:10:40 -0700291
Naveen Ramaraj84aa57d2015-06-11 18:37:03 -0700292service perfd /system/bin/perfd
293 class main
294 user root
295
Naveen Ramaraj87018982015-04-24 21:10:40 -0700296service netmgrd /system/bin/netmgrd
Ajay Dudani1faa3d32015-06-22 11:12:09 -0700297 class main
Naveen Ramaraj87018982015-04-24 21:10:40 -0700298 group radio
Naveen Ramaraj87018982015-04-24 21:10:40 -0700299
Zhihui Wu384b2222015-05-19 13:42:18 -0700300service qti /system/vendor/bin/qti
301 class main
302 user radio
303 group radio net_raw usb net_admin
Zhihui Wu384b2222015-05-19 13:42:18 -0700304
Naveen Ramaraj87018982015-04-24 21:10:40 -0700305service time_daemon /system/bin/time_daemon
306 class late_start
307 user root
308 group root
309
Mekala Natarajan19925592015-05-04 10:19:48 -0700310service loc_launcher /system/bin/loc_launcher
311 class late_start
312 group gps inet net_raw net_admin wifi
313
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700314# bugreport is triggered by holding down volume down, volume up and power
315service bugreport /system/bin/dumpstate -d -p -B \
316 -o /data/data/com.android.shell/files/bugreports/bugreport
317 class main
318 disabled
319 oneshot
320 keycodes 114 115 116
Zhihui Wu7055b3e2015-05-13 18:14:46 -0700321
322# start camera server as daemon
323service qcamerasvr /system/bin/mm-qcamera-daemon
324 class late_start
325 user camera
326 group camera system inet input graphics
Vineeta Srivastavaf6ab59a2015-05-20 17:29:44 -0700327
328service fingerprintd /system/bin/fingerprintd
329 class late_start
330 user system
lijianzhao72688d42015-06-26 22:12:13 -0700331 group input
wang pingd69321a2015-05-13 00:11:24 +0800332
333service p2p_supplicant /system/bin/wpa_supplicant \
334 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
335 -I/system/etc/wifi/p2p_supplicant_overlay.conf \
336 -O/data/misc/wifi/sockets \
337 -m/data/misc/wifi/p2p_supplicant.conf \
338 -puse_p2p_group_interface=1p2p_device=1 \
339 -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
340 class main
341 socket wpa_wlan0 dgram 660 wifi wifi
342 disabled
343 oneshot
344
345service wpa_supplicant /system/bin/wpa_supplicant \
346 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
347 -I/system/etc/wifi/wpa_supplicant_overlay.conf \
348 -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
349 class main
350 socket wpa_wlan0 dgram 660 wifi wifi
351 disabled
352 oneshot
353
354service dhcpcd_wlan0 /system/bin/dhcpcd -aABKL
355 class main
356 disabled
357 oneshot
358
359service dhcpcd_p2p /system/bin/dhcpcd -aABKL
360 class main
361 disabled
362 oneshot
363
364service iprenew_wlan0 /system/bin/dhcpcd -n
365 class main
366 disabled
367 oneshot
368
369service iprenew_p2p /system/bin/dhcpcd -n
370 class main
371 disabled
372 oneshot
Zhihui Wu5dd2b472015-05-20 16:31:35 -0700373
wang1f7df762015-06-19 18:14:47 +0800374service dhcpcd_bt-pan /system/bin/dhcpcd -BKLG
375 class main
376 disabled
377 oneshot
378
379service iprenew_bt-pan /system/bin/dhcpcd -n
380 class main
381 disabled
382 oneshot
383
Zhihui Wu5dd2b472015-05-20 16:31:35 -0700384service imsqmidaemon /system/bin/imsqmidaemon
385 class main
386 user system
387 socket ims_qmid stream 0660 system radio
388 group radio net_raw log diag
389
390service imsdatadaemon /system/bin/imsdatadaemon
391 class main
392 user system
393 socket ims_datad stream 0660 system radio
394 group system wifi radio inet net_raw log diag net_admin
395 disabled
396
397on property:sys.ims.QMI_DAEMON_STATUS=1
398 start imsdatadaemon
399
400service ims_rtp_daemon /system/bin/ims_rtp_daemon
401 class main
402 user system
403 socket ims_rtpd stream 0660 system radio
404 group radio net_raw diag diag log
405 disabled
406
407on property:sys.ims.DATA_DAEMON_STATUS=1
408 start ims_rtp_daemon
409
410service imscmservice /system/bin/imscmservice
411 class main
412 user system
413 group radio net_raw diag diag log
414
415service cnd /system/bin/cnd
416 class late_start
417 socket cnd stream 660 root inet
Patrick Tjin435a3eb2015-06-10 11:37:52 -0700418
wang ping04252d82015-06-10 22:55:51 -0700419on property:ro.boot.hardware.revision=ANGLER-V1
420 write /sys/module/bcmdhd/parameters/nvram_path \
421 /system/etc/wifi/bcmdhd-pme.cal
422
423on property:ro.boot.hardware.revision=ANGLER-V2
424 write /sys/module/bcmdhd/parameters/nvram_path \
425 /system/etc/wifi/bcmdhd-pme.cal
Zhenhua Ma786d29b2015-06-04 13:22:50 +0800426
wang ping9ee90202015-08-17 21:06:16 -0700427on property:ro.boot.wifi_cal=2
428 write /sys/module/bcmdhd/parameters/nvram_path \
429 /system/etc/wifi/bcmdhd-low.cal
430
431on property:ro.boot.wifi_cal=3
432 write /sys/module/bcmdhd/parameters/nvram_path \
433 /system/etc/wifi/bcmdhd-high.cal
434
Patrick Tjin299a3b82015-09-08 12:38:21 -0700435on property:ro.boot.hardware.sku=H1511
436 setprop ro.boot.wificountrycode US
437
dcashman717b6b62015-08-12 15:01:22 -0700438service mcfg-sh /system/bin/init.mcfg.sh
Zhenhua Ma786d29b2015-06-04 13:22:50 +0800439 class late_start
dcashman717b6b62015-08-12 15:01:22 -0700440 user radio
441 group radio system
Zhenhua Ma786d29b2015-06-04 13:22:50 +0800442 oneshot
renjie zhao0de37582015-06-05 14:22:37 +0800443
444service oem_qmi_server /vendor/bin/oem_qmi_server
renjie zhaob56cfa92015-07-23 11:17:05 +0800445 class main
renjie zhao0de37582015-06-05 14:22:37 +0800446 user root
renjie zhao56c62682015-08-26 14:17:19 -0400447 group system radio
Riley Andrewsa1399722015-06-22 15:53:18 -0700448
449service msm_irqbalance /system/bin/msm_irqbalance -f /system/etc/msm_irqbalance.conf
450 socket msm_irqbalance seqpacket 660 root system
451 class core
452 user root
453 group root
zhangmingzhenff53d442015-07-06 17:54:11 +0800454
455#start atfwd as daemon
456service atfwd /system/bin/ATFWD-daemon
457 class late_start
458 user system
459 group system radio
460
Naseer Ahmed1b0f56a2015-07-09 16:46:40 -0400461service ppd /system/bin/mm-pp-daemon
462 class late_start
463 user system
464 socket pps stream 0660 system system
465 group system graphics
466
467on property:init.svc.surfaceflinger=stopped
468 stop ppd
renjie zhao57797562015-07-18 11:58:58 +0800469
470service diag_test_server /vendor/bin/diag_test_server
471 class core
472 user root
473 disabled
474
475on property:ro.boot.mode=hw-factory
476 start diag_test_server
477