op_cpusettings.sh: Shows warning message if user tries to change OPP with experimenta...
authorMichael Mrozek <EvilDragon@openpandora.de>
Fri, 16 Mar 2012 01:44:30 +0000 (02:44 +0100)
committerMichael Mrozek <EvilDragon@openpandora.de>
Fri, 16 Mar 2012 01:44:30 +0000 (02:44 +0100)
recipes/pandora-system/pandora-scripts/op_cpusettings.sh

index aa627a8..3d2a0ec 100755 (executable)
@@ -13,14 +13,19 @@ while mainsel=$(zenity --title="CPU-Settings" --width="400" --height="350" --lis
 case $mainsel in
 
   "opp")
 case $mainsel in
 
   "opp")
-    opp="$(cat /etc/pandora/conf/cpu.conf | grep opp | awk -F\: '{print $2}')"
-    if zenity --question --title="OPP Setting Info" --text="WARNING!\n\nIncreasing the maximum allowed OPP will allow you to overclock to higher values.\n\nHowever, besides using more power, it ALSO DECREASES THE LIFETIME OF YOUR CPU!\n\nBe absolutely sure you know what you are doing here. \n\nThe standard OPP setting is 3, everything above is out of the specification!" --ok-label="Yes, I know what I'm doing!" --cancel-label="I'm scared!"; then
-      if newopp=$(zenity --scale --text "Set the maximum allowed OPP" --min-value=3 --max-value=5 --value=$opp --step 1); then
-       echo $newopp > /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
-      else
-       zenity --info --title="No change" --text "The maximum OPP value has not been changed." --timeout 6
+    kernel_major=`uname -r | cut -c 1`
+    if [ "$kernel_major" = "3" ]; then 
+      zenity --info --title="OPP not supported" --text "Sorry, the experimental kernel does not support overvolting.\n\nTherefore, you cannot configure these CPU-Settings."
+    else
+      opp="$(cat /etc/pandora/conf/cpu.conf | grep opp | awk -F\: '{print $2}')"
+      if zenity --question --title="OPP Setting Info" --text="WARNING!\n\nIncreasing the maximum allowed OPP will allow you to overclock to higher values.\n\nHowever, besides using more power, it ALSO DECREASES THE LIFETIME OF YOUR CPU!\n\nBe absolutely sure you know what you are doing here. \n\nThe standard OPP setting is 3, everything above is out of the specification!" --ok-label="Yes, I know what I'm doing!" --cancel-label="I'm scared!"; then
+       if newopp=$(zenity --scale --text "Set the maximum allowed OPP" --min-value=3 --max-value=5 --value=$opp --step 1); then
+         echo $newopp > /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
+       else
+         zenity --info --title="No change" --text "The maximum OPP value has not been changed." --timeout 6
+       fi
       fi
     fi;;
 
       fi
     fi;;