Kezdőlap › Fórumok › Van egy ötletem… › Menet közbeni CPU frekvencia-váltó script a 2.6-kernelekhez.
- This topic has 0 hozzászólás, 1 résztvevő, and was last updated 14 years, 5 months telt el by Gege.
- SzerzőBejegyzés
- 2009-12-04-19:55 #1871291
Hali!
Nemrég áttértem a 2.6-os kernelre, és elcsodálkoztam azon, hogy lehet a proci teljesítményét állítani menet közben. Ha leveszi az ember, kevésbé melegszik, nem fogyaszt annyi áramot stb…
Szóval itt a kis scriptem. Eléggé kezdetleges, de még csak most tanulok shell-scriptet…
#!/bin/bash
# CPU-frequency changer v1.0
#
# Copy this file to /bin so you can execute it with the “cpu” -command. It also needs a parameter: min/max.
# Set the rights carefully, because it can be a security measure if some ordinary user sets the frequency of the CPU…
#
# This is entirely written by Gege, it uses the 2.6 Linux kernel’s on-the-fly frequency scaling abilities.
# Feel free to distribute and modify it anyway you want.
# I take NO responsibility if you do something damage with this, but that has no chance to happen. The
# frequencies are automatically picked from the cpu-freq-scaling program, which detects them automatically.
# You HAVE to run a 2.6 kernel with cpu-freq scaling compiled in it. You also have to have /sys -filesystem
# support, and have to mount it to /sys.
# You have to run this script as r00t…if [ “$1” = “” ]
then
echo “You must specify a parameter (max/min)”
exit
fiecho
echo “Setting CPU to $1 freq.”
cd /sys/devices/system/cpu/cpu0/cpufreqif [ “$1” = “max” ]
then
cat cpuinfo_max_freq ] scaling_setspeed
fiif [ “$1” = “min” ]
then
cat cpuinfo_min_freq ] scaling_setspeed
fiecho
echo “The CPU frequency is set to the “$1″imum!”
echo “This frequency is:”
cat scaling_setspeed
echoCsak másoljátok be a /bin-be, állítsátok be a jogokat(rwxr–r–).
- SzerzőBejegyzés
- Be kell jelentkezni a hozzászóláshoz.
legutóbbi hsz