COMPATIBLE_MACHINE = "omap3-pandora"
-PR = "r0"
+PR = "r2"
SRC_URI = " \
file://op_bright.sh \
file://op_bright.desktop \
+ file://op_cpuspeed.sh \
+ file://op_cpuspeed.desktop \
"
do_install() {
install -d ${D}${prefix}/pandora/scripts/
- install -m 0755 ${S}/op_bright.sh ${D}${prefix}/pandora/scripts/
+ install -m 0755 ${WORKDIR}/op_bright.sh ${D}${prefix}/pandora/scripts/
+ install -m 0755 ${WORKDIR}/op_cpuspeed.sh ${D}${prefix}/pandora/scripts/
install -d ${D}${datadir}/applications/
- install -m 0644 ${S}/op_bright.desktop ${D}${datadir}/applications/
+ install -m 0644 ${WORKDIR}/op_bright.desktop ${D}${datadir}/applications/
+ install -m 0644 ${WORKDIR}/op_cpuspeed.desktop ${D}${datadir}/applications/
}
PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+FILES_${PN} += "${prefix} ${datadir}"
\ No newline at end of file
-#!/bin/sh
+#!/bin/bash
#get value range
minbright=3
maxbright=$(cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/max_brightness)
else
newbright=$1
fi
-if [ $newbright -le $minbright ]; then newbright=$minbright; fi
-if [ $newbright -ge $maxbright ]; then newbright=$maxbright; fi
+if [ $newbright ]; then
+ if [ $newbright -le $minbright ]; then newbright=$minbright; fi
+ if [ $newbright -ge $maxbright ]; then newbright=$maxbright; fi
+fi
echo $newbright > $device
--- /dev/null
+[Desktop Entry]
+Name=Set CPU speed
+Comment=Under of overclock your pandoras cpu.
+StartupNotify=false
+Exec=/usr/pandora/scripts/op_cpuclock.sh
+Icon=Terminal
+Terminal=false
+Type=Application
+Categories=System;
--- /dev/null
+#!/bin/bash
+#get value range
+minmhz=100
+safemhz=600
+maxmhz=900
+curmhz=$(cat /proc/pandora/cpu_mhz_max)
+device=/proc/pandora/cpu_mhz_max
+if [ ! $1 ]; then
+newmhz=$(DISPLAY=0:0 zenity --scale --text "set cpu mhz" --min-value=$minmhz --max-value=$maxmhz --value=$curmhz --step 1)
+else
+newmhz=$1
+fi
+if [ $newmhz ]; then
+ if [ $newmhz -ge $safemhz ]; then
+ answer=$(DISPLAY=0:0 zenity --question --title "Alert" --text "You are trying to set the cpu clock to $newmhz which is above its specification of $safemhz, doing so will may burn down your house, sour milk, or just blow up (ok, not that likely)! proceed?";echo $?)
+ echo $answer
+ if [ $answer = 1 ]; then exit 1; fi
+ fi
+
+ if [ $newmhz -le $minmhz ]; then newmhz=$minmhz; fi
+ if [ $newmhz -ge $maxmhz ]; then newmhz=$maxmhz; fi
+fi
+echo $newmhz > $device
+echo cpu_mhz_max set to $(cat /proc/pandora/cpu_mhz_max)