rc.pandora-state: If unit crashed, the safe CPU speed will now be set according to...
authorMichael Mrozek <EvilDragon@openpandora.org>
Tue, 16 Jul 2013 02:42:16 +0000 (04:42 +0200)
committerMichael Mrozek <EvilDragon@openpandora.org>
Tue, 16 Jul 2013 02:42:16 +0000 (04:42 +0200)
recipes/pandora-system/pandora-state/rc.pandora-state

index b1b5429..4178d88 100644 (file)
@@ -8,7 +8,7 @@
 # Default-Stop:      0 1 6
 ### END INIT INFO
  
-DESC="OpenPandora Save and Restore LCD Settings"
+DESC="OpenPandora Save and Restore various settings"
 NAME="pandora-state"
 
 . /usr/pandora/scripts/op_paths.sh
@@ -61,13 +61,19 @@ d_start() {
        echo $oppmax > /proc/pandora/cpu_opp_max
        if [ -f /etc/pandora/shutdown ]; then
              rm /etc/pandora/shutdown
-             sync
-             /usr/pandora/scripts/op_cpuspeed.sh -n $cpuspeed
+             sync      
        else
-             echo "No clean shutdown - will not set CPU speed"
+             echo "No clean shutdown - will CPU Speed will be set to safe value."
              echo "Yes" > /tmp/nocleanwarn
              chmod 777 /tmp/nocleanwarn
+             pnd_version=$(dmesg | grep OMAP3 | grep ES | awk '{print $3}')
+               if [ "$pnd_version" == "OMAP3630" ]; then
+                 cpuspeed="1000"
+               else
+                 cpuspeed="600"
+               fi
        fi
+       /usr/pandora/scripts/op_cpuspeed.sh -n $cpuspeed
        sed -n '1p' /etc/pandora/conf/nubs.state > /proc/pandora/nub0/mode
        sed -n '2p' /etc/pandora/conf/nubs.state > /proc/pandora/nub0/mouse_sensitivity
        sed -n '3p' /etc/pandora/conf/nubs.state > /proc/pandora/nub0/scrollx_sensitivity