From b93174bd6de82ee016a1261015de08bc60ab1795 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Thu, 20 Oct 2011 10:32:44 -0500
Subject: xconfig.sh: general cleanup  and redirect messy output to a log file.

---
 abs/core/LinHES-config/xconfig.sh | 51 ++++++++++++++++-----------------------
 1 file changed, 21 insertions(+), 30 deletions(-)

diff --git a/abs/core/LinHES-config/xconfig.sh b/abs/core/LinHES-config/xconfig.sh
index c43c1e5..313b489 100755
--- a/abs/core/LinHES-config/xconfig.sh
+++ b/abs/core/LinHES-config/xconfig.sh
@@ -3,12 +3,9 @@
 #SET DISPLAYCARD to force a cardtype
 #SET DISPLAYRES to force Xres, ENV takes precendent over cmdline
 #displayres=cmdline
-#NVPKGS="ati-dri xf86-video-ati xf86-video-radeonhd intel-dri xf86-video-intel unichrome-dri xf86-video-unichrome xf86-video-mga xf86-video-savage xf86-video-trident"
-#NVPKGS="ati-dri xf86-video-ati xf86-video-radeonhd intel-dri xf86-video-intel xf86-video-mga xf86-video-savage xf86-video-trident unichrome-dri xf86-video-openchrome "
-#NVPKGS="unichrome-dri"
+LOGFILE=/tmp/xconfig.log
 for i in ati intel mga savage sis unichrome
 do
-    #templist="$i-dri xf86-video-$i"
     templist=`echo $i-dri xf86-video-$i`
     NVPKGS=`echo $NVPKGS  $templist`
 
@@ -18,7 +15,7 @@ BASE=""
 NVIDIA_96XX="$TEMPLATES/xorg/96xx_supported.txt"
 NVIDIA_173="$TEMPLATES/xorg/173_supported.txt"
 NVIDIA_SUPPORTED="$TEMPLATES/xorg/nvidia_supported.txt"
-#TEMPLATES="/usr/share/templates"
+
 MYTHHOME=$BASE/home/mythtv
 
 function Xvalues {
@@ -40,7 +37,7 @@ function Xvalues {
         VGACARDTYPE=$DISPLAYCARD
         Xcardtype=$VGACARDTYPE
     fi
-    echo "Will use $VGACARDTYPE"
+    echo "Detected $VGACARDTYPE as the video card type"
     #currentmode=`cat "$BASE/etc/X11/xorg.conf" | grep Modes | awk -Fs '{ print $2 }'`
 }
 
@@ -73,7 +70,7 @@ function presetupX {
 }
 
 function setupAdvancedX {
-    echo "#doing the advanced" > /tmp/options
+    echo "#Doing the advanced X setup" > /tmp/options
     Xcategory=`echo "$Xresadvanced" | cut -d_ -f1`
     Xres=`echo "$Xresadvanced" | cut -d_ -f2`
     echo "$Xcategory"
@@ -183,11 +180,7 @@ function setupAdvancedX {
                 -e "/INSERT HERE/r /tmp/options" "$TEMPLATES/xorg/xorg.conf.ati"  > "$XORG_CONF"
             ;;
 
-        via|VIA|Via|S3)
-            # Need to add appropriate Modules, Device and DRI sections
-            # See the http://www.mythtv.org/wiki/XvMC wiki page
-            echo "no via here"
-            ;;
+
 
         *)
             echo "unknown card type"
@@ -198,14 +191,12 @@ function setupAdvancedX {
 function nvidia_prepare {
     for i in libgl nvidia nvidia-utils nvidia-173xx nvidia-173xx-utils nvidia-96xx nvidia-96xx-utils
     do
-#        echo "Removing $i"
-        pacman --noconfirm -Rdd $i > /dev/null 2>&1    
+        pacman --noconfirm -Rdd $i >> $LOGFILE 2>&1
     done
 
     for i in `echo ${NVPKGS}`
     do
-#        echo "Removing $i"
-        pacman --noconfirm  -Rc $i > /dev/null 2>&1
+        pacman --noconfirm  -Rc $i >> $LOGFILE 2>&1
     done
 
 
@@ -219,15 +210,15 @@ function nvidia_driver_install {
 
         if [ "$TESTMODE" != "test" ]
         then
-            
+
 
             grep -qi "$CARDID" "$NVIDIA_SUPPORTED"
             if [ $? = 0 ]
             then
                 #install latest drivers
-                echo "installing current nvidia drivers"
+                echo "Installing current nvidia drivers"
                 nvidia_prepare
-                pacman --noconfirm  -S nvidia nvidia-utils > /dev/null 2>&1
+                pacman --noconfirm  -S nvidia nvidia-utils >> $LOGFILE 2>&1
             fi
 
 
@@ -236,18 +227,18 @@ function nvidia_driver_install {
             if [ $? = 0 ]
             then
                 #install 96xx drivers
-                echo "installing nvidia 96xx drivers"
+                echo "Installing nvidia 96xx drivers"
                 nvidia_prepare
-                pacman --noconfirm  -S nvidia-96xx nvidia-96xx-utils  > /dev/null 2>&1
+                pacman --noconfirm  -S nvidia-96xx nvidia-96xx-utils  >> $LOGFILE 2>&1
             fi
 
             grep -qi "$CARDID" "$NVIDIA_173"
             if [ $? = 0 ]
             then
                 #install latest drivers
-                echo "installing 173 nvidia drivers"
+                echo "Installing 173 nvidia drivers"
                 nvidia_prepare
-                pacman --noconfirm  -S nvidia-173xx nvidia-173xx-utils > /dev/null 2>&1
+                pacman --noconfirm  -S nvidia-173xx nvidia-173xx-utils >> $LOGFILE 2>&1
             fi
         fi
         if [ ${Xres} = Auto ]
@@ -292,11 +283,11 @@ function setupX {
                 then
                     if [ "$OPENCHROME" = "1" ]
                     then
-                        pacman --noconfirm  -R nvidia nvidia-utils > /dev/null 2>&1
-                        pacman --noconfirm  -S libgl unichrome-dri xf86-video-openchrome > /dev/null 2>&1
+                        pacman --noconfirm  -R nvidia nvidia-utils >> $LOGFILE 2>&1
+                        pacman --noconfirm  -S libgl unichrome-dri xf86-video-openchrome >> $LOGFILE 2>&1
                     else
-                        pacman --noconfirm  -R nvidia nvidia-utils > /dev/null 2>&1
-                        pacman --noconfirm  -S libgl unichrome-dri xf86-video-unichrome > /dev/null 2>&1
+                        pacman --noconfirm  -R nvidia nvidia-utils >> $LOGFILE 2>&1
+                        pacman --noconfirm  -S libgl unichrome-dri xf86-video-unichrome >> $LOGFILE 2>&1
                     fi
                 fi
                 # I'm making educated guesses here...
@@ -327,8 +318,8 @@ function setupX {
                 fi
                 if [ "$TESTMODE" != "test" ]
                 then
-                    pacman --noconfirm -R nvidia-utils > /dev/null 2>&1
-                    pacman --noconfirm -S libgl > /dev/null 2>&1
+                    pacman --noconfirm -R nvidia-utils >> $LOGFILE 2>&1
+                    pacman --noconfirm -S libgl >> $LOGFILE 2>&1
                 fi
 	        echo "/usr/lib/libIntelXvMC.so.1" > "$XVMC_CONFIG"
                 ;;
@@ -367,7 +358,7 @@ function setupX {
                 else
                     echo "Xorg configuration failed"
                 fi
-                rm -f "$XCONF" 2>&1 > /dev/null
+                rm -f "$XCONF"  >> $LOGFILE 2>&1
                 ;;
         esac
     fi
-- 
cgit v0.12

