Add some blu init changes
[GitHub/moto-9609/twrp_device_motorola_troika.git] / recovery / root / init.recovery.qcom.rc
1 # Copyright (c) 2009-2012, 2014-2015, The Linux Foundation. All rights reserved.
2 #
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are met:
5 # * Redistributions of source code must retain the above copyright
6 # notice, this list of conditions and the following disclaimer.
7 # * Redistributions in binary form must reproduce the above copyright
8 # notice, this list of conditions and the following disclaimer in the
9 # documentation and/or other materials provided with the distribution.
10 # * Neither the name of The Linux Foundation nor
11 # the names of its contributors may be used to endorse or promote
12 # products derived from this software without specific prior written
13 # permission.
14 #
15 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 #
27 import /init.blu_spark.rc
28
29 on fs
30 wait /dev/block/platform/soc/${ro.boot.bootdevice}
31 symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
32 symlink /dev/block/bootdevice/by-name/oem_stanvbk /dev/block/bootdevice/by-name/oem_stanvbk_a
33 symlink /dev/block/bootdevice/by-name/oem_stanvbk /dev/block/bootdevice/by-name/oem_stanvbk_b
34 chmod 0660 /dev/qseecom
35 chown system drmrpc /dev/qseecom
36 chmod 0664 /dev/ion
37 chown system system /dev/ion
38 install_keyring
39
40 # Separate copy needed to use /sbin/linker64 instead of /system/bin/linker64
41 service sbinqseecomd /sbin/qseecomd
42 user root
43 group root
44 disabled
45 seclabel u:r:recovery:s0
46
47 service prepdecrypt /sbin/prepdecrypt.sh
48 oneshot
49 disabled
50 user root
51 group root
52 seclabel u:r:recovery:s0
53
54 service hwservicemanager /sbin/hwservicemanager
55 user root
56 group root
57 disabled
58 onrestart setprop hwservicemanager.ready false
59 seclabel u:r:recovery:s0
60
61 service boot-1-0 /sbin/android.hardware.boot@1.0-service
62 user root
63 group root
64 disabled
65 seclabel u:r:recovery:s0
66
67 service servicemanager /sbin/servicemanager
68 user root
69 group root readproc
70 disabled
71 seclabel u:r:recovery:s0
72
73 service keystore_auth /sbin/keystore_auth
74 oneshot
75 user system
76 group root
77 disabled
78 seclabel u:r:recovery:s0
79
80 # keystore is started and stopped on demand by TWRP
81 service keystore /sbin/keystore /tmp/misc/keystore
82 user root
83 group root drmrpc readproc
84 disabled
85 seclabel u:r:recovery:s0
86
87 service gatekeeper-1-0 /sbin/android.hardware.gatekeeper@1.0-service-qti
88 user root
89 group root
90 disabled
91 seclabel u:r:recovery:s0
92
93 service keymaster-3-0 /sbin/android.hardware.keymaster@3.0-service-qti
94 user root
95 group root
96 disabled
97 seclabel u:r:recovery:s0
98
99 on boot
100 setprop sys.usb.config adb
101 write /proc/touchpanel/gesture_enable 1
102 write /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pmi8998@2:qcom,qpnp-smb2/power_supply/usb/otg_switch 1
103
104 on init
105 start hwservicemanager
106 start boot-1-0
107 start prepdecrypt
108 #setprop crypto.ready 1
109
110 on property:crypto.ready=0
111 stop sbinqseecomd
112 stop keymaster-3-0
113 stop gatekeeper-1-0
114 stop servicemanager
115
116 on property:crypto.ready=1
117 start sbinqseecomd
118
119 on property:sys.listeners.registered=true
120 start keymaster-3-0
121 start gatekeeper-1-0
122 start servicemanager