op_createsd: Added -F 32 to mkfs.vfat.
[openpandora.oe.git] / recipes / pandora-system / pandora-scripts / op_gamma.sh
1 #!/bin/sh
2
3 . /usr/pandora/scripts/op_paths.sh
4
5 if [ ! -e "$SYSFS_DSS_GAMMA" ]; then
6   echo "Control file is missing, might be incompatible kernel"
7   exit 1
8 fi
9
10 gamma="$@"
11
12 if [ "$gamma" = "0" ]; then
13   # set user default gamma
14   gamma="1"
15   if [ -f /etc/pandora/conf/dssgamma.state ]; then
16     dssgamma=$(cat /etc/pandora/conf/dssgamma.state)
17     dssgamma=$(echo "scale=2;$dssgamma / 100" | bc)
18     if [ -n "$dssgamma" ]; then
19       gamma=$dssgamma
20     fi
21   fi
22 fi
23
24 if [ "$gamma" = "1" -o "$gamma" = "1.00" ]; then
25   # no gamma adjustment
26   echo 0 > $SYSFS_DSS_GAMMA
27   exit 0
28 fi
29
30 if [ "`which op_gammatable`" = "" ]; then
31   echo "op_gammatable tool required"
32   exit 1
33 fi
34
35 # just forward args to op_gammatable
36 op_gammatable $gamma > $SYSFS_DSS_GAMMA