You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
device_samsung_a52q/rootdir/etc/init.a52q.rc

115 lines
4.8 KiB

# Copyright (c) 2013-2018,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 init
# setup cgroup freezer for freecess
mkdir /dev/freezer
mount cgroup none /dev/freezer freezer
mkdir /dev/freezer/frozen
mkdir /dev/freezer/thaw
write /dev/freezer/frozen/freezer.state FROZEN
write /dev/freezer/thaw/freezer.state THAWED
# MARs for freecess
chown system system /dev/freezer
chown system system /dev/freezer/frozen
chown system system /dev/freezer/frozen/tasks
chown system system /dev/freezer/frozen/cgroup.procs
chown system system /dev/freezer/frozen/freezer.state
chown system system /dev/freezer/thaw
chown system system /dev/freezer/thaw/tasks
chown system system /dev/freezer/thaw/cgroup.procs
# MARs for freecess
chmod 0644 /dev/freezer/frozen/tasks
chmod 0644 /dev/freezer/frozen/cgroup.procs
chmod 0644 /dev/freezer/frozen/freezer.state
chmod 0644 /dev/freezer/thaw/tasks
chmod 0644 /dev/freezer/thaw/cgroup.procs
# SDHMS Slowdown : Freezer
mkdir /dev/freezer/abnormal
write /dev/freezer/abnormal/freezer.state THAWED
chown system system /dev/freezer/abnormal
chown system system /dev/freezer/abnormal/tasks
chown system system /dev/freezer/abnormal/cgroup.procs
chown system system /dev/freezer/abnormal/freezer.state
chmod 0644 /dev/freezer/abnormal/tasks
chmod 0644 /dev/freezer/abnormal/cgroup.procs
chmod 0644 /dev/freezer/abnormal/freezer.state
on boot
# SDHMS Slowdown : Cpuset
mkdir /dev/cpuset/abnormal
write /dev/cpuset/abnormal/cpus 0-3
copy /dev/cpuset/mems /dev/cpuset/abnormal/mems
chown system system /dev/cpuset/abnormal
chown system system /dev/cpuset/abnormal/tasks
chown system system /dev/cpuset/abnormal/cpus
chmod 0664 /dev/cpuset/abnormal/tasks
chmod 0664 /dev/cpuset/abnormal/cpus
mkdir /dev/cpuset/moderate
write /dev/cpuset/moderate/cpus 0-2,4-6
copy /dev/cpuset/mems /dev/cpuset/moderate/mems
chown system system /dev/cpuset/moderate
chown system system /dev/cpuset/moderate/tasks
chown system system /dev/cpuset/moderate/cpus
chmod 0664 /dev/cpuset/moderate/tasks
chmod 0664 /dev/cpuset/moderate/cpus
# Permissions for booster
chown root system /sys/class/kgsl/kgsl-3d0/min_pwrlevel
chown root system /sys/class/kgsl/kgsl-3d0/max_pwrlevel
chown root system /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies
chown radio system /sys/power/cpufreq_min_limit
chown radio system /sys/power/cpufreq_max_limit
chown radio system /sys/power/cpufreq_table
chown root system /sys/class/devfreq/soc:qcom,cpu6-cpu-ddr-latfloor/min_freq
chown root system /sys/class/devfreq/soc:qcom,cpu6-cpu-ddr-latfloor/max_freq
chown root system /dev/cpuset/restricted/cpus
chmod 0664 /sys/class/kgsl/kgsl-3d0/min_pwrlevel
chmod 0664 /sys/class/kgsl/kgsl-3d0/max_pwrlevel
chmod 0664 /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies
chmod 0664 /sys/power/cpufreq_min_limit
chmod 0664 /sys/power/cpufreq_max_limit
chmod 0444 /sys/power/cpufreq_table
chmod 0664 /dev/cpuset/restricted/cpus
chmod 0664 /sys/class/devfreq/soc:qcom,cpu6-cpu-ddr-latfloor/min_freq
write /dev/cpuset/restricted/cpus 0-7
# SSWAP
write /proc/sys/vm/swappiness 130
on post-fs-data
# MST/NFC Switch
chmod 0660 /dev/mst_ctrl