Check-in [59ed978392]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

SHA1 Hash:59ed97839278e430769f6f238340bfbe4804f80e
Date: 2012-05-07 09:53:15
User: BarryK
Comment:L18L: xgamma-gui fixed

Tags And Properties
Changes

Changes to woof-code/3builddistro

@@ -106,10 +106,11 @@
 #120315 Ubuntu Precise Pangolin has done a big move of files from /lib to /lib/i386-linux-gnu and /usr/lib to /usr/lib/i386-linuxgnu
 #120331 bugfix generating README.HTM on cd.
 #120401 improve choosing locale.
 #120502 more support for arm build.
 #120506 support creation of SD-card image (for arm build).
+#120506b check that sd card big enough.
 
 #v431 accepts passed params, from woof_gui_tabs:
 #$1=$CHOICE_KERNELPKG $2=$CHOICE_SCSI $3=$CHOICE_BIGMODEM $4=$CHK_FB_STATE $5=$CHK_EXOTIC_STATE $6=$CHK_RADICAL_STATE
 #100912 add $7=CHK_SIMPLE_FILENAMES
 
@@ -2579,10 +2580,18 @@
   exit 1
  fi
  sync
  SDBASE="`basename $SDIMAGE .xz`"
  IMGBYTES=`stat --format=%s $SDBASE`
+ #120506b check that sd card big enough...
+ SDCARDBYTES=`disktype ${SDDEVICE} | grep '^Block device' | cut -f 2 -d '(' | cut -f 1 -d ' '` #ex: 4023386112
+ if [ $IMGBYTES -gt $SDCARDBYTES ];then
+  echo
+  echo "Sorry, the image file is ${IMGBYTES}bytes, however the
+SD card is only ${SDCARDBYTES}bytes. Cannot continue."
+  exit 1
+ fi
  echo "Writing skeleton image to ${SDDEVICE}, please wait very patiently..."
  dd if=${SDBASE} of=${SDDEVICE}
  if [ $? -ne 0 ];then
   echo "Sorry, operation failure. Aborting script."
   exit 1

Changes to woof-code/rootfs-skeleton/usr/sbin/updatenetmoduleslist.sh

@@ -3,20 +3,24 @@
 #w001 now in /usr/sbin in the distro, called from /etc/rc.d/rc.update.
 #w474 bugfix for 2.6.29 kernel, modules.dep different format.
 #w478 old k2.6.18.1 has madwifi modules (ath_pci.ko) in /lib/modules/2.6.18.1/net.
 #v423 now using busybox depmod, which generates modules.dep in "old" format.
 #111027 make modinfo quiet.
+#120507 improve kernel version test. add 'sdio' interfaces.
 
 KERNVER="`uname -r`"
 KERNSUBVER=`echo -n $KERNVER | cut -f 3 -d '.' | cut -f 1 -d '-'` #29
 KERNMAJVER=`echo -n $KERNVER | cut -f 2 -d '.'` #6
 DRIVERSDIR="/lib/modules/$KERNVER/kernel/drivers/net"
 
 echo "Updating /etc/networkmodules..."
 
 DEPFORMAT='new'
-[ $KERNSUBVER -lt 29 ] && [ $KERNMAJVER -eq 6 ] && DEPFORMAT='old'
+#[ $KERNSUBVER -lt 29 ] && [ $KERNMAJVER -eq 6 ] && DEPFORMAT='old'
+if vercmp $KERNVER lt 2.6.29; then #120507
+ DEPFORMAT='old'
+fi
 #v423 need better test, as now using busybox depmod...
 [ "`grep '^/lib/modules' /lib/modules/${KERNVER}/modules.dep`" != "" ] && DEPFORMAT='old'
 
 if [ "$DEPFORMAT" = "old" ];then
  OFFICIALLIST="`cat /lib/modules/${KERNVER}/modules.dep | grep "^/lib/modules/$KERNVER/kernel/drivers/net/" | sed -e 's/\.gz:/:/' | cut -f 1 -d ':'`"
@@ -60,13 +64,18 @@
   echo "Adding $ONEBASE"
   echo -e "$ONEBASE \"$ONETYPE: $ONEDESCR\"" >> /tmp/networkmodules
  fi
  #v408 add b43legacy.ko...
  if [ "$ONETYPE" = "ssb" ];then
+  echo "Adding $ONEBASE"
+  echo -e "$ONEBASE \"$ONETYPE: $ONEDESCR\"" >> /tmp/networkmodules
+ fi
+ #120507 add sdio interfaces...
+ if [ "$ONETYPE" = "sdio" ];then
   echo "Adding $ONEBASE"
   echo -e "$ONEBASE \"$ONETYPE: $ONEDESCR\"" >> /tmp/networkmodules
  fi
 done
 
 sort -u /tmp/networkmodules > /etc/networkmodules
 
 ###end###

Changes to woof-code/rootfs-skeleton/usr/sbin/xgamma-gui

@@ -1,10 +1,12 @@
 #!/bin/bash
 #Written by PANZERKOPF
 #100215 hacked by BK
 #120330 L18L: internationalized.
+#120507 L18L: 10.0 = 100 using bc now because: Gamma values must be between 0.100 and 10.000 L18L
 
+. gettext.sh
 export TEXTDOMAIN=xgamma-gui
 export OUTPUT_CHARSET=UTF-8
 
 TITLE="$(gettext 'Monitor Gamma calibration')"
 BACKTITLE="$(gettext 'Set percentage value for each colour,\nor adjust equally if only want to adjust\nbrightness of screen')"
@@ -12,38 +14,53 @@
 if [ "`which xgamma`" = "" ]; then
  Xdialog --title "${TITLE}" --msgbox "$(gettext 'xgamma not found.')" 0 0
  exit
 fi
 
-GAMMA='100/100/100'
+GAMMA='100/100/100' # percentages
 #file contains one line like this: xgamma -rgamma 1.00 -ggamma 1.00 -bgamma 1.00 #100/100/100
+#file contains one line like this: xgamma -rgamma 10.00 -ggamma 9.90 -bgamma 10.00 #100/99/100
 [ -f $HOME/.xgamma-gamma ] && GAMMA="`cat $HOME/.xgamma-gamma | cut -f 2 -d '#'`"
 
 EXCODE="0"
-
 while [ "${EXCODE}" = "0" ]; do
 
  if [ ! -z ${xGAMMA} ]; then
-  xgamma -rgamma ${xGAMMA:0:1}.${xGAMMA:1:2} -ggamma ${xGAMMA:4:1}.${xGAMMA:5:2} -bgamma ${xGAMMA:8:1}.${xGAMMA:9:2}
+  echo ${xGAMMA}
+  #xgamma -rgamma ${xGAMMA:0:1}.${xGAMMA:1:2} -ggamma ${xGAMMA:4:1}.${xGAMMA:5:2} -bgamma ${xGAMMA:8:1}.${xGAMMA:9:2}
+  rg=`echo ${xGAMMA} | cut -d '/' -f1` ; rgf=`echo "scale=3; $rg / 10" | bc -l`
+  gg=`echo ${xGAMMA} | cut -d '/' -f2` ; ggf=`echo "scale=3; $gg / 10" | bc -l`
+  bg=`echo ${xGAMMA} | cut -d '/' -f3` ; bgf=`echo "scale=3; $bg / 10" | bc -l`
+  xgamma -rgamma $rgf -ggamma $ggf -bgamma $bgf
   sGAMMA=${xGAMMA}
   xgamma
+ #fi
+ else # inclusion of this block is new
+  #echo GAMMA=$GAMMA
+  rg=`echo ${GAMMA} | cut -d '/' -f1` ; rgf=`echo "scale=3; $rg / 10" | bc -l`
+  gg=`echo ${GAMMA} | cut -d '/' -f2` ; ggf=`echo "scale=3; $gg / 10" | bc -l`
+  bg=`echo ${GAMMA} | cut -d '/' -f3` ; bgf=`echo "scale=3; $bg / 10" | bc -l`
  fi
-
+# xGAMMA=`Xdialog --screen-center --left --backtitle "${BACKTITLE}" --title "${TITLE}" --stdout --buttons-style "text" --icon "/usr/share/images/xgamma-gui.xpm" --ok-label "$(gettext 'Apply')" --cancel-label "$(gettext 'Exit')" \
+#--3spinsbox "" 0 0 "0" "199" "${GAMMA:0:3}" "$(gettext 'Red')" "0" "199" "${GAMMA:4:3}" "$(gettext 'Green')" "0" "199" "${GAMMA:8:3}" "$(gettext 'Blue')"`
  xGAMMA=`Xdialog --screen-center --left --backtitle "${BACKTITLE}" --title "${TITLE}" --stdout --buttons-style "text" --icon "/usr/share/images/xgamma-gui.xpm" --ok-label "$(gettext 'Apply')" --cancel-label "$(gettext 'Exit')" \
---3spinsbox "" 0 0 "0" "199" "${GAMMA:0:3}" "$(gettext 'Red')" "0" "199" "${GAMMA:4:3}" "$(gettext 'Green')" "0" "199" "${GAMMA:8:3}" "$(gettext 'Blue')"`
+--3spinsbox "" 0 0 "0" "100" "${rg}" "$(gettext 'Red')" "0" "100" "${gg}" "$(gettext 'Green')" "0" "100" "${bg}" "$(gettext 'Blue')"`
  EXCODE=${?}
 
 done
 
 if [ ! -z ${sGAMMA} ]; then
+ #Xdialog --yesno "$(gettext 'Save current configuration?')" 0 0
  Xdialog --ok-label "$(gettext 'Yes')" --cancel-label "$(gettext 'No')" --yesno "$(gettext 'Save current configuration?')" 0 0
   if [ ${?} -eq 0 ]; then
-   echo -n "xgamma -rgamma ${sGAMMA:0:1}.${sGAMMA:1:2} -ggamma ${sGAMMA:4:1}.${sGAMMA:5:2} -bgamma ${sGAMMA:8:1}.${sGAMMA:9:2}"' &' > $HOME/.xgamma-gamma
+   #echo -n "xgamma -rgamma ${sGAMMA:0:1}.${sGAMMA:1:2} -ggamma ${sGAMMA:4:1}.${sGAMMA:5:2} -bgamma ${sGAMMA:8:1}.${sGAMMA:9:2}"' &' > $HOME/.xgamma-gamma
+   #echo -n "xgamma -rgamma $rg -ggamma $gg -bgamma $bg"' &' > $HOME/.xgamma-gamma
+   echo -n "xgamma -rgamma $rgf -ggamma $ggf -bgamma $bgf"' &' > $HOME/.xgamma-gamma
    echo " #${sGAMMA}" >> $HOME/.xgamma-gamma
    #...xgamma is executed in /root/.xinitrc
-   echo "Saved"
+   echo "$(gettext 'Saved')"
    #ummm, but if defaults, don't need xgamma...
    [ "$sGAMMA" = "100/100/100" ] && rm -f $HOME/.xgamma-gamma #saves time in .xinitrc
   fi
 fi
 
 ###END###