init.target.rc 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. # Copyright (c) 2019-2021, 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
  5. # met:
  6. # * Redistributions of source code must retain the above copyright
  7. # notice, this list of conditions and the following disclaimer.
  8. # * Redistributions in binary form must reproduce the above
  9. # copyright notice, this list of conditions and the following
  10. # disclaimer in the documentation and/or other materials provided
  11. # with the distribution.
  12. # * Neither the name of The Linux Foundation nor the names of its
  13. # contributors may be used to endorse or promote products derived
  14. # from this software without specific prior written permission.
  15. #
  16. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
  17. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  18. # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
  19. # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
  20. # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  21. # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  22. # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  23. # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  24. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  25. # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  26. # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. #
  28. # Changes from Qualcomm Innovation Center are provided under the following
  29. # license:
  30. #
  31. # Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  32. #
  33. # Redistribution and use in source and binary forms, with or without
  34. # modification, are permitted (subject to the limitations in the
  35. # disclaimer below) provided that the following conditions are met:
  36. #
  37. # * Redistributions of source code must retain the above copyright
  38. # notice, this list of conditions and the following disclaimer.
  39. #
  40. # * Redistributions in binary form must reproduce the above
  41. # copyright notice, this list of conditions and the following
  42. # disclaimer in the documentation and/or other materials provided
  43. # with the distribution.
  44. #
  45. # * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
  46. # contributors may be used to endorse or promote products derived
  47. # from this software without specific prior written permission.
  48. #
  49. # NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
  50. # GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
  51. # HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
  52. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  53. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  54. # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  55. # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  56. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  57. # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  58. # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  59. # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  60. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  61. # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  62. #
  63. import /vendor/etc/init/hw/init.qti.kernel.rc
  64. on early-init
  65. write /proc/sys/kernel/printk_devkmsg ratelimited
  66. export MEMTAG_OPTIONS off
  67. on init
  68. wait /dev/block/platform/soc/${ro.boot.bootdevice}
  69. symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
  70. chown system system /sys/devices/platform/soc/1d84000.ufshc/auto_hibern8
  71. chmod 0660 /sys/devices/platform/soc/1d84000.ufshc/auto_hibern8
  72. start logd
  73. on early-fs
  74. start vold
  75. on fs
  76. start hwservicemanager
  77. mount_all /vendor/etc/fstab.qcom --early
  78. chown root system /mnt/vendor/persist
  79. chmod 0771 /mnt/vendor/persist
  80. restorecon_recursive /mnt/vendor/persist
  81. mkdir /mnt/vendor/persist/data 0700 system system
  82. on post-fs
  83. # set RLIMIT_MEMLOCK to 64MB
  84. setrlimit 8 67108864 67108864
  85. on late-fs
  86. wait_for_prop hwservicemanager.ready true
  87. #exec_start wait_for_keymaster
  88. mount_all /vendor/etc/fstab.qcom --late
  89. on post-fs-data
  90. mkdir /vendor/data/tombstones 0771 system system
  91. # Enable WLAN cold boot calibration
  92. write /sys/kernel/cnss/fs_ready 1
  93. on early-boot
  94. start vendor.sensors
  95. verity_update_state
  96. on boot
  97. write /dev/cpuset/audio-app/cpus 1-2
  98. # Add a cpuset for the camera daemon
  99. # We want all cores for camera
  100. mkdir /dev/cpuset/camera-daemon
  101. write /dev/cpuset/camera-daemon/cpus 0-7
  102. write /dev/cpuset/camera-daemon/mems 0
  103. chown cameraserver cameraserver /dev/cpuset/camera-daemon
  104. chown cameraserver cameraserver /dev/cpuset/camera-daemon/tasks
  105. chmod 0660 /dev/cpuset/camera-daemon/tasks
  106. chown system /sys/devices/platform/soc/990000.i2c/i2c-0/0-0038/trusted_touch_enable
  107. chmod 0660 /sys/devices/platform/soc/990000.i2c/i2c-0/0-0038/trusted_touch_enable
  108. chown system /sys/devices/platform/soc/990000.spi/spi_master/spi0/spi0.0/trusted_touch_enable
  109. chmod 0660 /sys/devices/platform/soc/990000.spi/spi_master/spi0/spi0.0/trusted_touch_enable
  110. chown system /sys/devices/platform/soc/980000.i2c/i2c-0/0-0062/trusted_touch_enable
  111. chmod 0660 /sys/devices/platform/soc/980000.i2c/i2c-0/0-0062/trusted_touch_enable
  112. chown system /sys/devices/platform/soc/980000.i2c/i2c-0/0-0062/trusted_touch_event
  113. chmod 0660 /sys/devices/platform/soc/980000.i2c/i2c-0/0-0062/trusted_touch_event
  114. chown system /sys/devices/system/cpu/hyp_core_ctl/enable
  115. chown system /sys/devices/system/cpu/hyp_core_ctl/hcc_min_freq
  116. #USB controller configuration
  117. setprop vendor.usb.controller a600000.dwc3
  118. on property:vendor.display.lcd_density=560
  119. setprop dalvik.vm.heapgrowthlimit 256m
  120. on property:vendor.display.lcd_density=640
  121. setprop dalvik.vm.heapgrowthlimit 512m
  122. on init && property:ro.boot.mode=charger
  123. wait_for_prop vendor.all.modules.ready 1
  124. mount_all /vendor/etc/charger_fw_fstab.qti --early
  125. wait /sys/kernel/boot_adsp/boot
  126. write /sys/kernel/boot_adsp/boot 1
  127. on charger
  128. start vendor.power_off_alarm
  129. setprop sys.usb.controller a600000.dwc3
  130. wait /sys/class/udc/${sys.usb.controller}
  131. setprop sys.usb.configfs 1
  132. write /sys/kernel/cnss/charger_mode 1
  133. #service vendor.lowi /vendor/bin/sscrpcd
  134. # class core
  135. # user system
  136. # group system wakelock
  137. # capabilities BLOCK_SUSPEND
  138. #pd-mapper
  139. service vendor.pd_mapper /vendor/bin/pd-mapper
  140. class core
  141. user system
  142. group system
  143. #Peripheral manager
  144. service vendor.per_mgr /vendor/bin/pm-service
  145. class core
  146. user system
  147. group system
  148. ioprio rt 4
  149. service vendor.per_proxy /vendor/bin/pm-proxy
  150. class core
  151. user system
  152. group system
  153. disabled
  154. service vendor.mdm_helper /vendor/bin/mdm_helper
  155. class core
  156. group system wakelock
  157. disabled
  158. service vendor.mdm_launcher /vendor/bin/sh /vendor/bin/init.mdm.sh
  159. class core
  160. oneshot
  161. on property:init.svc.vendor.per_mgr=running
  162. start vendor.per_proxy
  163. on property:sys.shutdown.requested=*
  164. write /sys/kernel/qcom_rproc/shutdown_in_progress 1
  165. stop vendor.per_proxy
  166. on property:vold.decrypt=trigger_restart_framework
  167. start vendor.cnss_diag
  168. service vendor.cnss_diag /system/vendor/bin/cnss_diag -q -f -t HELIUM
  169. class main
  170. user system
  171. group system wifi inet sdcard_rw media_rw diag
  172. oneshot
  173. on early-boot && property:persist.vendor.pcie.boot_option=*
  174. write /sys/bus/platform/devices/1c00000.qcom,pcie/debug/boot_option ${persist.vendor.pcie.boot_option}
  175. write /sys/bus/platform/devices/1c08000.qcom,pcie/debug/boot_option ${persist.vendor.pcie.boot_option}
  176. on property:sys.boot_completed=1
  177. enable vendor.qvirtmgr
  178. start vendor.qvirtmgr