pandora-state: Added optional TV-Out-Enabling on startup
authorMichael Mrozek <EvilDragon@openpandora.org>
Fri, 18 Oct 2013 01:00:41 +0000 (03:00 +0200)
committerMichael Mrozek <EvilDragon@openpandora.org>
Fri, 18 Oct 2013 01:00:41 +0000 (03:00 +0200)
recipes/pandora-system/pandora-state.bb
recipes/pandora-system/pandora-state/rc.pandora-state

index aaf2b94..9cb2d53 100755 (executable)
@@ -5,7 +5,7 @@ COMPATIBLE_MACHINE = "omap3-pandora"
 
 RDEPENDS = "pandora-scripts"
 
 
 RDEPENDS = "pandora-scripts"
 
-PR = "r20"
+PR = "r21"
 inherit update-rc.d
 
 INITSCRIPT_NAME = "pandora-state"
 inherit update-rc.d
 
 INITSCRIPT_NAME = "pandora-state"
index 529b8d1..a7e9ee1 100644 (file)
@@ -41,13 +41,23 @@ d_start() {
        # Determine Pandora type
        pnd_version=$(dmesg | grep OMAP3 | grep ES | awk '{print $3}')
        echo $pnd_version > /tmp/pnd_version
        # Determine Pandora type
        pnd_version=$(dmesg | grep OMAP3 | grep ES | awk '{print $3}')
        echo $pnd_version > /tmp/pnd_version
+       
        echo "Restoring Pandora specific settings"
        echo "Restoring Pandora specific settings"
+       
+       # Enable TV Out
+       if [ -f /etc/pandora/conf/tvout.state ]; then
+               /usr/pandora/scripts/op_tvout.sh
+       fi
+       
+       # Set LEDs
        highpow="$(cat /etc/pandora/conf/led.conf | grep HighPowerLED: | awk -F\: '{print $2}')"
        echo $highpow > /sys/class/leds/pandora\:\:power/brightness #power LED bright
        bright=$(cat /etc/pandora/conf/brightness.state)
        if [ "$bright" -gt "0" ]; then
                echo $bright > $SYSFS_BACKLIGHT_BRIGHTNESS
        fi
        highpow="$(cat /etc/pandora/conf/led.conf | grep HighPowerLED: | awk -F\: '{print $2}')"
        echo $highpow > /sys/class/leds/pandora\:\:power/brightness #power LED bright
        bright=$(cat /etc/pandora/conf/brightness.state)
        if [ "$bright" -gt "0" ]; then
                echo $bright > $SYSFS_BACKLIGHT_BRIGHTNESS
        fi
+       
+       # Set Gamma
        cat /etc/pandora/conf/dirty_expire_centisecs >  /proc/sys/vm/dirty_expire_centisecs
        cat /etc/pandora/conf/gamma.state > $SYSFS_GAMMA
        if [ -f /etc/pandora/conf/dssgamma.state ]; then
        cat /etc/pandora/conf/dirty_expire_centisecs >  /proc/sys/vm/dirty_expire_centisecs
        cat /etc/pandora/conf/gamma.state > $SYSFS_GAMMA
        if [ -f /etc/pandora/conf/dssgamma.state ]; then
@@ -55,10 +65,14 @@ d_start() {
                dssgamma2=$(echo "scale=2;$dssgamma / 100" | bc)
                /usr/pandora/scripts/op_gamma.sh $dssgamma2
        fi
                dssgamma2=$(echo "scale=2;$dssgamma / 100" | bc)
                /usr/pandora/scripts/op_gamma.sh $dssgamma2
        fi
+       
+       # Set Filter
        if [ -f /etc/pandora/conf/filter.state ]; then
                filter=$(cat /etc/pandora/conf/filter.state)
                /usr/pandora/scripts/op_videofir.sh $filter 
        fi
        if [ -f /etc/pandora/conf/filter.state ]; then
                filter=$(cat /etc/pandora/conf/filter.state)
                /usr/pandora/scripts/op_videofir.sh $filter 
        fi
+       
+       # Check for unclean shutdown and set CPU Speed
        cpuspeed="$(cat /etc/pandora/conf/cpu.conf | grep default | awk -F\: '{print $2}')"
        oppmax="$(cat /etc/pandora/conf/cpu.conf | grep opp | awk -F\: '{print $2}')"
        echo $oppmax > /proc/pandora/cpu_opp_max
        cpuspeed="$(cat /etc/pandora/conf/cpu.conf | grep default | awk -F\: '{print $2}')"
        oppmax="$(cat /etc/pandora/conf/cpu.conf | grep opp | awk -F\: '{print $2}')"
        echo $oppmax > /proc/pandora/cpu_opp_max
@@ -76,6 +90,8 @@ d_start() {
                fi
        fi
        /usr/pandora/scripts/op_cpuspeed.sh -n $cpuspeed
                fi
        fi
        /usr/pandora/scripts/op_cpuspeed.sh -n $cpuspeed
+       
+       # Set nubs
        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
        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
@@ -90,6 +106,8 @@ d_start() {
        sed -n '12p' /etc/pandora/conf/nubs.state > /proc/pandora/nub1/mbutton_threshold
        sed -n '13p' /etc/pandora/conf/nubs.state > /proc/pandora/nub0/mbutton_delay
        sed -n '14p' /etc/pandora/conf/nubs.state > /proc/pandora/nub1/mbutton_delay
        sed -n '12p' /etc/pandora/conf/nubs.state > /proc/pandora/nub1/mbutton_threshold
        sed -n '13p' /etc/pandora/conf/nubs.state > /proc/pandora/nub0/mbutton_delay
        sed -n '14p' /etc/pandora/conf/nubs.state > /proc/pandora/nub1/mbutton_delay
+       
+       # Enable ZRAM Swap
        echo "Enabling ZRAM Swap"
        mkswap /dev/zram0
        swapon -p 5 /dev/zram0
        echo "Enabling ZRAM Swap"
        mkswap /dev/zram0
        swapon -p 5 /dev/zram0