- Shell 81.8%
- Roff 13.3%
- Makefile 4.9%
afreq.sh
A simple daemon for setting cpu frequency governor
Donate using Liberapay
Donate using Liberapay
Inspired by auto-cpufreq, afreq.sh is a minimal daemon built on posix shell and core utils, it is intended to be extensible, lean and have the least amount of dependencies possible.
As of now afreq depends only on:
- core utils (grep, sleep, tail, awk, head, realpath, cat) however a sleep command that supports float values is needed
- built ins (printf, command)
- posix shell interpreter (dash, bash, busybox ash)
- procps (vmstat, pgrep)
installation
Install everything:
sudo make install-all
this will provide:
| component | default location | description |
|---|---|---|
| afreq | /usr/local/sbin/afreq |
the actual daemon doing the work |
| afreq.1 | /usr/local/man/man1/afreq.1 |
the documentation manual for the daemon |
| afreqconfig | /usr/local/share/doc/afreq/afreqconfig |
example configuration file |
| examples/wireless-power-management.sh | /usr/local/share/doc/afreq/wireless-power-management.sh |
example run hook |
| perfmod | /usr/local/sbin/perfmod |
thin wrapper to force performance governor when a program runs |
| acpufreq | /etc/init.d/acpufreq |
sysvinit initscript |
| acpufreq.service | /etc/systemd/system/acpufreq.service |
systemd unit |
install config
Edit the config.mk file to tweak installation options.
SysV init script
This repo provides 2 sysvinit init scripts, a hand written one and one that uses Debian's init-d-script framework that provides a Debian and LSB compliant init.d script that may be preferred on some environments, you can choose with the config.mk file.
Usage
sysvinit
The makefile should put the script in /etc/init.d/acpufreq by default, after that
a simple sudo update-rc.d acpufreq defaults should be enough to activate
it for the next boot
The service script supports the standard actions.
A simple sudo service acpufreq start will initiate the daemon.
systemd
The makefile should put the unit in /etc/systemd/system/acpufreq.service by
default, all you need is run sudo systemctl enable acpufreq to activate the
service for the next boot.
Initiate the service with sudo systemctl start acpufreq
configuration
Altho the default settings used internally by the daemon ought to work for most setups you can do tweak them to your liking or usecase, the installation provides an example config file and the manpage contains information about the available settings and their possible values.