cpufreq: Don't complain if a CPU doesn't support the desired governor
This commit is contained in:
parent
4c65a5d95c
commit
e194d41b9c
@ -30,11 +30,19 @@ with pkgs.lib;
|
|||||||
jobs.cpufreq =
|
jobs.cpufreq =
|
||||||
{ description = "Initialize CPU frequency governor";
|
{ description = "Initialize CPU frequency governor";
|
||||||
|
|
||||||
startOn = "started udev";
|
after = [ "systemd-modules-load.service" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
|
path = [ pkgs.cpufrequtils ];
|
||||||
|
|
||||||
preStart = ''
|
preStart = ''
|
||||||
for i in $(seq 0 $(($(nproc) - 1))); do
|
for i in $(seq 0 $(($(nproc) - 1))); do
|
||||||
${pkgs.cpufrequtils}/bin/cpufreq-set -g ${config.powerManagement.cpuFreqGovernor} -c $i
|
for gov in $(cpufreq-info -c $i -g); do
|
||||||
|
if [ "$gov" = ${config.powerManagement.cpuFreqGovernor} ]; then
|
||||||
|
echo "<6>setting governor on CPU $i to ‘$gov’"
|
||||||
|
cpufreq-set -c $i -g $gov
|
||||||
|
fi
|
||||||
|
done
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user