49 lines
1.1 KiB
Bash
49 lines
1.1 KiB
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
|
|
|
# Minimal OS variable loading for performance
|
|
. /etc/profile.d/001-functions
|
|
|
|
CPU_VENDOR=$(cpu_vendor)
|
|
|
|
case ${CPU_VENDOR} in
|
|
AuthenticAMD)
|
|
tocon "Configuring system TDP..."
|
|
# If there is no defined overclock, make sure it's "off".
|
|
OVERCLOCK=$(get_setting system.overclock)
|
|
if [ -z ${OVERCLOCK} ]
|
|
then
|
|
set_setting system.overclock off
|
|
fi
|
|
/usr/bin/overclock boot
|
|
;;
|
|
GenuineIntel)
|
|
tocon "Configuring system EPP..."
|
|
|
|
###
|
|
### Enable dynamic boost.
|
|
###
|
|
|
|
if [ -f "/sys/devices/system/cpu/intel_pstate/hwp_dynamic_boost" ]
|
|
then
|
|
echo 1 >/sys/devices/system/cpu/intel_pstate/hwp_dynamic_boost
|
|
fi
|
|
|
|
###
|
|
### Energy Performance Preference isn't writeable if pstates are in
|
|
### active mode.
|
|
###
|
|
|
|
if [ -f "/sys/devices/system/cpu/intel_pstate/status" ]
|
|
then
|
|
echo passive >/sys/devices/system/cpu/intel_pstate/status
|
|
fi
|
|
|
|
EPP=$(get_setting system.power.epp)
|
|
if [ ! -z ${EPP} ]
|
|
then
|
|
/usr/bin/set_epp
|
|
fi
|
|
;;
|
|
esac
|