C.F.U. - CPU Frequency Utility - Version 1.23 - For use with the cpufrequtils package

I have written a bash script file designed to work with the cpufrequtils package and the programs cpufreq-info (for reading CPU speed info) and cpufreq-set (to set CPU speed governor and frequency).

http://paste.opensuse.org/view/download/87577387](http://www.imagebam.com/image/823790162592820)

This is my third attempt at writing a bash shell to interface with these two packages. After creating a blog on how to use YaST to set your CPU speed with yast-power-management you can read about here: YaST Power Management - Control Your CPU Energy Usage How To & FAQ - Blogs - openSUSE Forums, several forum users indicated they used the cpufreq utilities instead. So, I decided to see if any sort of value added bash script could be put together to work with this program set. Changes made to your CPU speed only last until you reboot your computer, but you may find the information and function it provides to be useful. Your speed selection options are as follows:

If you select USERSPACE, you can then pick a fixed speed from those your CPU supports:

You can run cfu with the --help request to get a list of startup commands for you to use:

Version 1.22 of C.F.U. (works with openSUSE 12.2 & 12.3) Adds new features and bug fixes:

  1. New Help Display is included
  2. C.F.U. includes menu automation. Type cfu -h for more details
  3. Better Detection for the cpufrequtils to work and to be installed
  4. Better detection of available speeds usable on your PC
  5. C.F.U. Now creates a KDE Desktop and Application icon for you. New settings at the top of the script control these actions.
  6. The C.F.U. color engine has been updated to work when no desktop has been loaded.
  7. Works with new openSUSE 12.3 lsb release name of: opensuseproject

To use the bash script file cfu, you need to download the following text from SUSE Paste (Actual Link is shown below) into a text editor like kwrite:

C.F.U. - CPU Frequency Utility - Version 1.23 - For use with the cpufrequtils packagee

Save the text as the file cfu in the /home area bin folder (example is: /home/username/bin, also known as ~/bin). It is possible to directly download cfu from a terminal session (You must delete or rename the old version first):

rm ~/bin/cfu
wget -nc http://paste.opensuse.org/view/download/92162247 -O ~/bin/cfu

This script must be marked executable to be used. Please run the following Terminal command:


chmod +x ~/bin/cfu

It is even possible to string all three of these commands together as one. Copy the following command, open up a terminal session, paste it in and press enter:

rm ~/bin/cfu ; wget -nc http://paste.opensuse.org/view/download/92162247 -O ~/bin/cfu ; chmod +x ~/bin/cfu

To use cfu, open a terminal session and type in:

cfu <OR> cfu -h

If the cpufrequtils package is not installed, you will be prompted to install it. In order to change your governor or CPU speed, you must supply the root user password. Same goes for installing the cpufrequtils package if it is missing. As always, I would love to hear about any comments or problems you might have using cfu.

Thank You,

Blogs: asroot : Bash : Packet Filter : C.F.U. : GPU’s : fewrup : F.S.M. : H.I. : nVIDIA : LNVHW : N.S.F. : S.A.K.C. : MMCHECK
S.A.S.I. : S.C.L.U. : S.G.T.B. : S.K.I.M. : S.L.A.V.E. : S.L.R.C. : S.T.A.R.T. : S.U.F.F. : SYSEdit : systemd : YaST Power

From what I can see on my system, setting the governor to userspace, available speeds are in:

       /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies

Thanks so much for your help hank_se. After looking I do see the full frequencies listed there. All I need to do is switch how cfu picks up these numbers.

Thank You,

It works James. Thank you.

Simply Outstanding!

openSUSE 12.1 users, you may want to use cfu to set your CPU speed to PERFORMANCE if you don’t like the ONDEMAND setting when using a desktop where speed is what you are after. It is possible to automatically run cfu each time you start up your PC. First, see the following blog on activating the /etc/init.d/after.local script:

systemd and using the after.local script in openSUSE 12.1 - Blogs - openSUSE Forums

Next, you need to install the cfu script if you have not alrady done so and allow the cpufrequtils to install if they are not already installed. Now, edit the after.local script (Alt-F2 in KDE):

kdesu kwrite /etc/init.d/after.local

and add the following command:

cfu -s 5 q

Now save the after.local file and reboot. This command will set your CPU speed to performance and exit each time you restart openSUSE. Use the terminal command cfu -h for more details.

Thank You,

C.F.U. - CPU Frequency Utility has been upgraded to Version 1.20. C.F.U. Now creates a KDE Desktop and Application icon for you. New settings at the top of the script control these actions. The C.F.U. color engine has been updated to work when no desktop has been loaded.

Thank You,

C.F.U. - CPU Frequency Utility has been updated to Version 1.22 to work with a slight change in how openSUSE 12.3 reports it release and to add more color to the CFU menu displays.

Thank You,

C.F.U. - CPU Frequency Utility has been updated to Version 1.23 to work with a slight change in how openSUSE 12.3 reports it release and to add even more color to the CFU menu displays.

Thank You,

Someone can help me? Anything is wrong?

n55sf@linux-icux:~> chmod +x ~/bin/cfu
n55sf@linux-icux:~> rm ~/bin/cfu ; wget -nc http://paste.opensuse.org/view/download/92162247 -O ~/bin/cfu ; chmod +x ~/bin/cfu
–2013-06-25 22:30:51-- http://paste.opensuse.org/view/download/92162247
Risoluzione di paste.opensuse.org (paste.opensuse.org)… 83.167.252.116, 2a01:430:28::3
Connessione a paste.opensuse.org (paste.opensuse.org)|83.167.252.116|:80… connesso.
Richiesta HTTP inviata, in attesa di risposta… 500 Internal Server Error
Cookie proveniente da paste.opensuse.org ha tentato di impostare il dominio a paste.opensuse.org
2013-06-25 22:30:51 ERRORE 500: Internal Server Error.

[QUOTE=federicoponti;bt850]Someone can help me? Anything is wrong?

n55sf@linux-icux:~> chmod +x ~/bin/cfu
n55sf@linux-icux:~> rm ~/bin/cfu ; wget -nc http://paste.opensuse.org/view/download/92162247 -O ~/bin/cfu ; chmod +x ~/bin/cfu
–2013-06-25 22:30:51-- http://paste.opensuse.org/view/download/92162247
Risoluzione di paste.opensuse.org (paste.opensuse.org)… 83.167.252.116, 2a01:430:28::3
Connessione a paste.opensuse.org (paste.opensuse.org)|83.167.252.116|:80… connesso.
Richiesta HTTP inviata, in attesa di risposta… 500 Internal Server Error
Cookie proveniente da paste.opensuse.org ha tentato di impostare il dominio a paste.opensuse.org
2013-06-25 22:30:51 ERRORE 500: Internal Server Error.[/QUOTE]

There is nothing wrong with your PC. SUSE Paste, used to post the bash scripts is down. I do not know why, but I will try to find out.

Thank You,

[QUOTE=jdmcdaniel3;bt851]There is nothing wrong with your PC. SUSE Paste, used to post the bash scripts is down. I do not know why, but I will try to find out.

Thank You,[/QUOTE]

Thank you very much, now it’s working, but i can choose only between ondemand and performance. Why?

That is because your Linux kernel was compiled to only include those two options. I will say that these are the two you normally use and the others just increase the size of the Linux kernel when not being used. With such devices as the Raspberry Pi, with limited memory, there has been some effort to reduce the kernel foot print. Again, you can compile your own kernel using my SAKC bash script and elect to load all of the cpu speed governors if you wish.

Thank You,

Adding in Speed Governors if Missing - When your default kernel configuration was created, the CPU speed Governors where selected for you, what was included and what the default is. You must compile your own kernel in order to change what has been selected. To Compile your own kernel, have a look here:

openSUSE and Installing New Linux Kernel Versions - Blogs - openSUSE Forums

You can use the kernel menuconfig utility to change the kernel configuration to allow support for all included Governors. Here is an example using my SAKC bash script and kernel 3.10:
**

  1. Elect to Configure Your Kernel in a GUI using SAKC:**

2. Select Power Management and ACPI Options:

http://paste.opensuse.org/view/download/59306496
**
3. Select CPU Frequency Scaling:
**
http://paste.opensuse.org/view/download/62163896

4. Select the Default Speed Governor:

IMPORTANT: Highlight Each of the Speed Governors and press the space bar until an asterisk is there as shown in my example below.

http://paste.opensuse.org/view/download/89162083
**
5. Select the Save Option and then Save your Config File: **

http://paste.opensuse.org/view/download/77894185

You may then Exit the Kernel configuration GUI and allow your kernel to be compiled using SAKC.

Thank You,