Fixing Stock ROM Flashing
[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
28 on fs
29 wait /dev/block/platform/soc/${ro.boot.bootdevice}
30 symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
31 symlink /dev/block/bootdevice/by-name/oem_stanvbk /dev/block/bootdevice/by-name/oem_stanvbk_a
32 symlink /dev/block/bootdevice/by-name/oem_stanvbk /dev/block/bootdevice/by-name/oem_stanvbk_b
33 symlink /dev/block/bootdevice/by-name/oem_dycnvbk /dev/block/bootdevice/by-name/oem_dycnvbk_a
34 symlink /dev/block/bootdevice/by-name/oem_dycnvbk /dev/block/bootdevice/by-name/oem_dycnvbk_b
35 chmod 0660 /dev/qseecom
36 chown system drmrpc /dev/qseecom
37 chmod 0664 /dev/ion
38 chown system system /dev/ion
39 install_keyring
40
41 on early-fs
42 start vold
43
44 # Separate copy needed to use /sbin/linker64 instead of /system/bin/linker64
45 service sbinqseecomd /sbin/qseecomd
46 user root
47 group root
48 disabled
49 seclabel u:r:recovery:s0
50
51 service prepdecrypt /sbin/prepdecrypt.sh
52 oneshot
53 disabled
54 user root
55 group root
56 seclabel u:r:recovery:s0
57
58 service hwservicemanager /sbin/hwservicemanager
59 user root
60 group root
61 disabled
62 onrestart setprop hwservicemanager.ready false
63 seclabel u:r:recovery:s0
64
65 service boot-1-0 /sbin/android.hardware.boot@1.0-service
66 user root
67 group root
68 disabled
69 seclabel u:r:recovery:s0
70
71 service servicemanager /sbin/servicemanager
72 user root
73 group root readproc
74 disabled
75 seclabel u:r:recovery:s0
76
77 service keystore_auth /sbin/keystore_auth
78 oneshot
79 user system
80 group root
81 disabled
82 seclabel u:r:recovery:s0
83
84 # keystore is started and stopped on demand by TWRP
85 service keystore /sbin/keystore /tmp/misc/keystore
86 user root
87 group root drmrpc readproc
88 disabled
89 seclabel u:r:recovery:s0
90
91 service gatekeeper-1-0 /sbin/android.hardware.gatekeeper@1.0-service-qti
92 user root
93 group root
94 disabled
95 seclabel u:r:recovery:s0
96
97 service keymaster-4-0 /sbin/android.hardware.keymaster@4.0-service-qti
98 user root
99 group root
100 disabled
101 seclabel u:r:recovery:s0
102
103 service logd /sbin/logd
104 user root
105 group root
106 disabled
107 seclabel u:r:recovery:s0
108
109 service time_daemon /sbin/time_daemon
110 user root
111 group root
112 disabled
113 seclabel u:r:recovery:s0
114
115 # This helps fix ld.config.txt errors from the linker on Android 8.1+
116 service ldconfigtxt /sbin/touch /sbin/ld.config.txt
117 oneshot
118 seclabel u:r:recovery:s0
119
120 on boot
121 export LD_CONFIG_FILE /sbin/ld.config.txt
122 setprop sys.usb.config adb
123 write /proc/touchpanel/gesture_enable 1
124 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
125
126 on init
127 start logd
128 start hwservicemanager
129 start boot-1-0
130 start prepdecrypt
131 start time_daemon
132 setprop crypto.ready 1
133
134 on property:crypto.ready=0
135 stop sbinqseecomd
136 stop keymaster-4-0
137 stop gatekeeper-1-0
138 stop servicemanager
139
140 on property:crypto.ready=1
141 start sbinqseecomd
142
143 on property:vendor.sys.listeners.registered=true
144 start keymaster-4-0
145 start gatekeeper-1-0
146 start servicemanager
147 restart time_daemon
148
149 on property:sys.usb.config=mtp,adb
150 restart time_daemon