Package: kernel-power-settings
Section: user/system
Architecture: armel
-Depends: kernel-power-flasher, sudo
+Depends: kernel-power-flasher (>= 2.6.28-maemo25), sudo
+XB-Maemo-Display-Name: Enhanced Linux kernel for power users (settings)
Description: Tools for the customization of kernel settings
of the enhanced Maemo 5 kernel 2.6.28.10.
.
+ Installing this package will automatically also install the
+ required power user kernel. By default, this package has no effect.
+ .
+ The command /usr/sbin/kernel-config can be used to load, save and
+ show CPU frequency, voltage and DSP settings.
+ It can also set defaults which are loaded during boot.
+ Different profiles can be stored in user directory.
+ .
+ This package contains boot options to enable file system checks
+ of /home before mounting or to start a SSH server with USB networking.
+ Kernel modules specified in /etc/modules are loaded during boot.
+ The boot scripts contain safety mechanisms to temporarily disable them
+ after a crash for recovery.
+ .
+ For more details please visit http://wiki.maemo.org/Kernel_Power
XB-Maemo-Icon-26:
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0
d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACYtJREFUeNrUWkurZUcVXvXY
# kernel configuration script for power user kernel
# (c) Copyright 2010 by Thomas Tanner <maemo@tannerlab.com>
# licensed under GPLv3
-# version 0.1 (2. May 2010)
+# version 0.2 (7. May 2010)
if test $# -eq 0; then
echo "$0 command [options]"
echo "commands:"
echo " show - show current settings"
echo " load <file> - load settings from file"
- echo " save <file> - save settings to file (abs. path or filename in /home/user/.kernel, none=defaults)"
- echo " setdefault <file> - set file as default settings"
- echo " lock [freq [volt] [dsp]] - un/lock CPU at frequency with specific settings"
+ echo " save <file> - save settings to file (abs. path or filename in /home/user/.kernel)"
+ echo " default [<file>] - set file or the current settings as default settings"
+ echo " limits min max - set the frequency limits ('-' keeps the current setting)"
+ echo " lock freq [volt] [dsp] - lock CPU at frequency with specific settings"
+ echo " unlock - unlock CPU frequency"
echo "filenames: absolute path or filename in search path or none=defaults"
echo "search path: .,/home/user/.kernel,/usr/share/kernel-power-settings/"
exit 1
if test -f $cfd/avoid_frequencies -a -f $pwr/vdd1_opps_vsel -a -f $pwr/dsp_opps_rate; then :
else
echo This kernel version `uname -r` is not supported
+ echo Please make sure that kernel-power is installed and running.
+ echo If you have just installed the kernel, you need to shutdown and boot to activate it.
+ echo To reinstall the power user kernel run:
+ echo \'apt-get install --reinstall kernel-power kernel-power-flasher\'
exit 1
fi
rate=`cat $pwr/dsp_opps_rate`
cmd=$1
+test "$cmd" = setdefault && cmd=default # old name
+case " show load save default limits lock unlock " in
+*" $cmd "*) ;;
+*) echo "invalid command $cmd"; exit 1 ;;
+esac
arg=
shift
-if test "$cmd" = lock && test -z "$1"; then
+if test "$cmd" = unlock; then
echo 'unlocking frequency. reset to defaults'
cmd=loaddef
- arg=
+fi
+if test "$cmd" = default && test $# -eq 0; then
+ echo 'saving current settings as defaults'
+ arg=/etc/default/kernel-power
+ cmd=savedef
fi
popvsel() { curvsel=$1; shift; vsel="$*"; }
poprate() { currate=$1; shift; rate="$*"; }
case $cmd in
-show|save)
+show|save|savedef)
minfreq=$((`cat $cfr/scaling_min_freq`/1000))
maxfreq=$((`cat $cfr/scaling_max_freq`/1000))
test $maxfreq = 599 && maxfreq=600
avoid=`cat $cfd/avoid_frequencies`
freqs=
- for f in $allfreq; do
+ for f in 0 $allfreq; do
popvsel $vsel
poprate $rate
case " $avoid " in *" $f "*) ;;
- *) freqs="$freqs$((f/1000)):$curvsel,$currate "
+ *) freqs="$freqs$((f/1000)):$curvsel,$currate " ;;
esac
done
if test $cmd = show; then
echo -n ", up threshold=" `cat $cfd/up_threshold`
echo ", sampling rate=" `cat $cfd/sampling_rate`
else
- arg=$1
- test -z "$arg" && arg=/etc/default/kernel-power
+ test $cmd = save && arg=$1
+ if test -z "$arg"; then
+ echo "filename argument is mssing"
+ exit 1
+ fi
if test `basename $arg` = $arg; then
u=/home/user/.kernel
arg=$u/$arg
touch $arg
chown user.users $arg
fi
- test $arg = /etc/default/kernel-power && test -L $arg && rm -f $arg
+ rm -f $arg
echo "saving to $arg"
echo "# kernel configuration file generated by $0" > $arg
echo "MINFREQ=$minfreq" >> $arg
test -z "$volt" && test -z "$dsp" && continue
tvsel=
trate=
- cpvsel() { tvsel="$tvsel $1"; }
- cprate() { trate="$trate $1"; }
for fr in 0 $allfreq; do
if test $fr = $freq; then
popvsel $vsel
#echo $avoid
echo $avoid > $cfd/avoid_frequencies
echo $vsel > $pwr/vdd1_opps_vsel
- echo $rates > $pwr/dsp_opps_rate
+ echo $rate > $pwr/dsp_opps_rate
test $maxfreq = 600 && maxfreq=599
echo $((minfreq*1000)) > $cfr/scaling_min_freq
echo $((maxfreq*1000)) > $cfr/scaling_max_freq
test -n "$SAMPLING_RATE" && echo $SAMPLING_RATE > $cfd/sampling_rate
echo "successfully loaded."
;;
-setdefault)
+default)
arg=$1
if test -z "$arg"; then
echo "filename missing"
esac
echo "defaults set to $arg"
;;
+limits)
+ minfreq=$1
+ maxfreq=$2
+ if test "x$minfreq" = x -o "x$maxfreq" = x; then
+ echo "frequency limit arguments missing"
+ exit 1
+ fi
+ test "x$minfreq" = "x-" && minfreq=$((`cat $cfr/scaling_min_freq`/1000))
+ test "x$maxfreq" = "x-" && maxfreq=$((`cat $cfr/scaling_max_freq`/1000))
+ limits="$minfreq,$maxfreq"
+ minfreq=$((minfreq*1000))
+ maxfreq=$((maxfreq*1000))
+ case " $allfreq " in *" $minfreq "*) ;;
+ *) echo "invalid lower limit $1"; exit 1; ;;
+ esac
+ case " $allfreq " in *" $maxfreq "*) ;;
+ *) echo "invalid upper limit $2"; exit 1; ;;
+ esac
+ if test $minfreq -gt $maxfreq; then
+ echo "minimum must not be greater than maximum: $limits"
+ exit 1
+ fi
+ echo $minfreq > $cfr/scaling_min_freq
+ echo $maxfreq > $cfr/scaling_max_freq
+ echo "the limits were set to [$limits]"
+ ;;
lock)
arg=$1
altfreq=
freq=$((arg*1000))
ifreq=
i=0
- allfreq="0 $allfreq"
- for f in $allfreq; do
+ for f in 0 $allfreq; do
i=$((i+1))
test $f = $freq || continue
ifreq=$i
echo locking frequency $freq
echo $freq > $cfr/scaling_setspeed
;;
-*)
- echo "invalid command $cmd"
- exit 1
esac
exit 0