init.xiaomi_sm8450.rc 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. #
  2. # Copyright (C) 2024 The LineageOS Project
  3. #
  4. # SPDX-License-Identifier: Apache-2.0
  5. #
  6. import /vendor/etc/init/hw/init.mi_thermald.rc
  7. import /vendor/etc/init/hw/init.batterysecret.rc
  8. on fs
  9. mkdir /mnt/vendor/persist/haptics 0755 system system
  10. mkdir /mnt/vendor/persist/audio 0755 system system
  11. mkdir /mnt/vendor/persist/qca6490/ 0700 system system
  12. on boot
  13. # modem
  14. chmod 0777 /dev/smd8
  15. chown radio radio /dev/smd8
  16. mkdir /data/vendor/modem 0777 radio radio
  17. chown system system /sys/class/thermal/thermal_message/sconfig
  18. chown system system /sys/class/thermal/thermal_message/charger_temp
  19. chown system system /sys/class/thermal/thermal_message/board_sensor_temp_comp
  20. chown system system /sys/class/thermal/thermal_message/cpu_nolimit_temp
  21. chown system system /sys/class/thermal/thermal_message/balance_mode
  22. chown cameraserver cameraserver /sys/class/thermal/thermal_message/flash_state
  23. chown system system /sys/module/perf_helper/mimd/mimdtrigger
  24. # Create persist for camera calibration data
  25. mkdir /mnt/vendor/persist/camera 0755 system cameraserver
  26. # Set fingerprint related permissions
  27. chmod 0660 /dev/goodix_fp
  28. chown system system /dev/goodix_fp
  29. chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/irq
  30. chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/irq_enable
  31. chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/wakeup_enable
  32. chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/hw_reset
  33. chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/device_prepare
  34. chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/fingerdown_wait
  35. chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/vendor
  36. chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/request_vreg
  37. chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/simulate_irq
  38. chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/finger_irq
  39. chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/power_cfg
  40. # Xiaomi touch
  41. chown system system /dev/xiaomi-touch
  42. chmod 0660 /dev/xiaomi-touch
  43. # Touchscreen sensors
  44. chown system system /sys/class/touch/touch_dev/fod_finger_state
  45. chown system system /sys/class/touch/touch_dev/fod_longpress_gesture_enabled
  46. chown system system /sys/class/touch/touch_dev/fod_press_status
  47. chmod 0660 /sys/class/touch/touch_dev/fod_finger_state
  48. chmod 0660 /sys/class/touch/touch_dev/fod_longpress_gesture_enabled
  49. chmod 0660 /sys/class/touch/touch_dev/fod_press_status
  50. chown system system /sys/class/touch/touch_dev/gesture_single_tap_enabled
  51. chown system system /sys/class/touch/touch_dev/gesture_single_tap_state
  52. chmod 0660 /sys/class/touch/touch_dev/gesture_single_tap_enabled
  53. chmod 0660 /sys/class/touch/touch_dev/gesture_single_tap_state
  54. chown system system /sys/class/touch/touch_dev/gesture_double_tap_enabled
  55. chown system system /sys/class/touch/touch_dev/gesture_double_tap_state
  56. chmod 0660 /sys/class/touch/touch_dev/gesture_double_tap_enabled
  57. chmod 0660 /sys/class/touch/touch_dev/gesture_double_tap_state
  58. # High touch polling rate
  59. chown system system /sys/devices/virtual/touch/touch_dev/bump_sample_rate
  60. chmod 0660 /sys/devices/virtual/touch/touch_dev/bump_sample_rate
  61. on post-fs-data
  62. # Create folder of camera
  63. mkdir /data/vendor/camera/offlinelog 0777 cameraserver audio
  64. chmod 0666 /dev/camlog
  65. # Create the directories used by the Wireless subsystem
  66. mkdir /data/vendor/mac_addr 0770 system wifi
  67. mkdir /data/vendor/thermal 0771 root system
  68. mkdir /data/vendor/thermal/config 0771 root system
  69. mkdir /data/vendor/perfspy 0775 camera camera
  70. chmod 0660 /dev/ir_spi
  71. chown system system /dev/ir_spi
  72. # Display feature sysfs node
  73. chown system system /sys/class/mi_display/disp-DSI-0/disp_param
  74. chmod 0664 /sys/class/mi_display/disp-DSI-0/disp_param
  75. chown system system /sys/class/mi_display/disp-DSI-0/mipi_rw
  76. chmod 0664 /sys/class/mi_display/disp-DSI-0/mipi_rw
  77. chown system system /sys/class/mi_display/disp-DSI-0/panel_info
  78. chmod 0444 /sys/class/mi_display/disp-DSI-0/panel_info
  79. chown system system /sys/class/mi_display/disp-DSI-0/wp_info
  80. chmod 0444 /sys/class/mi_display/disp-DSI-0/wp_info
  81. chown system system /sys/class/mi_display/disp-DSI-0/dynamic_fps
  82. chmod 0444 /sys/class/mi_display/disp-DSI-0/dynamic_fps
  83. chown system system /sys/class/mi_display/disp-DSI-0/doze_brightness
  84. chmod 0664 /sys/class/mi_display/disp-DSI-0/doze_brightness
  85. chown system system /sys/class/mi_display/disp-DSI-0/brightness_clone
  86. chmod 0664 /sys/class/mi_display/disp-DSI-0/brightness_clone
  87. chown system system /sys/class/mi_display/disp-DSI-0/max_brightness_clone
  88. chmod 0664 /sys/class/mi_display/disp-DSI-0/max_brightness_clone
  89. # Display feature sysfs node for penel1
  90. chown system system /sys/class/mi_display/disp-DSI-1/brightness_clone
  91. chmod 0664 /sys/class/mi_display/disp-DSI-1/brightness_clone
  92. chown system system /sys/class/mi_display/disp-DSI-1/max_brightness_clone
  93. chmod 0664 /sys/class/mi_display/disp-DSI-1/max_brightness_clone
  94. # Create fingerprint related directories
  95. mkdir /data/vendor/fpc 0770 system system
  96. mkdir /data/vendor/fpdump 0770 system system
  97. mkdir /data/vendor/goodix 0770 system system
  98. mkdir /mnt/vendor/persist/fpc 0770 system system
  99. mkdir /mnt/vendor/persist/goodix 0770 system system
  100. on property:sys.boot_completed=1
  101. # Set thermal mode to mgame
  102. write /sys/devices/virtual/thermal/thermal_message/sconfig 20
  103. on property:persist.sys.xtra-daemon.enabled=*
  104. restart loc_launcher
  105. service vendor.nv_mac /vendor/bin/nv_mac
  106. class late_start
  107. user system
  108. group system inet net_admin wifi net_raw
  109. oneshot
  110. service vendor.audio-hal /vendor/bin/hw/android.hardware.audio.service
  111. override
  112. class hal
  113. user audioserver
  114. # media gid needed for /dev/fm (radio) and for /data/misc/media (tee)
  115. group audio camera drmrpc inet media mediadrm net_bt net_bt_admin net_bw_acct oem_2901 wakelock context_hub
  116. capabilities BLOCK_SUSPEND SYS_NICE
  117. # setting RLIMIT_RTPRIO allows binder RT priority inheritance
  118. rlimit rtprio 10 10
  119. ioprio rt 4
  120. task_profiles ProcessCapacityHigh HighPerformance
  121. onrestart restart audioserver
  122. socket audio_us_socket_0 seqpacket 0666 system system
  123. service vendor.sensors-hal-multihal /vendor/bin/hw/android.hardware.sensors-service.xiaomi-multihal
  124. override
  125. class hal
  126. user system
  127. group system wakelock context_hub input uhid
  128. task_profiles ServiceCapacityLow
  129. capabilities BLOCK_SUSPEND
  130. rlimit rtprio 10 10
  131. socket audio_us_socket_1 seqpacket 0666 system system
  132. on property:ro.boot.hwversion=*
  133. setprop ro.boot.hardware.revision ${ro.boot.hwc}_${ro.boot.hwlevel}_${ro.boot.hwversion}