303 lines
11 KiB
Plaintext
303 lines
11 KiB
Plaintext
# Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
|
|
#
|
|
# Redistribution and use in source and binary forms, with or without
|
|
# modification, are permitted provided that the following conditions are
|
|
# met:
|
|
# * Redistributions of source code must retain the above copyright
|
|
# notice, this list of conditions and the following disclaimer.
|
|
# * Redistributions in binary form must reproduce the above
|
|
# copyright notice, this list of conditions and the following
|
|
# disclaimer in the documentation and/or other materials provided
|
|
# with the distribution.
|
|
# * Neither the name of The Linux Foundation nor the names of its
|
|
# contributors may be used to endorse or promote products derived
|
|
# from this software without specific prior written permission.
|
|
#
|
|
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
|
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
#
|
|
#
|
|
|
|
on early-init
|
|
# Disable EAS
|
|
write /proc/sys/kernel/sched_energy_aware 0
|
|
|
|
on init
|
|
write /sys/module/qpnp_rtc/parameters/poweron_alarm 1
|
|
wait /dev/block/platform/soc/1d84000.ufshc
|
|
symlink /dev/block/platform/soc/1d84000.ufshc /dev/block/bootdevice
|
|
|
|
# Boot time fs tuning
|
|
write /sys/block/sda/queue/iostats 0
|
|
write /sys/block/sda/queue/scheduler cfq
|
|
write /sys/block/sda/queue/iosched/slice_idle 0
|
|
write /sys/block/sda/queue/nr_requests 256
|
|
write /dev/sys/fs/by-name/userdata/data_io_flag 56
|
|
write /dev/sys/fs/by-name/userdata/node_io_flag 56
|
|
|
|
# Report max frequency to unity tasks
|
|
write /proc/sys/kernel/sched_lib_name "com.miHoYo.,libunity.so,libfb.so"
|
|
write /proc/sys/kernel/sched_lib_mask_force 255
|
|
|
|
# ZRAM setup
|
|
write /sys/block/zram0/comp_algorithm lz4
|
|
write /proc/sys/vm/page-cluster 0
|
|
|
|
# Configure governor settings for little cluster
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor schedutil
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/schedutil/up_rate_limit_us 500
|
|
write /sys/devices/system/cpu/cpu0/cpufreq/schedutil/down_rate_limit_us 20000
|
|
|
|
# Configure governor settings for big cluster
|
|
write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor schedutil
|
|
write /sys/devices/system/cpu/cpu4/cpufreq/schedutil/up_rate_limit_us 500
|
|
write /sys/devices/system/cpu/cpu4/cpufreq/schedutil/down_rate_limit_us 20000
|
|
|
|
# Configure governor settings for big big CPU
|
|
write /sys/devices/system/cpu/cpu7/cpufreq/scaling_governor schedutil
|
|
write /sys/devices/system/cpu/cpu7/cpufreq/schedutil/up_rate_limit_us 500
|
|
write /sys/devices/system/cpu/cpu7/cpufreq/schedutil/down_rate_limit_us 20000
|
|
|
|
# Boot time uclamp tuning
|
|
write /dev/cpuctl/top-app/cpu.uclamp.min 15
|
|
write /dev/cpuctl/foreground/cpu.uclamp.min 15
|
|
write /dev/cpuctl/system/cpu.uclamp.min 15
|
|
write /dev/cpuctl/nnapi-hal/cpu.uclamp_min 50
|
|
|
|
# RT uclamp setting
|
|
setprop kernel.sched_util_clamp_min_rt_default 0
|
|
write /proc/sys/kernel/sched_util_clamp_min_rt_default 0
|
|
|
|
# Migrate cpuctl tasks once to cpuctl system
|
|
copy_per_line /dev/cpuctl/tasks /dev/cpuctl/system/tasks
|
|
|
|
on late-init
|
|
chown system system /sys/devices/virtual/thermal/tz-by-name/sdm-therm-monitor/trip_point_0_temp
|
|
chown system system /sys/devices/virtual/thermal/tz-by-name/sdm-therm-monitor/trip_point_0_hyst
|
|
chown system system /sys/devices/virtual/thermal/tz-by-name/usbc-therm-monitor/trip_point_0_temp
|
|
chown system system /sys/devices/virtual/thermal/tz-by-name/usbc-therm-monitor/trip_point_0_hyst
|
|
chown system system /sys/devices/virtual/thermal/tz-by-name/soc/mode
|
|
chown system system /sys/devices/virtual/thermal/tz-by-name/bcl-virt-monitor/trip_point_0_temp
|
|
chown system system /sys/devices/virtual/thermal/tz-by-name/bcl-virt-monitor/trip_point_0_hyst
|
|
|
|
on early-fs
|
|
start vold
|
|
|
|
# Create a cpuset for camera-specific processes
|
|
mkdir /dev/cpuset/camera-daemon
|
|
write /dev/cpuset/camera-daemon/cpus 0-7
|
|
write /dev/cpuset/camera-daemon/mems 0
|
|
chown system system /dev/cpuset/camera-daemon
|
|
chown system system /dev/cpuset/camera-daemon/tasks
|
|
chmod 0664 /dev/cpuset/camera-daemon/tasks
|
|
|
|
on fs
|
|
start hwservicemanager
|
|
chown media audio /mnt/vendor/persist/audio
|
|
mount_all /vendor/etc/fstab.qcom --early
|
|
chown root system /mnt/vendor/persist
|
|
chmod 0771 /mnt/vendor/persist
|
|
restorecon_recursive /mnt/vendor/persist
|
|
mkdir /mnt/vendor/persist/data 0700 system system
|
|
|
|
on post-fs
|
|
# set RLIMIT_MEMLOCK to 64MB
|
|
setrlimit 8 67108864 67108864
|
|
|
|
start vendor.spdaemon
|
|
start vendor.sec_nvm
|
|
|
|
mkdir /mnt/vendor/dsp 0770 root root
|
|
copy /vendor/dsp/cdsp/fastrpc_shell_3 /mnt/vendor/dsp/fastrpc_shell_3
|
|
chmod 0644 /mnt/vendor/dsp/fastrpc_shell_3
|
|
mount none /mnt/vendor/dsp/fastrpc_shell_3 /vendor/dsp/cdsp/fastrpc_shell_3 bind
|
|
|
|
on late-fs
|
|
mount_all /vendor/etc/fstab.qcom --late
|
|
|
|
on post-fs-data
|
|
mkdir /vendor/data/tombstones 0771 system system
|
|
mkdir /tombstones/modem 0771 system system
|
|
mkdir /tombstones/lpass 0771 system system
|
|
mkdir /tombstones/wcnss 0771 system system
|
|
mkdir /tombstones/dsps 0771 system system
|
|
mkdir /data/vendor/hbtp 0750 system system
|
|
mkdir /data/vendor/nnhal 0700 system system
|
|
mkdir /data/vendor/nfc 0770 nfc nfc
|
|
|
|
on early-boot
|
|
start vendor.sensors
|
|
|
|
chown system system /sys/class/leds/vibrator/vmax_mv
|
|
chmod 0600 /sys/class/leds/vibrator/vmax_mv
|
|
|
|
# For cpusets initialize for Silver Only first and then Silver + Gold
|
|
# Silver Only configuration cannot work with 0-7
|
|
on boot
|
|
chown system system /sys/kernel/hbtp/display_pwr
|
|
chown system system /sys/kernel/qvr_external_sensor/fd
|
|
start rmt_storage
|
|
start rfs_access
|
|
write /dev/cpuset/audio-app/cpus 0-3
|
|
write /dev/cpuset/display/cpus 4-6
|
|
write /dev/cpuset/foreground/cpus 0-6
|
|
write /dev/cpuset/foreground/boost/cpus 0-6
|
|
write /dev/cpuset/background/cpus 0-1
|
|
write /dev/cpuset/system-background/cpus 0-2
|
|
write /dev/cpuset/top-app/cpus 0-7
|
|
|
|
#USB controller configuration
|
|
setprop vendor.usb.rndis.func.name "gsi"
|
|
setprop vendor.usb.rmnet.func.name "gsi"
|
|
setprop vendor.usb.rmnet.inst.name "rmnet"
|
|
setprop vendor.usb.dpl.inst.name "dpl"
|
|
setprop vendor.usb.qdss.inst.name "qdss"
|
|
setprop vendor.usb.controller a600000.dwc3
|
|
|
|
on boot && property:persist.vendor.usb.controller.default=*
|
|
setprop vendor.usb.controller ${persist.vendor.usb.controller.default}
|
|
|
|
on property:sys.boot_completed=1
|
|
# STOP EATING MY BATTERY AFTER 100H OF UPTIME FUCK YOU
|
|
stop statsd
|
|
|
|
# Setup final cpu.uclamp.min
|
|
write /dev/cpuctl/top-app/cpu.uclamp.min 0
|
|
write /dev/cpuctl/foreground/cpu.uclamp.min 10
|
|
write /dev/cpuctl/system/cpu.uclamp.min 0
|
|
|
|
# Set uclamp.max for some groups, which could indicate cpu importance used in scheduling
|
|
write /dev/cpuctl/background/cpu.uclamp.min 20
|
|
write /dev/cpuctl/system-background/cpu.uclamp.max 40
|
|
write /dev/cpuctl/dex2oat/cpu.uclamp.max 60
|
|
write /dev/cpuctl/camera-daemon/cpu.uclamp.min 50
|
|
write /dev/cpuctl/camera-daemon/cpu.uclamp.latency_sensitive 1
|
|
|
|
# Migrate tasks again in case kernel threads are created during boot
|
|
copy_per_line /dev/cpuctl/tasks /dev/cpuctl/system/tasks
|
|
|
|
# Enable ZRAM on boot_complete
|
|
rm /data/unencrypted/zram_swap
|
|
swapon_all /vendor/etc/fstab.zram
|
|
write /proc/sys/vm/swappiness 100
|
|
|
|
# Runtime fs tuning
|
|
write /sys/block/sda/queue/nr_requests 128
|
|
write /dev/sys/fs/by-name/userdata/data_io_flag 8
|
|
write /dev/sys/fs/by-name/userdata/node_io_flag 8
|
|
|
|
# Back to default VM settings
|
|
write /proc/sys/vm/dirty_expire_centisecs 3000
|
|
write /proc/sys/vm/dirty_background_ratio 10
|
|
|
|
# Setup cpu.shares to throttle background groups (bg ~ 5% sysbg ~ 10%)
|
|
write /dev/cpuctl/background/cpu.shares 1024
|
|
write /dev/cpuctl/system-background/cpu.shares 2048
|
|
write /dev/cpuctl/system/cpu.shares 20480
|
|
# We only have system and background groups holding tasks and the groups below are empty
|
|
write /dev/cpuctl/camera-daemon/cpu.shares 20480
|
|
write /dev/cpuctl/foreground/cpu.shares 20480
|
|
write /dev/cpuctl/nnapi-hal/cpu.shares 20480
|
|
write /dev/cpuctl/rt/cpu.shares 20480
|
|
write /dev/cpuctl/top-app/cpu.shares 20480
|
|
|
|
# Setup runtime cpusets
|
|
write /dev/cpuset/top-app/cpus 0-7
|
|
write /dev/cpuset/foreground/cpus 0-6
|
|
write /dev/cpuset/background/cpus 0-1
|
|
write /dev/cpuset/system-background/cpus 0-2
|
|
write /dev/cpuset/restricted/cpus 0-3
|
|
|
|
# Disable wsf, beacause we are using efk.
|
|
# wsf Range : 1..1000 So set to bare minimum value 1.
|
|
write /proc/sys/vm/watermark_scale_factor 1
|
|
|
|
setprop vendor.setup.power 1
|
|
|
|
# Toggle glove_mode according to touch_sensitivity_mode
|
|
on property:persist.vendor.touch_sensitivity_mode=0 && property:sys.boot_completed=1
|
|
write /sys/devices/platform/goodix_ts.0/game_mode "0 0 0 0"
|
|
|
|
on property:persist.vendor.touch_sensitivity_mode=1 && property:sys.boot_completed=1
|
|
write /sys/devices/platform/goodix_ts.0/game_mode "1 2 2 0"
|
|
|
|
# Route touch_sensitivity_mode to persist
|
|
on property:debug.touch_sensitivity_mode=0
|
|
setprop persist.vendor.touch_sensitivity_mode 0
|
|
|
|
on property:debug.touch_sensitivity_mode=1
|
|
setprop persist.vendor.touch_sensitivity_mode 1
|
|
|
|
#pd-mapper
|
|
service vendor.pd_mapper /vendor/bin/pd-mapper
|
|
class core
|
|
user system
|
|
group system
|
|
|
|
#Peripheral manager
|
|
service vendor.per_mgr /vendor/bin/pm-service
|
|
class core
|
|
user system
|
|
group system
|
|
ioprio rt 4
|
|
|
|
service vendor.per_proxy /vendor/bin/pm-proxy
|
|
class core
|
|
user system
|
|
group system
|
|
disabled
|
|
|
|
on charger
|
|
start vendor.power_off_alarm
|
|
setprop sys.usb.controller a600000.dwc3
|
|
setprop sys.usb.configfs 1
|
|
|
|
service vendor.spdaemon /vendor/bin/spdaemon
|
|
class core
|
|
user system
|
|
group system
|
|
shutdown critical
|
|
|
|
service vendor.sec_nvm /vendor/bin/sec_nvm
|
|
class core
|
|
user system
|
|
group system
|
|
|
|
service vendor.thermal-engine /vendor/bin/thermal-engine -c /vendor/etc/thermal-engine-msmnile-normal_mode.conf
|
|
class main
|
|
user root
|
|
group root
|
|
socket thermal-send-client stream 0666 system system
|
|
socket thermal-recv-client stream 0660 system system
|
|
socket thermal-recv-passive-client stream 0666 system system
|
|
socket thermal-send-rule stream 0660 system system
|
|
|
|
service vendor.lowi /vendor/bin/sscrpcd
|
|
class core
|
|
user system
|
|
group system wakelock
|
|
capabilities BLOCK_SUSPEND
|
|
|
|
service vendor.energy-awareness /vendor/bin/energy-awareness
|
|
class main
|
|
user system
|
|
group system
|
|
oneshot
|
|
|
|
service vendor.contexthub-hal-1-0 /vendor/bin/hw/android.hardware.contexthub@1.0-service
|
|
override
|
|
class hal
|
|
interface android.hardware.contexthub@1.0::IContexthub default
|
|
user system
|
|
group system
|
|
disabled
|