blob: 6283e8bf275d64b3c1af3b8de627fd80a1ceed70 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2012, Sébastien Luttringer
# Copyright (C) 2024, Francesco Poli <invernomuto@paranoici.org>
ESTATUS=0
# apply CPU clock frequency options
if test -n "$FREQ"
then
cpupower frequency-set -f "$FREQ" > /dev/null || ESTATUS=1
elif test -n "${GOVERNOR}${MIN_FREQ}${MAX_FREQ}"
then
cpupower frequency-set \
${GOVERNOR:+ -g "$GOVERNOR"} \
${MIN_FREQ:+ -d "$MIN_FREQ"} ${MAX_FREQ:+ -u "$MAX_FREQ"} \
> /dev/null || ESTATUS=1
fi
# apply CPU policy options
if test -n "$PERF_BIAS"
then
cpupower set -b "$PERF_BIAS" > /dev/null || ESTATUS=1
fi
# apply Energy Performance Preference
if test -n "$EPP"
then
cpupower set -e "$EPP" > /dev/null || ESTATUS=1
fi
exit $ESTATUS
|