1# 2# Copyright (C) 2016 The Android Open-Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16 17import /vendor/etc/init/hw/init.${ro.boot.hardware.platform}.power.rc 18import /vendor/etc/init/hw/init.${ro.boot.hardware.platform}.usb.rc 19import /vendor/etc/init/hw/init.${ro.boot.hardware.platform}.diag.rc 20import /vendor/etc/init/hw/init.${ro.boot.hardware.platform}.logging.rc 21import /vendor/etc/init/hw/init.${ro.boot.hardware.platform}.mpssrfs.rc 22 23 24on property:init.svc.vendor.charger=running 25 # Lock to lowest freqency on charger mode 26 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor powersave 27 write /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor powersave 28 # keep one LITTLE and one big 29 write /sys/devices/system/cpu/cpu1/online 0 30 write /sys/devices/system/cpu/cpu2/online 0 31 write /sys/devices/system/cpu/cpu3/online 0 32 write /sys/devices/system/cpu/cpu4/online 0 33 write /sys/devices/system/cpu/cpu5/online 0 34 write /sys/devices/system/cpu/cpu7/online 0 35 wait /dev/block/bootdevice 36 write /sys/class/typec/port0/port_type sink 37 write /sys/module/lpm_levels/parameters/sleep_disabled 0 38 # Disable sched_boost 39 write /proc/sys/kernel/sched_boost 0 40 # Enable thermal mitigation 41 write /sys/devices/virtual/thermal/tz-by-name/backup-charge/mode enabled 42 43service vendor.charger /system/bin/charger 44 class charger 45 seclabel u:r:charger:s0 46 user system 47 group system wakelock input 48 capabilities SYS_BOOT 49 file /dev/kmsg w 50 file /sys/fs/pstore/console-ramoops-0 r 51 file /sys/fs/pstore/console-ramoops r 52 file /proc/last_kmsg r 53 54on early-init 55 mount debugfs debugfs /sys/kernel/debug 56 chmod 0755 /sys/kernel/debug 57 # Enable sched_boost 58 write /proc/sys/kernel/sched_boost 1 59 60# Skip init trigger for charger mode 61on early-init && property:ro.boot.mode=charger 62 setprop vendor.skip.init 1 63 64# We need vold early for metadata encryption 65on early-fs 66 start vold 67 68on init && property:vendor.skip.init=0 69 start logd 70 71 # QSEE rpmb listener need symlink for bootdevice 72 wait /dev/block/platform/soc/${ro.boot.bootdevice} 73 symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice 74 75 # start qseecomd early as we mount system/ vendor/ early 76 # vold needs keymaster that needs qseecomd 77 start vendor.qseecomd 78 start keymaster-4-0 79 80 # start Citadel keymaster (StrongBox) early 81 start vendor.citadeld 82 start vendor.keymaster-4-1-citadel 83 84 # Disable powersaving 85 write /sys/module/lpm_levels/parameters/sleep_disabled 1 86 87 # Loading kernel modules in background 88 start insmod_sh 89 90 # Support legacy paths 91 symlink /sdcard /mnt/sdcard 92 symlink /sdcard /storage/sdcard0 93 94 # bring back all cores 95 write /sys/devices/system/cpu/cpu0/online 1 96 write /sys/devices/system/cpu/cpu1/online 1 97 write /sys/devices/system/cpu/cpu2/online 1 98 write /sys/devices/system/cpu/cpu3/online 1 99 write /sys/devices/system/cpu/cpu4/online 1 100 write /sys/devices/system/cpu/cpu5/online 1 101 write /sys/devices/system/cpu/cpu6/online 1 102 write /sys/devices/system/cpu/cpu7/online 1 103 104 # configure governor settings for little cluster 105 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor schedutil 106 write /sys/devices/system/cpu/cpu0/cpufreq/schedutil/up_rate_limit_us 500 107 write /sys/devices/system/cpu/cpu0/cpufreq/schedutil/down_rate_limit_us 20000 108 109 # configure governor settings for big cluster 110 write /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor schedutil 111 write /sys/devices/system/cpu/cpu6/cpufreq/schedutil/up_rate_limit_us 500 112 write /sys/devices/system/cpu/cpu6/cpufreq/schedutil/down_rate_limit_us 20000 113 114 # set default schedTune value for foreground/top-app 115 write /dev/stune/foreground/schedtune.prefer_idle 1 116 write /dev/stune/top-app/schedtune.boost 10 117 write /dev/stune/top-app/schedtune.prefer_idle 1 118 119 mkdir /dev/cpuset/camera-daemon 120 write /dev/cpuset/camera-daemon/cpus 0-7 121 write /dev/cpuset/camera-daemon/mems 0 122 chown system system /dev/cpuset/camera-daemon 123 chown system system /dev/cpuset/camera-daemon/tasks 124 chmod 0664 /dev/cpuset/camera-daemon/tasks 125 126 # b/37682684 Enable suspend clock reporting 127 write /sys/kernel/debug/clk/debug_suspend 1 128 129 # ZRAM setup 130 write /sys/block/zram0/comp_algorithm lz4 131 write /proc/sys/vm/page-cluster 0 132 133 # Some user code relies on ro.boot.hardware.revision 134 setprop ro.boot.hardware.revision ${ro.revision} 135 136 # Thermal config file per product 137 setprop vendor.sys.qcom.thermalcfg /vendor/etc/thermal-engine-${ro.hardware}.conf 138 139 # Allow PAI targeting per hardware SKU 140 setprop ro.oem.key1 ${ro.boot.hardware.sku} 141 142 # Property used by vintf for sku specific manifests 143 setprop ro.boot.product.hardware.sku ${ro.boot.hardware.sku} 144 145 # Battery Defender 146 chown system system /sys/devices/platform/soc/soc:google,charger/charge_stop_level 147 chown system system /sys/devices/platform/soc/soc:google,charger/charge_start_level 148 chown system system /sys/devices/platform/soc/soc:google,charger/bd_drainto_soc 149 chown system system /sys/devices/platform/soc/soc:google,charger/bd_recharge_soc 150 chown system system /sys/devices/platform/soc/soc:google,charger/bd_recharge_voltage 151 chown system system /sys/devices/platform/soc/soc:google,charger/bd_resume_abs_temp 152 chown system system /sys/devices/platform/soc/soc:google,charger/bd_resume_soc 153 chown system system /sys/devices/platform/soc/soc:google,charger/bd_resume_temp 154 chown system system /sys/devices/platform/soc/soc:google,charger/bd_resume_time 155 chown system system /sys/devices/platform/soc/soc:google,charger/bd_trigger_temp 156 chown system system /sys/devices/platform/soc/soc:google,charger/bd_trigger_time 157 chown system system /sys/devices/platform/soc/soc:google,charger/bd_trigger_voltage 158 chown system system /sys/devices/platform/soc/soc:google,charger/bd_temp_enable 159 160on late-init 161 chown system system /sys/devices/virtual/thermal/tz-by-name/mb-therm-monitor/trip_point_0_temp 162 chown system system /sys/devices/virtual/thermal/tz-by-name/mb-therm-monitor/trip_point_0_hyst 163 chown system system /sys/devices/virtual/thermal/tz-by-name/usbc-therm-monitor/trip_point_0_temp 164 chown system system /sys/devices/virtual/thermal/tz-by-name/usbc-therm-monitor/trip_point_0_hyst 165 chown system system /sys/devices/virtual/thermal/tz-by-name/soc/mode 166 167on fs 168 mount_all /vendor/etc/fstab.${ro.boot.hardware.platform} --early 169 170 mkdir /mnt/vendor/persist/audio 0770 media audio 171 mkdir /mnt/vendor/persist/data 0700 system system 172 mkdir /mnt/vendor/persist/display 0770 system graphics 173 mkdir /mnt/vendor/persist/rfs 0770 root system 174 mkdir /mnt/vendor/persist/hlos_rfs 0770 root system 175 chmod 0770 /mnt/vendor/persist/rfs 176 chmod 0770 /mnt/vendor/persist/rfs/shared 177 chmod 0770 /mnt/vendor/persist/rfs/msm 178 chmod 0770 /mnt/vendor/persist/rfs/msm/adsp 179 chmod 0770 /mnt/vendor/persist/rfs/msm/mpss 180 chmod 0770 /mnt/vendor/persist/rfs/msm/slpi 181 chmod 0770 /mnt/vendor/persist/rfs/mdm 182 chmod 0770 /mnt/vendor/persist/rfs/mdm/adsp 183 chmod 0770 /mnt/vendor/persist/rfs/mdm/mpss 184 chmod 0770 /mnt/vendor/persist/rfs/mdm/slpi 185 chmod 0770 /mnt/vendor/persist/rfs/mdm/tn 186 chmod 0770 /mnt/vendor/persist/rfs/apq 187 chmod 0770 /mnt/vendor/persist/rfs/apq/gnss 188 chmod 0770 /mnt/vendor/persist/hlos_rfs 189 restorecon /mnt/vendor/persist/rfs 190 restorecon /mnt/vendor/persist/hlos_rfs 191 restorecon_recursive /mnt/vendor/persist/ 192 193 # for cycle count backup 194 mkdir /mnt/vendor/persist/battery 0700 system system 195 196on late-fs 197 # Start devices by sysfs trigger, including sensor related script. 198 start devstart_sh 199 200 # Start services for bootanim 201 start vendor.power-hal-1-3 202 start surfaceflinger 203 start bootanim 204 start vendor.hwcomposer-2-2 205 start vendor.configstore-hal 206 start vendor.qti.hardware.display.allocator 207 208 # Wait for hwservicemanager ready since fsck might be triggered in mount_all --late 209 # In such case, init won't responce the property_set from hwservicemanager and then 210 # cause services for bootanim not running. 211 wait_for_prop hwservicemanager.ready true 212 213 # Wait for keymaster HALs (TEE and StrongBox) 214 exec_start wait_for_strongbox 215 216 # Mount RW partitions which need run fsck 217 mount_all /vendor/etc/fstab.${ro.boot.hardware.platform} --late 218 219 # Required for time_daemon 220 mkdir /mnt/vendor/persist/time 0770 system system 221 222 # Start time daemon early so that the system time can be set early 223 start time_daemon 224 225on post-fs 226 # Disable sched autogroup 227 write /proc/sys/kernel/sched_autogroup_enabled 0 228 229 # set RLIMIT_MEMLOCK to 64MB 230 setrlimit 8 67108864 67108864 231 232 chmod 0664 /sys/devices/virtual/graphics/fb0/idle_time 233 chown system graphics /sys/devices/virtual/graphics/fb0/idle_time 234 write /sys/devices/virtual/graphics/fb0/idle_time 100 235 236 # turn off vblank irq immediately after turning off 237 write /sys/module/drm/parameters/vblankoffdelay -1 238 239on post-fs-data 240 # We can start netd here before in is launched in common init.rc on zygote-start 241 start netd 242 243 # b/38048356 Setup debug folders for camera 244 mkdir /data/vendor/camera 0770 camera camera 245 246 # b/38496103 Setup debug folders for display 247 mkdir /data/vendor/display 0770 system graphics 248 249 # Setup folder for modem fdr 250 mkdir /data/vendor/modem_fdr 0700 root system 251 252 # Resume-on-Reboot after we have the data dir and keymaster 253 mkdir /data/vendor/rebootescrow 0770 hsm hsm 254 start vendor.rebootescrow-citadel 255 256 # keep that at the end of on post-fs-data 257 # Set indication (checked by vold) that we have finished this action 258 setprop vold.post_fs_data_done 1 259 260 # Wait until the system time is set 261 wait_for_prop vendor.qcom.time.set true 262 263 # Wait qseecomd started 264 wait_for_prop vendor.sys.listeners.registered true 265 266 # load IPA FWs 267 # This must be started when vendor.sys.listeners.registered is true 268 start ipastart_sh 269 270# zygote need to be started after otapreopt which will be done on post-fs-data 271on zygote-start 272 # zygote is started in common init.rc 273 # and now we can continue initialize /data/ 274 mkdir /data/vendor/ipa 0770 radio radio 275 chown radio radio /data/vendor/ipa 276 277 # Create the directories used by the Wireless subsystem 278 mkdir /data/vendor/wifi 0771 wifi wifi 279 mkdir /data/vendor/wifi/wpa 0770 wifi wifi 280 mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi 281 282 # Mounting of persist is moved to 'on emmc-fs' and 'on fs' sections 283 # We chown/chmod /mnt/vendor/persist/ again so because mount is run as root + defaults 284 chown root system /mnt/vendor/persist/ 285 chmod 0771 /mnt/vendor/persist/ 286 287 # Trigger WLAN driver load 288 write /sys/kernel/boot_wlan/boot_wlan 1 289 290 #create netmgr log dir 291 mkdir /data/vendor/netmgr 0771 radio radio 292 chmod 0771 /data/vendor/netmgr 293 294 # Create netmgr recovery folder 295 mkdir /data/vendor/netmgr/recovery 0700 radio radio 296 chmod 0770 /data/vendor/netmgr/recovery 297 write /data/vendor/netmgr/recovery/recovery_info "" 298 chown radio radio /data/vendor/netmgr/recovery/recovery_info 299 300 # Create directory used by audio subsystem 301 mkdir /data/vendor/audio 0770 audio audio 302 303 # Create directory for audio delta files 304 mkdir /data/vendor/audio/acdbdata 0770 media audio 305 mkdir /data/vendor/audio/acdbdata/delta 0770 media audio 306 307 # Create directory for radio 308 mkdir /data/vendor/radio 0773 system radio 309 mkdir /data/vendor/modem_stat 0771 system radio 310 write /data/vendor/modem_stat/debug.txt "" 311 chown system radio /data/vendor/modem_stat/debug.txt 312 chmod 0664 /data/vendor/modem_stat/debug.txt 313 314 # Set up sensors-related directories and permissions 315 chmod 775 /mnt/vendor/persist/sensors 316 chmod 664 /mnt/vendor/persist/sensors/sensors_settings 317 chown root system /mnt/vendor/persist/sensors/registry 318 chmod 775 /mnt/vendor/persist/sensors/registry 319 chown root system /mnt/vendor/persist/sensors/registry/registry 320 chmod 775 /mnt/vendor/persist/sensors/registry/registry 321 322 chown system root /mnt/vendor/persist/sensors/sensors_settings 323 chown root root /mnt/vendor/persist/sensors/registry/registry/sensors_settings 324 325 mkdir /data/vendor/sensors 0770 326 chown system system /data/vendor/sensors 327 mkdir /data/vendor/sensors/log 0770 328 chown system system /data/vendor/sensors/log 329 330 chmod 770 /mnt/vendor/persist/audio 331 chmod 660 /mnt/vendor/persist/audio/audio.cal 332 chown media audio /mnt/vendor/persist/audio 333 chown audioserver audio /mnt/vendor/persist/audio/audio.cal 334 335 chmod 770 /mnt/vendor/persist/haptics 336 chmod 440 /mnt/vendor/persist/haptics/drv2624.cal 337 chown system system /mnt/vendor/persist/haptics 338 chown system system /mnt/vendor/persist/haptics/drv2624.cal 339 340 # Mark the copy complete flag to not completed 341 write /data/vendor/radio/copy_complete 0 342 chown radio radio /data/vendor/radio/copy_complete 343 chmod 0660 /data/vendor/radio/copy_complete 344 345 # File flags for prebuilt ril db file 346 write /data/vendor/radio/prebuilt_db_support 1 347 chown radio radio /data/vendor/radio/prebuilt_db_support 348 chmod 0400 /data/vendor/radio/prebuilt_db_support 349 write /data/vendor/radio/db_check_done 0 350 chown radio radio /data/vendor/radio/db_check_done 351 chmod 0660 /data/vendor/radio/db_check_done 352 353 # Create directories for Location services 354 mkdir /data/vendor/location 0770 gps gps 355 mkdir /data/vendor/location/mq 0770 gps gps 356 mkdir /data/vendor/location/xtwifi 0770 gps gps 357 mkdir /dev/socket/location 0770 gps gps 358 mkdir /dev/socket/location/mq 0770 gps gps 359 mkdir /dev/socket/location/xtra 0770 gps gps 360 361 # NFC local data and nfcee xml storage 362 mkdir /data/vendor/nfc 0770 nfc nfc 363 364 # Secure Element directory for loader service functionality 365 mkdir /data/vendor/secure_element 0770 secure_element secure_element 366 367on early-boot 368 # wait for devices 369 wait_for_prop vendor.qcom.devup 1 370 371 # wait for insmod_sh to finish all modules 372 wait_for_prop vendor.all.modules.ready 1 373 374 write /sys/kernel/boot_adsp/boot 1 375 write /sys/kernel/boot_cdsp/boot 1 376 377 # Update dm-verity state and set partition.*.verified properties 378 verity_update_state 379 380 # Permission for rainbow sensor 381 chown cameraserver camera /sys/devices/platform/soc/ac4a000.qcom,cci/ac4a000.qcom,cci:qcom,rainbow@20/rainbow_enable 382 chmod 0660 /sys/devices/platform/soc/ac4a000.qcom,cci/ac4a000.qcom,cci:qcom,rainbow@20/rainbow_enable 383 chown cameraserver camera /sys/devices/platform/soc/ac4a000.qcom,cci/ac4a000.qcom,cci:qcom,rainbow@20/rainbow_read_byte 384 chmod 0660 /sys/devices/platform/soc/ac4a000.qcom,cci/ac4a000.qcom,cci:qcom,rainbow@20/rainbow_read_byte 385 chown cameraserver camera /sys/devices/platform/soc/ac4a000.qcom,cci/ac4a000.qcom,cci:qcom,rainbow@20/rainbow_write_byte 386 chmod 0660 /sys/devices/platform/soc/ac4a000.qcom,cci/ac4a000.qcom,cci:qcom,rainbow@20/rainbow_write_byte 387 chown cameraserver camera /dev/vd6281 388 chmod 0660 /dev/vd6281 389 390 # Permission for Vibrator 391 chown system system /sys/class/leds/vibrator/device/mode 392 chown system system /sys/class/leds/vibrator/device/od_clamp 393 chown system system /sys/class/leds/vibrator/device/rtp_input 394 chown system system /sys/class/leds/vibrator/device/scale 395 chown system system /sys/class/leds/vibrator/device/set_sequencer 396 chown system system /sys/class/leds/vibrator/device/autocal_result 397 chown system system /sys/class/leds/vibrator/device/ctrl_loop 398 chown system system /sys/class/leds/vibrator/device/ol_lra_period 399 chown system system /sys/class/leds/vibrator/device/autocal 400 chown system system /sys/class/leds/vibrator/device/lp_trigger_effect 401 chown system system /sys/class/leds/vibrator/device/lra_wave_shape 402 403 # Permission for LED driver 404 chown system system /sys/class/leds/red/on_off_ms 405 chown system system /sys/class/leds/green/on_off_ms 406 chown system system /sys/class/leds/blue/on_off_ms 407 chown system system /sys/class/leds/red/rgb_start 408 chown system system /sys/class/leds/green/rgb_start 409 chown system system /sys/class/leds/blue/rgb_start 410 chown system system /sys/class/backlight/panel0-backlight/brightness 411 412 # Permission for Wireless charger 413 chown system system /sys/devices/platform/soc/a88000.i2c/i2c-0/0-0061/rxdata 414 chown system system /sys/devices/platform/soc/a88000.i2c/i2c-0/0-0061/txdata 415 chown system system /sys/devices/platform/soc/a88000.i2c/i2c-0/0-0061/txlen 416 chown system system /sys/devices/platform/soc/a88000.i2c/i2c-0/0-0061/ccreset 417 418 # Permission for Pixelstats 419 chown system system /sys/devices/platform/soc/7c4000.sdhci/mmc_host/mmc0/slowio_read_cnt 420 chown system system /sys/devices/platform/soc/7c4000.sdhci/mmc_host/mmc0/slowio_write_cnt 421 chown system system /sys/devices/platform/soc/7c4000.sdhci/mmc_host/mmc0/slowio_discard_cnt 422 chown system system /sys/devices/platform/soc/7c4000.sdhci/mmc_host/mmc0/slowio_flush_cnt 423 424 # Permission for Health Storage HAL 425 chown system system /sys/devices/platform/soc/7c4000.sdhci/manual_gc 426 427on boot 428 mkdir /dev/socket/qmux_radio 0770 radio radio 429 chmod 2770 /dev/socket/qmux_radio 430 mkdir /dev/socket/qmux_audio 0770 media audio 431 chmod 2770 /dev/socket/qmux_audio 432 mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth 433 chmod 2770 /dev/socket/qmux_bluetooth 434 mkdir /dev/socket/qmux_gps 0770 gps gps 435 chmod 2770 /dev/socket/qmux_gps 436 437 # Create NETMGR daemon socket area 438 mkdir /dev/socket/netmgr 0750 radio radio 439 440 setprop wifi.interface wlan0 441 442 # Assign TCP buffer thresholds to be ceiling value of technology maximums 443 # Increased technology maximums should be reflected here. 444 write /proc/sys/net/core/rmem_max 8388608 445 write /proc/sys/net/core/wmem_max 8388608 446 447 # Bluetooth 448 chown bluetooth net_bt /sys/class/rfkill/rfkill0/type 449 chown bluetooth net_bt /sys/class/rfkill/rfkill0/state 450 chmod 0660 /sys/class/rfkill/rfkill0/state 451 chown bluetooth net_bt /sys/class/rfkill/rfkill0/device/extldo 452 chmod 0660 /sys/class/rfkill/rfkill0/device/extldo 453 454 # Wifi firmware reload path 455 chown wifi wifi /sys/module/wlan/parameters/fwpath 456 457 # default country code 458 setprop ro.boot.wificountrycode 00 459 460 # WLAN debug access 461 chown system system /d/icnss/stats 462 463 # Default enable uicc_se 464 setprop persist.vendor.radio.uicc_se_enabled true 465 466service init-radio-sh /vendor/bin/init.radio.sh 467 class late_start 468 user radio 469 group root radio 470 oneshot 471 472service vendor.thermal-engine /vendor/bin/thermal-engine -c ${vendor.sys.qcom.thermalcfg} 473 class main 474 user root 475 group root system 476 socket thermal-send-client stream 0666 system system 477 socket thermal-recv-client stream 0660 system system 478 socket thermal-recv-passive-client stream 0666 system system 479 480on property:persist.vendor.sys.ssr.restart_level=* 481 start vendor.ssr_setup 482 483service vendor.ssr_setup /vendor/bin/ssr_setup 484 oneshot 485 disabled 486 487service vendor.ssr_diag /vendor/bin/ssr_diag 488 class late_start 489 user system 490 group system 491 disabled 492 493service vendor.per_mgr /vendor/bin/pm-service 494 class core 495 user system 496 group system 497 ioprio rt 4 498 499service vendor.per_proxy /vendor/bin/pm-proxy 500 class core 501 user system 502 group system 503 disabled 504 505on property:sys.boot_completed=1 506 # Set the default IRQ affinity to the silver cluster. 507 write /proc/irq/default_smp_affinity 3f 508 509 # Enable ZRAM on boot_complete 510 rm /data/unencrypted/zram_swap 511 swapon_all /vendor/etc/fstab.${ro.boot.hardware.platform} 512 write /proc/sys/vm/swappiness 100 513 514 # Setup final cpuset 515 write /dev/cpuset/top-app/cpus 0-7 516 write /dev/cpuset/foreground/cpus 0-5,7 517 write /dev/cpuset/background/cpus 4-5 518 write /dev/cpuset/system-background/cpus 2-5 519 write /dev/cpuset/restricted/cpus 2-5 520 521 # Setup final blkio 522 # value for group_idle is us 523 write /dev/blkio/blkio.weight 1000 524 write /dev/blkio/background/blkio.weight 200 525 write /dev/blkio/blkio.group_idle 2000 526 write /dev/blkio/background/blkio.group_idle 0 527 528 # QCOM FG SRAM dump for dumpstate 529 chown system system /d/fg/sram/data 530 chown system system /d/fg/sram/count 531 chown system system /d/fg/sram/address 532 533 # Dump QCOM FG cycle counts for dumpstate 534 chown system system /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-00/c440000.qcom,spmi:qcom,pm660@0:qpnp,fg/cycle_counts_bins 535 536 # HardwareInfo needs to be able to read CC bins 537 chmod 644 /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-00/c440000.qcom,spmi:qcom,pm660@0:qpnp,fg/cycle_counts_bins 538 539 # dumpstate needs to read, vendor.health-hal needs to be able to RW 540 chown system system /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-00/c440000.qcom,spmi:qcom,pm660@0:qpnp,fg/power_supply/bms/charge_full 541 542 # HardwareInfo needs to be able to read charge_full 543 chmod 644 /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-00/c440000.qcom,spmi:qcom,pm660@0:qpnp,fg/power_supply/bms/charge_full 544 545 # eMMC health 546 chmod 755 /sys/kernel/debug/mmc0 547 chmod 755 /sys/kernel/debug/mmc0/mmc0:0001 548 chmod 644 /sys/kernel/debug/mmc0/mmc0:0001/ext_csd 549 chmod 644 /sys/kernel/debug/mmc0/ring_buffer 550 chmod 644 /sys/kernel/debug/mmc0/err_stats 551 chmod 644 /sys/kernel/debug/mmc0/show_host 552 chmod 644 /sys/kernel/debug/mmc0/io_stats 553 chmod 644 /sys/kernel/debug/mmc0/req_stats 554 555 # Disable sched_boost 556 write /proc/sys/kernel/sched_boost 0 557 558 # Enable PowerHAL hint processing 559 setprop vendor.powerhal.init 1 560 561on property:init.svc.vendor.per_mgr=running 562 start vendor.per_proxy 563 564on property:sys.shutdown.requested=* 565 stop vendor.per_proxy 566 567service vendor.qseecomd /vendor/bin/qseecomd 568 class core 569 user root 570 group root 571 572service ss_ramdump /vendor/bin/subsystem_ramdump 573 class main 574 user root 575 group system 576 disabled 577 578on property:persist.vendor.sys.ssr.enable_ramdumps=1 579 write /sys/module/subsystem_restart/parameters/enable_ramdumps 1 580 mkdir /data/vendor/wifidump 771 root system 581 mkdir /data/vendor/ramdump 771 root system 582 mkdir /data/vendor/ssrdump 771 root system 583 mkdir /data/vendor/ssrlog 771 root system 584 start ss_ramdump 585 586on property:persist.vendor.sys.ssr.enable_ramdumps=0 587 write /sys/module/subsystem_restart/parameters/enable_ramdumps 0 588 589service adsprpcd /vendor/bin/adsprpcd rootpd 590 class main 591 user system 592 group system 593 594service cdsprpcd /vendor/bin/cdsprpcd 595 class main 596 user system 597 group system 598 599service adsprpcd_audiopd /vendor/bin/adsprpcd audiopd 600 class main 601 user media 602 group media 603 604service adsprpcd_sensorspd /vendor/bin/adsprpcd sensorspd 605 class main 606 user system 607 group system 608 609service irsc_util /vendor/bin/irsc_util "/vendor/etc/sec_config" 610 class core 611 user root 612 oneshot 613 614service vendor.rmt_storage /vendor/bin/rmt_storage 615 class core 616 user root 617 ioprio rt 0 618 shutdown critical 619 620service vendor.tftp_server /vendor/bin/tftp_server 621 class core 622 user root 623 group root system 624 625service modem_svc /vendor/bin/modem_svc -q 626 class core 627 user root 628 group system 629 capabilities NET_BIND_SERVICE 630 631service cnss-daemon /vendor/bin/cnss-daemon -n -l 632 class late_start 633 user system 634 group system inet wifi 635 636service imsqmidaemon /vendor/bin/imsqmidaemon 637 class main 638 user system 639 socket ims_qmid stream 0660 system radio 640 group radio log diag 641 642service imsdatadaemon /vendor/bin/imsdatadaemon 643 class main 644 user system 645 socket ims_datad stream 0660 system radio 646 group system wifi radio inet log 647 disabled 648 649on property:vendor.ims.QMI_DAEMON_STATUS=1 650 start imsdatadaemon 651 652service ims_rtp_daemon /vendor/bin/ims_rtp_daemon 653 class main 654 user system 655 group radio diag inet log 656 disabled 657 658service imsrcsservice /vendor/bin/imsrcsd 659 class main 660 user system 661 group radio diag inet log 662 disabled 663 664on property:vendor.ims.DATA_DAEMON_STATUS=1 665 start ims_rtp_daemon 666 start imsrcsservice 667 668service cnd /vendor/bin/cnd 669 class main 670 user radio 671 group system wifi inet radio wakelock 672 673service netmgrd /vendor/bin/netmgrd 674 class main 675 user root 676 group root wifi wakelock radio inet 677 678service port-bridge /vendor/bin/port-bridge 679 class main 680 user radio 681 group radio system inet 682 oneshot 683 684service ipacm /vendor/bin/ipacm 685 class main 686 user radio 687 group radio inet 688 689service qti /vendor/bin/qti 690 class main 691 user radio 692 group radio net_raw diag usb net_admin 693 694service loc_launcher /vendor/bin/loc_launcher 695 class late_start 696 group gps inet diag wifi 697 698service pd_mapper /vendor/bin/pd-mapper 699 class core 700 701# bugreport is triggered by holding down volume down, volume up and power 702service bugreport /system/bin/dumpstate -d -p -z 703 class main 704 disabled 705 oneshot 706 keycodes 114 115 116 707 708service devstart_sh /vendor/bin/init.qcom.devstart.sh 709 class main 710 user root 711 group root system 712 disabled 713 oneshot 714 715service vendor.wlan_sh /vendor/bin/init.qcom.wlan.sh 716 class main 717 user root 718 group root 719 disabled 720 oneshot 721 722service ipastart_sh /vendor/bin/init.qcom.ipastart.sh 723 class main 724 user system 725 group net_admin 726 disabled 727 oneshot 728 729service insmod_sh /vendor/bin/init.insmod.sh 730 class main 731 user root 732 group root system 733 disabled 734 oneshot 735 736service msm_irqbalance /vendor/bin/msm_irqbalance -f /vendor/etc/msm_irqbalance.conf 737 socket msm_irqbalance seqpacket 660 root system 738 class core 739 user root 740 group root 741 writepid /dev/cpuset/system-background/tasks 742 743service ppd /vendor/bin/mm-pp-dpps 744 class late_start 745 user graphics 746 group graphics 747 socket pps stream 0660 system system 748 disabled 749 750service wait_for_strongbox /vendor/bin/hw/wait_for_strongbox 751 user root 752 group root system 753 priority -20 754 ioprio rt 0 755 756on property:init.svc.vendor.hwcomposer-2-2=stopped 757 stop ppd 758 759on property:init.svc.vendor.hwcomposer-2-2=running 760 start ppd 761 762# b/70518189 vDSO experiments 763on property:sys.vdso=* 764 write /sys/module/vdso/parameters/enable_32 1 765 write /sys/module/vdso/parameters/enable_64 1 766 767on property:sys.vdso=false 768 write /sys/module/vdso/parameters/enable_32 0 769 write /sys/module/vdso/parameters/enable_64 0 770 771on property:sys.vdso=64 772 write /sys/module/vdso/parameters/enable_32 0 773 774on property:sys.vdso=32 775 write /sys/module/vdso/parameters/enable_64 0 776 777on property:wlan.driver.status=ok 778 # Get the wlan driver/fw version 779 start vendor.wlan_sh 780 781on property:ro.boot.mode=sota 782 setprop ro.boot.sota enabled 783 784on property:ro.boot.hardware.sku=G020D 785 start vendor.secure_element_hal_service_1_1 786on property:ro.boot.hardware.sku=G020H 787 start vendor.secure_element_hal_service_1_1 788 789# charger driver exposes now finer grain control, map demo mode to those properties 790# demo mode can only be exited by wiping data which will also reset the persist properties 791on property:sys.retaildemo.enabled=1 792 setprop persist.vendor.charge.stop.level 35 793 setprop persist.vendor.charge.start.level 30 794 795# For Japan radio builds, always enforce camera shutter sound 796# Since this property is read by the audio server in system service, 797# it should be written by the system init. 798on property:ro.boot.hardware.radio.subtype=0 799 setprop audio.camerasound.force true 800 801# Touch 802on property:vendor.all.modules.ready=1 803 wait /sys/devices/platform/soc/a84000.i2c/i2c-2/2-0020/input/input2/read_report 804 chown system system /sys/devices/platform/soc/a84000.i2c/i2c-2/2-0020/input/input2/read_report 805 chown system system /sys/devices/platform/soc/a84000.i2c/i2c-2/2-0020/input/input2/suspend 806 807# DSDS feature 808# Restart 1st qcrild after SIM config changed 809on property:vendor.radio.sim_num.switch=1to2 && property:persist.radio.multisim.config=dsds 810 restart vendor.qcrild 811 812on property:vendor.radio.sim_num.switch=2to1 && property:persist.radio.multisim.config= 813 restart vendor.qcrild 814 815# Enable 2nd qcrild when the property set to dsds 816on property:persist.radio.multisim.config=dsds 817 start vendor.qcrild2 818 819# Stop 2nd qcrild when the property set to empty string 820on property:persist.radio.multisim.config= 821 stop vendor.qcrild2 822 823on property:sys.boot_completed=1 && property:ro.boot.mode=firstboot 824 start init-firstboot-sh 825 826service init-firstboot-sh /vendor/bin/init.firstboot.sh 827 user nobody 828 disabled 829 oneshot 830 831# init-fingerprint-sh is for stopping fps_hal after init retry fail serval times 832# It keeps running until max init retry or fps_hal running successfully 833# vendor.fps_hal restarts until max init retry times 834# 835# /vendor/bin/init.fingerprint.sh [max_init_retry_times] 836service init-fingerprint-sh /vendor/bin/init.fingerprint.sh 10 837 group root 838 user root 839 disabled 840 oneshot 841 842on property:sys.boot_completed=1 843 start init-fingerprint-sh 844 845on property:vendor.fps.init.succeed=true && property:init.svc.vendor.fps_hal=stopped 846 start init-fingerprint-sh 847 848# Write the dark theme magic to /misc partition. 849service vendor.theme_set /vendor/bin/misc_writer --set-dark-theme 850 disabled 851 oneshot 852 853# Clear the dark theme magic in /misc partition. 854service vendor.theme_clear /vendor/bin/misc_writer --clear-dark-theme 855 disabled 856 oneshot 857 858# Set dark boot flag on dark mode (UiModeManager.MODE_NIGHT_YES == 2). 859on property:persist.sys.theme=2 860 start vendor.theme_set 861 862# Clear the dark boot flag on light mode (UiModeManager.MODE_NIGHT_NO == 1) or auto mode 863# (UiModeManager.MODE_NIGHT_AUTO == 0). 864on property:persist.sys.theme=1 865 start vendor.theme_clear 866 867on property:persist.sys.theme=0 868 start vendor.theme_clear 869 870on init && property:ro.boot.slot_successful=no 871 write /sys/module/msm_poweroff/parameters/warm_reset 1 872 873# Set or clear the warm reset flag upon the change of system property. The flag itself is set 874# by writing a sysfs file; and the file will be read by kernel. 875on property:ota.warm_reset=1 876 write /sys/module/msm_poweroff/parameters/warm_reset 1 877 878on property:ota.warm_reset=0 879 write /sys/module/msm_poweroff/parameters/warm_reset 0 880