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_sm7125-common/rootdir/etc/init.a52q.rc

105 lines
4.0 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
# SSWAP
write /proc/sys/vm/swappiness 130
# SQZR
on property:sys.boot_completed=1
swapon_all /vendor/etc/fstab.sqzr
on property:sys.sysctl.zram_balance_ratio=*
write /sys/module/zram/parameters/zram_balance_ratio ${sys.sysctl.zram_balance_ratio}
on post-fs-data
# MST/NFC Switch
chmod 0660 /dev/mst_ctrl
# SSU (Samsung SIM Unlock)
on property:ro.boot.carrierid=MXO
setprop ssu.support 1