init.target.rc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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. #
  29. # Changes from Qualcomm Innovation Center are provided under the following license:
  30. # Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  31. #
  32. # Redistribution and use in source and binary forms, with or without
  33. # modification, are permitted (subject to the limitations in the
  34. # disclaimer below) provided that the following conditions are met:
  35. #
  36. # * Redistributions of source code must retain the above copyright
  37. # notice, this list of conditions and the following disclaimer.
  38. #
  39. # * Redistributions in binary form must reproduce the above
  40. # copyright notice, this list of conditions and the following
  41. # disclaimer in the documentation and/or other materials provided
  42. # with the distribution.
  43. #
  44. # * Neither the name of Qualcomm Innovation Center, Inc. nor the names of
  45. # its contributors may be used to endorse or promote products derived
  46. # from this software without specific prior written permission.
  47. #
  48. # NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
  49. # GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
  50. # HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
  51. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  52. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  53. # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  54. # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  55. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  56. # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  57. # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  58. # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  59. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  60. # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  61. import /vendor/etc/init/hw/init.qti.kernel.rc
  62. import /vendor/etc/init/hw/init.samsung.rc
  63. # CAUTION: init.carrier.rc is replaced with init.${ro.product.model}.rc from Q OS
  64. import /vendor/etc/init/hw/init.${ro.product.vendor.device}.rc
  65. import /vendor/etc/init/hw/init.${ro.product.vendor.name}.rc
  66. on early-init
  67. write /proc/sys/kernel/printk_devkmsg ratelimited
  68. export MEMTAG_OPTIONS off
  69. # foreground-boost
  70. mkdir /dev/cpuctl/foreground-boost
  71. chown system system /dev/cpuctl/foreground-boost
  72. chown system system /dev/cpuctl/foreground-boost/tasks
  73. chmod 0664 /dev/cpuctl/foreground-boost/tasks
  74. chown system system /dev/cpuctl/foreground-boost/cgroup.procs
  75. chmod 0664 /dev/cpuctl/foreground-boost/cgroup.procs
  76. # set property to boost-optimize
  77. setprop sys.perf.boostopt true
  78. # midground set
  79. mkdir /dev/cpuset/midground
  80. copy /dev/cpuset/cpus /dev/cpuset/midground/cpus
  81. copy /dev/cpuset/mems /dev/cpuset/midground/mems
  82. chown root system /dev/cpuset/midground/cgroup.procs
  83. chmod 0664 /dev/cpuset/midground/cgroup.procs
  84. chown root system /dev/cpuset/midground/cpus
  85. chmod 0664 /dev/cpuset/midground/cpus
  86. write /dev/cpuset/midground/cpus 0-1,5-6
  87. on init
  88. wait /dev/block/platform/soc/${ro.boot.bootdevice}
  89. symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
  90. chown system system /sys/devices/platform/soc/1d84000.ufshc/auto_hibern8
  91. chmod 0660 /sys/devices/platform/soc/1d84000.ufshc/auto_hibern8
  92. start logd
  93. mkdir /dev/cpuctl/general
  94. copy_per_line /dev/cpuctl/tasks /dev/cpuctl/general/tasks
  95. chown system system /dev/cpuctl/general
  96. chown system system /dev/cpuctl/general/tasks
  97. chmod 0644 /dev/cpuctl/general/tasks
  98. chown system system /dev/cpuctl/general/cpu.shares
  99. chmod 0644 /dev/cpuctl/general/cpu.shares
  100. mkdir /dev/cpuset/foreground-boost
  101. copy /dev/cpuset/cpus /dev/cpuset/foreground-boost/cpus
  102. copy /dev/cpuset/mems /dev/cpuset/foreground-boost/mems
  103. chown system system /dev/cpuset/foreground-boost
  104. chown system system /dev/cpuset/foreground-boost/tasks
  105. chmod 0664 /dev/cpuset/foreground-boost/tasks
  106. chown system system /dev/cpuset/foreground-boost/cgroup.procs
  107. chmod 0664 /dev/cpuset/foreground-boost/cgroup.procs
  108. chown system system /dev/cpuset/restricted/cpus
  109. chmod 0664 /dev/cpuset/restricted/cpus
  110. on early-fs
  111. start vold
  112. on fs
  113. start hwservicemanager
  114. mount_all /vendor/etc/fstab.qcom --early
  115. chown root system /mnt/vendor/persist
  116. chmod 0771 /mnt/vendor/persist
  117. restorecon_recursive /mnt/vendor/persist
  118. mkdir /mnt/vendor/persist/secnvm 0770 system system
  119. mkdir /mnt/vendor/persist/data 0700 system system
  120. on post-fs && property:ro.boot.factory.interposer=0
  121. # #Execute virtualization manager
  122. # enable vendor.qvirtservice_rs
  123. # start vendor.qvirtservice_rs
  124. # set RLIMIT_MEMLOCK to 64MB
  125. setrlimit 8 67108864 67108864
  126. #Execute virtualization manager
  127. enable vendor.qvirtservice
  128. start vendor.qvirtservice
  129. on late-fs
  130. wait_for_prop hwservicemanager.ready true
  131. #exec_start wait_for_keymaster
  132. mount_all /vendor/etc/fstab.qcom --late
  133. on post-fs-data
  134. mkdir /vendor/data/tombstones 0771 system system
  135. # Enable WLAN cold boot calibration
  136. write /sys/kernel/cnss/fs_ready 1
  137. on early-boot
  138. verity_update_state
  139. on boot
  140. write /dev/cpuset/audio-app/cpus 0-1
  141. # Add a cpuset for the camera daemon
  142. # We want all cores for camera
  143. mkdir /dev/cpuset/camera-daemon
  144. write /dev/cpuset/camera-daemon/cpus 0-7
  145. write /dev/cpuset/camera-daemon/mems 0
  146. chown cameraserver cameraserver /dev/cpuset/camera-daemon
  147. chown cameraserver cameraserver /dev/cpuset/camera-daemon/tasks
  148. chmod 0660 /dev/cpuset/camera-daemon/tasks
  149. chown system /sys/devices/platform/soc/990000.i2c/i2c-0/0-0038/trusted_touch_enable
  150. chmod 0660 /sys/devices/platform/soc/990000.i2c/i2c-0/0-0038/trusted_touch_enable
  151. chown system /sys/devices/platform/soc/990000.spi/spi_master/spi0/spi0.0/trusted_touch_enable
  152. chmod 0660 /sys/devices/platform/soc/990000.spi/spi_master/spi0/spi0.0/trusted_touch_enable
  153. chown system /sys/devices/system/cpu/hyp_core_ctl/enable
  154. chown system /sys/devices/system/cpu/hyp_core_ctl/hcc_min_freq
  155. # set cpuset value by performance team
  156. write /dev/cpuset/foreground/cpus 0-6
  157. write /dev/cpuset/foreground-boost/cpus 0-7
  158. write /dev/cpuset/sf/cpus 0-1,5-6
  159. # HyPer Permission
  160. chown root system /dev/cpuctl/top-app/cpu.uclamp.min
  161. chmod 0664 /dev/cpuctl/top-app/cpu.uclamp.min
  162. chown root system /sys/devices/system/cpu/bus_dcvs/DDR/memlat/adaptive_low_freq
  163. chmod 0664 /sys/devices/system/cpu/bus_dcvs/DDR/memlat/adaptive_low_freq
  164. chown root system /sys/devices/system/cpu/bus_dcvs/DDR/memlat/adaptive_high_freq
  165. chmod 0664 /sys/devices/system/cpu/bus_dcvs/DDR/memlat/adaptive_high_freq
  166. chown root system /sys/devices/system/cpu/bus_dcvs/DDR/soc:qcom,memlat:ddr:prime-latfloor/max_freq
  167. chmod 0664 /sys/devices/system/cpu/bus_dcvs/DDR/soc:qcom,memlat:ddr:prime-latfloor/max_freq
  168. # For CDSP crash
  169. on property:ro.boot.debug_level=0x494d
  170. setprop vendor.fastrpc.process.attrs 1
  171. setprop vendor.fastrpc.debug.trace 1
  172. on property:vendor.display.lcd_density=560
  173. setprop dalvik.vm.heapgrowthlimit 256m
  174. on property:vendor.display.lcd_density=640
  175. setprop dalvik.vm.heapgrowthlimit 512m
  176. on init && property:ro.boot.mode=charger
  177. wait_for_prop vendor.all.modules.ready 1
  178. mount_all /vendor/etc/charger_fw_fstab.qti --early
  179. wait /sys/kernel/boot_adsp/boot
  180. write /sys/kernel/boot_adsp/boot 1
  181. on charger
  182. start vendor.power_off_alarm
  183. write /sys/kernel/cnss/charger_mode 1
  184. #service vendor.lowi /vendor/bin/sscrpcd
  185. # class core
  186. # user system
  187. # group system wakelock
  188. # capabilities BLOCK_SUSPEND
  189. #pd-mapper
  190. service vendor.pd_mapper /vendor/bin/pd-mapper
  191. class core
  192. user system
  193. group system
  194. #Peripheral manager
  195. service vendor.per_mgr /vendor/bin/pm-service
  196. class core
  197. user system
  198. group system
  199. ioprio rt 4
  200. service vendor.per_proxy /vendor/bin/pm-proxy
  201. class core
  202. user system
  203. group system
  204. disabled
  205. #service vendor.mdm_helper /vendor/bin/mdm_helper
  206. # class core
  207. # group system wakelock
  208. # disabled
  209. service vendor.mdm_launcher /vendor/bin/sh /vendor/bin/init.mdm.sh
  210. class core
  211. oneshot
  212. on property:init.svc.vendor.per_mgr=running
  213. start vendor.per_proxy
  214. on property:sys.shutdown.requested=*
  215. write /sys/kernel/qcom_rproc/shutdown_in_progress 1
  216. stop vendor.per_proxy
  217. on property:vold.decrypt=trigger_restart_framework
  218. start vendor.cnss_diag
  219. service vendor.cnss_diag /system/vendor/bin/cnss_diag -q -f -t HELIUM
  220. class main
  221. user system
  222. group system wifi inet sdcard_rw media_rw diag
  223. oneshot
  224. on early-boot && property:persist.vendor.pcie.boot_option=*
  225. write /sys/bus/platform/devices/1c00000.qcom,pcie/debug/boot_option ${persist.vendor.pcie.boot_option}
  226. write /sys/bus/platform/devices/1c08000.qcom,pcie/debug/boot_option ${persist.vendor.pcie.boot_option}
  227. service fan_control_turn_on /vendor/bin/fan_service 1
  228. class late_start
  229. user root
  230. disabled
  231. oneshot
  232. service fan_control_turn_off /vendor/bin/fan_service 0
  233. class late_start
  234. user root
  235. disabled
  236. oneshot