Bash Script for Changing Cpu Minimal Frequency Operation Not Permitted

Bash Script for Changing Cpu Minimal Frequency Operation Not Permitted

I wrote a script to set the minimum cpu frequency in the bash, looks like this:

#!/bin/bash
echo -n "Processor min-freq"
echo -n Zadej minimální frekvenci procesoru
read val
echo $val > /sys/devices/system/cpu/cpu0/cpufreq/scalling_min_freq
echo $val > /sys/devices/system/cpu/cpu1/cpufreq/scalling_min_freq
echo $val > /sys/devices/system/cpu/cpu2/cpufreq/scalling_min_freq
echo $val > /sys/devices/system/cpu/cpu3/cpufreq/scalling_min_freq
echo $val > /sys/devices/system/cpu/cpu4/cpufreq/scalling_min_freq
echo $val > /sys/devices/system/cpu/cpu5/cpufreq/scalling_min_freq
echo "all done"

but it does not work, this is the output from the terminal:

gandalf@gandalf-MS-7693 ~ $ sudo -s
gandalf-MS-7693 ~ # '/home/gandalf/Plocha/procesor-min-freq.sh' 
Processor min-freqZadej minimální frekvenci procesoru1500000
/home/gandalf/Plocha/procesor-min-freq.sh: řádek 5: /sys/devices/system/cpu/cpu0/cpufreq/scalling_min_freq: Operation not permitted
/home/gandalf/Plocha/procesor-min-freq.sh: řádek 6: /sys/devices/system/cpu/cpu1/cpufreq/scalling_min_freq: Operation not permitted
/home/gandalf/Plocha/procesor-min-freq.sh: řádek 7: /sys/devices/system/cpu/cpu2/cpufreq/scalling_min_freq: Operation not permitted
/home/gandalf/Plocha/procesor-min-freq.sh: řádek 8: /sys/devices/system/cpu/cpu3/cpufreq/scalling_min_freq: Operation not permitted
/home/gandalf/Plocha/procesor-min-freq.sh: řádek 9: /sys/devices/system/cpu/cpu4/cpufreq/scalling_min_freq: Operation not permitted
/home/gandalf/Plocha/procesor-min-freq.sh: řádek 10: /sys/devices/system/cpu/cpu5/cpufreq/scalling_min_freq: Operation not permitted
all done
gandalf-MS-7693 ~ # 

Do you have any ideas? I will be great for the solution

2 Answers

Fixed, cause found in file: /etc/cpufreqd.conf I rewrote the profile frequency: Performance High, originally there was:

[Profile]
Name = Performance High
Minfreq = 100%
Maxfreq = 100%
Policy = performance
# Exec_post = echo 8> / proc / acpi / sony / brightness
[/ Profile]

After replacing:

[Profile]
Name = Performance High
Minfreq = 0%
Maxfreq = 100%
Policy = performance
# Exec_post = echo 8> / proc / acpi / sony / brightness
[/ Profile]

It is after the problem, parade :)

Under the assumption that you are using the intel p-state governors, execute the command

sudo cpupower frequency-set -d 1500kHz

If you are not using intel_pstate, then

sudo apt install cpufrequtils

will download a set of utilities, and

sudo cpufreq-set -d 1500kHz

will set the minimum frequency

9

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

David Miller
Author

David Miller

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.