From 0aae8dde3b8d8635e947435f445b0fb2aead63ac Mon Sep 17 00:00:00 2001 From: Michael Mrozek Date: Thu, 27 Jan 2011 01:44:04 +0100 Subject: [PATCH] New Script: op_cpusettings - Manages CPU-Settings of the Pandora --- .../pandora-scripts/op_cpusettings.desktop | 9 +++ .../pandora-scripts/op_cpusettings.pnd | Bin 0 -> 8468 bytes .../pandora-scripts/op_cpusettings.sh | 60 ++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 recipes/pandora-system/pandora-scripts/op_cpusettings.desktop create mode 100644 recipes/pandora-system/pandora-scripts/op_cpusettings.pnd create mode 100755 recipes/pandora-system/pandora-scripts/op_cpusettings.sh diff --git a/recipes/pandora-system/pandora-scripts/op_cpusettings.desktop b/recipes/pandora-system/pandora-scripts/op_cpusettings.desktop new file mode 100644 index 0000000..32440c2 --- /dev/null +++ b/recipes/pandora-system/pandora-scripts/op_cpusettings.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=CPU Settings +Comment=Manage CPU Settings on your Pandora +StartupNotify=false +Exec=sudo /usr/pandora/scripts/op_cpisettings.sh +Icon=package_graphics +Terminal=false +Type=Application +Categories=Settings; diff --git a/recipes/pandora-system/pandora-scripts/op_cpusettings.pnd b/recipes/pandora-system/pandora-scripts/op_cpusettings.pnd new file mode 100644 index 0000000000000000000000000000000000000000..f29cab5982f16a8130ede093f7e484402a0edbff GIT binary patch literal 8468 zcmeHKi9eLx+aIA&Bq4;xWZxMg%ZQLYVJL~ln8q;1m>EmSQduHfA-n8CWEo^jD6)-^ ztl1??_I-Va^t{jS_x=fQ_k7N|&hovs@43!>f5sN?gr@`m0I}6q^Z|fl01EP$0&oWK zf!tG($5+Vh;8{KPTmCwd`$v!V(cJq;)*s2CBk9)X5Z)ZpDaq`&exEM1*I=3fZ5V08 zs;8<&X)6@3(x9n;}1?*JyNB z%PDqi8&35+0oD@k+-yK>vX?~YThI%}6SLZvP5Tz8Y-IDm*G{T=hChxkb$emCYlX2} zSD$qK5-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?vE2ou5uGMa$wc6U|#+KTp->WzrI&^;K($ z+g?|C52`OrS7~iZLUl9^jMh#Vb!uo}L}r6p2_f3f66Q*Z*f>fK+?h&{QjEfXKX>>bJ| zPl5um_ z*jKT?iamL1Im%90FDMdxjKyy*Y7CM=eo#v>h&Wj6GQ1uTGVU(m@2Vpyn|yEizv zaxQH;qZ}jYfUM{#a-vSjyu5FDMTh(y$}~vGNQTKp8B|A%rdW?I%99sHHx}U*mv*HU z6#8uy2)v`F5k%=)$&`$|9NId`J-JZI-MPH#+JrKyCV`!&{pWVQ?}z&XeTPdgaNlct z|KwvTOee>0xPuvTA5Xv7*-tkZqu3pN$$>6(Z%3->;RKOLWTc@g)c9frvF=(rL1NCa zs~lqAkF`=EZ94OFp~ldXO?{52XH!oLNQ-01e zO&#h!kR5BP$)+ivDrh$_AsuhV?3-w}B`Llg0v~o2z5Ic5lUjWkwEj_q73_xP(icm3 zoye4}qx^7V`eIsKDPQ&YnZ@`EoFdLuorYaLWFE__Ly+BXbE>;k9xTY++W~kvi^ZJc n>|Hw%2=OYKnz7vX0@!!f-LkCmen /proc/pandora/cpu_opp_max + sed -i "s/.*maxopp.*/maxopp:$newopp/g" /etc/pandora/conf/cpu.conf + zenity --info --title="OPP Set" --text "The maximum allowed OPP value has been set to $newopp." --timeout 6 + fi;; + +"mhz") + min="$(cat /etc/pandora/conf/cpu.conf | grep min | awk -F\: '{print $2}')" + max="$(cat /etc/pandora/conf/cpu.conf | grep max | awk -F\: '{print $2}')" + if zenity --question --title="MHz Setting Info" --text="This setting can set the allowed range apps can use on your Pandora.\n\nToo high CPU settings can render your Pandora unstable and crash it. This can lead to data loss!\n\nBe absolutely sure you know what you are doing here.\n\nThe standard maximum setting is 800MHz, the standard minimum setting 125MHz." --ok-label="Yes, I know what I'm doing!" --cancel-label="I'm scared!"; then + newmax=$(zenity --scale --text "Set the maximum allowed MHz" --min-value=500 --max-value=1300 --value=$max --step 1) + newmin=$(zenity --scale --text "Set the minimum allowed MHz" --min-value=20 --max-value=500 --value=$min --step 1) + sed -i "s/.*max:.*/max:$newmax/g" /etc/pandora/conf/cpu.conf + sed -i "s/.*min:.*/min:$newmin/g" /etc/pandora/conf/cpu.conf + zenity --info --title="MHz range set" --text "Your Pandora can now set the CPU clock between $newmin and $newmax MHz." --timeout 6 + fi;; + +"warning") + warn="$(cat /etc/pandora/conf/cpu.conf | grep warn | awk -F\: '{print $2}')" + safe="$(cat /etc/pandora/conf/cpu.conf | grep safe | awk -F\: '{print $2}')" + min="$(cat /etc/pandora/conf/cpu.conf | grep min | awk -F\: '{print $2}')" + max="$(cat /etc/pandora/conf/cpu.conf | grep max | awk -F\: '{print $2}')" + if zenity --question --title="Warning Setting Info" --text="The Pandora usually displays a warning if you try to overclock.\n\nYou can either select at what speed the warning should appear or disable it completely.\n\nBe absolutely sure you know what you are doing here.\n\nThe standard setting is 600MHz." --ok-label="Yes, I know what I'm doing!" --cancel-label="I'm scared!"; then + if zenity --question --title="Disable Warning?" --text="Do you want to enable or disable the warning?" --ok-label="Enable it" --cancel-label="Disable it"; then + newsafe=$(zenity --scale --text "At what speed should the warning appear?" --min-value=$min --max-value=$max --value=$safe --step 1) + sed -i "s/.*warn.*/warn:yes/g" /etc/pandora/conf/cpu.conf + sed -i "s/.*safe.*/safe:$newsafe/g" /etc/pandora/conf/cpu.conf + zenity --info --title="Warning enabled" --text "Your Pandora will warn you if you try to clock higher than $newsafe MHz." --timeout 6 + else + sed -i "s/.*warn.*/warn:no/g" /etc/pandora/conf/cpu.conf + zenity --info --title="Warning" --text "Your Pandora will NOT warn you if you try to overclock!" --timeout 6 + fi + fi;; + + "defaultmhz") + defspeed="$(cat /etc/pandora/conf/cpu.conf | grep default | awk -F\: '{print $2}')" + min="$(cat /etc/pandora/conf/cpu.conf | grep min | awk -F\: '{print $2}')" + max="$(cat /etc/pandora/conf/cpu.conf | grep max | awk -F\: '{print $2}')" + if zenity --question --title="Default CPU Speed" --text="WARNING!\n\nYou are about to change the default clockspeed your Pandora will be running when you start it.\nIf it is set too high, the Pandora will crash.\n\nIf that happens, the Pandora will NOT change the clockspeed on the next boot, so you can access the OS and fix the default clock speed.\n\nHowever, each crash can lead to data loss - so please be sure to absolutely know what you're doing!" --ok-label="Yes, I know what I'm doing!" --cancel-label="I'm scared!"; then + newdefault=$(zenity --scale --text "Set the default CPU speed" --min-value=$min --max-value=$max --value=$defspeed --step 1) + echo $newdefault > /proc/pandora/cpu_mhz_max + sed -i "s/.*default.*/default:$newdefault/g" /etc/pandora/conf/cpu.conf + zenity --info --title="Default speed set" --text "The default clock speed has been set to $newdefault." --timeout 6 + fi;; + + +esac +done \ No newline at end of file -- 2.39.5