DivestOS/Scripts/Common/Overclock.sh

89 lines
4.3 KiB
Bash
Raw Normal View History

#!/bin/bash
2020-11-17 10:11:40 -05:00
#DivestOS: A privacy focused mobile distribution
2019-06-18 13:49:01 -04:00
#Copyright (c) 2017-2018 Divested Computing Group
#
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program. If not, see <https://www.gnu.org/licenses/>.
#Overclocks the CPU to increase performance
2018-04-27 23:49:40 -04:00
#Last verified: 2018-04-27
2018-04-23 08:59:18 -04:00
echo "Applying overclocks...";
if enter "kernel/amazon/hdx-common"; then
2018-10-02 13:55:39 -04:00
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_amazon_hdx-common/0001-Overclock.patch"; #300MHz -> 268MHz, 2.26GHz -> 2.41GHz
2018-06-29 00:55:21 -04:00
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_amazon_hdx-common/0002-Overclock.patch";
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_amazon_hdx-common/0003-Overclock.patch";
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_amazon_hdx-common/0004-Overclock.patch";
fi;
2018-04-23 08:59:18 -04:00
2018-09-21 16:32:02 -04:00
if enter "kernel/asus/grouper-DISABLED"; then #XXX: Disabled
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_asus_grouper/0001-Overclock.patch";
2018-10-02 13:55:39 -04:00
echo "CONFIG_TEGRA_CPU_OVERCLOCK=y" >> arch/arm/configs/grouper_defconfig; #1.30GHz -> 1.50GHz
echo "CONFIG_TEGRA_CPU_OVERCLOCK_ULTIMATE=y" >> arch/arm/configs/grouper_defconfig; #1.30GHz -> 1.60GHz
echo "CONFIG_TEGRA_GPU_OVERCLOCK=y" >> arch/arm/configs/grouper_defconfig; #416MHz -> 520MHz
2018-09-21 16:32:02 -04:00
echo "CONFIG_TEGRA_GAMING_FIX=y" >> arch/arm/configs/grouper_defconfig;
fi;
2018-06-26 13:58:08 -04:00
if enter "kernel/huawei/angler"; then
2018-06-29 00:55:21 -04:00
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_huawei_angler/0001-Overclock.patch";
fi;
if enter "kernel/lge/g3"; then
2018-10-02 13:55:39 -04:00
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_lge_g3/0001-Overclock.patch"; #2.45GHz -> 2.76GHz
2018-06-29 00:55:21 -04:00
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_lge_g3/0002-Overclock.patch";
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_lge_g3/0003-Overclock.patch";
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_lge_g3/0004-Overclock.patch";
fi;
if enter "kernel/lge/hammerhead"; then
2018-10-02 13:55:39 -04:00
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_lge_hammerhead/0001-Overclock.patch"; #2.26GHz -> 2.95GHz
fi;
if enter "kernel/lge/mako"; then
2018-06-29 00:55:21 -04:00
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_lge_mako/0001-Overclock.patch";
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_lge_mako/0002-Overclock.patch";
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_lge_mako/0003-Overclock.patch";
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_lge_mako/0004-Overclock.patch";
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_lge_mako/0005-Overclock.patch";
echo "CONFIG_LOW_CPUCLOCKS=y" >> arch/arm/configs/lineageos_mako_defconfig; #384MHz -> 81MHz
2018-10-02 13:55:39 -04:00
echo "CONFIG_CPU_OVERCLOCK=y" >> arch/arm/configs/lineageos_mako_defconfig; #1.51GHz -> 1.70GHz
#echo "CONFIG_CPU_OVERCLOCK_ULTRA=y" >> arch/arm/configs/lineageos_mako_defconfig; #1.51GHz -> 1.94GHz XXX: Throttles
if enter "device/lge/mako"; then
sed -i 's/scaling_min_freq 384000/scaling_min_freq 81000/' rootdir/etc/init.mako.power.rc;
#sed -i 's/scaling_max_freq 1512000/scaling_max_freq 1728000/' rootdir/etc/init.mako.power.rc;
#sed -i 's/NORMAL_FREQ "1512000"/NORMAL_FREQ "1728000"/' power/power_mako.c;
2018-10-02 13:55:39 -04:00
#sed -i 's/scaling_max_freq 1512000/scaling_max_freq 1944000/' rootdir/etc/init.mako.power.rc;
2018-10-14 20:21:06 -04:00
#sed -i 's/NORMAL_FREQ "1512000"/NORMAL_FREQ "1944000"/' power/power_mako.c;
2018-10-02 13:55:39 -04:00
fi;
fi;
2018-04-23 08:59:18 -04:00
if enter "kernel/motorola/msm8916"; then
2018-10-02 13:55:39 -04:00
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_motorola_msm8916/0001-Overclock.patch"; #1.36GHz -> 1.88GHz
fi;
if enter "kernel/oneplus/msm8974"; then
2018-10-02 13:55:39 -04:00
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_oppo_msm8974/0001-OverUnderClock-EXTREME.patch"; #300MHz -> 268MHz, 2.45GHz -> 2.95GHz
fi;
if enter "kernel/oppo/msm8974"; then
2018-10-02 13:55:39 -04:00
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_oppo_msm8974/0001-OverUnderClock-EXTREME.patch"; #300MHz -> 268MHz, 2.45GHz -> 2.95GHz
fi;
2018-04-23 08:59:18 -04:00
if enter "kernel/zte/msm8930-DISABLED"; then
patch -p1 < "$DOS_PATCHES_OVERCLOCKS/android_kernel_zte_msm8930/0001-Overclock.patch";
fi;
2018-06-29 00:55:21 -04:00
cd "$DOS_BUILD_BASE";
2018-04-23 08:59:18 -04:00
echo "Overclocks applied!";