[PC-BSD Commits] r428 - in pcbsd/trunk/system-overlay/PCBSD/xorg-gui: bin settings templates templates/driver templates/header templates/scripts

svn at pcbsd.org svn at pcbsd.org
Sun Jul 8 14:51:52 PDT 2007


Author: kris
Date: 2007-07-08 22:51:52 +0100 (Sun, 08 Jul 2007)
New Revision: 428

Added:
   pcbsd/trunk/system-overlay/PCBSD/xorg-gui/settings/README
   pcbsd/trunk/system-overlay/PCBSD/xorg-gui/settings/alias.txt
   pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/driver/README
   pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/header/README
   pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/
   pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/README
   pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/i810.sh
   pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-100.14.11.sh
   pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-9746.sh
Modified:
   pcbsd/trunk/system-overlay/PCBSD/xorg-gui/bin/setupconf.sh
   pcbsd/trunk/system-overlay/PCBSD/xorg-gui/settings/drivers.txt
Log:

Improved the Xorg GUI setup to allow different nvidia drivers to be loaded,
also improved funtionality to make it easier to develop PBIs which install
new drivers & templates down the road, without modifying the actual script
itself. 



Modified: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/bin/setupconf.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/xorg-gui/bin/setupconf.sh	2007-07-08 21:07:48 UTC (rev 427)
+++ pcbsd/trunk/system-overlay/PCBSD/xorg-gui/bin/setupconf.sh	2007-07-08 21:51:52 UTC (rev 428)
@@ -6,11 +6,26 @@
 
 TMPFILE="/PCBSD/xorg-gui/.xorg.conf.tmp"
 
-case ${DRIVER} in
-  i810) cp /PCBSD/xorg-gui/templates/header/i810.xorg.conf $TMPFILE ;;
-     *) cp /PCBSD/xorg-gui/templates/header/xorg.conf.generic $TMPFILE ;;
-esac
+# Get the real driver name and save the value from xorg-gui
+SELDRIVER="${DRIVER}" ; export SELDRIVER
+grep "${DRIVER}:" /PCBSD/xorg-gui/settings/alias.txt >/dev/null 2>/dev/null
+if [ "$?" = "0" ]
+then
+  DRIVER=`cat /PCBSD/xorg-gui/settings/alias.txt | grep "${DRIVER}:" | cut -d ":" -f 2`
+  export DRIVER
+else
+  echo "Warning: Selected driver not found in alias.txt file..."
+fi
 
+# Check if the driver has a special header to use in place of the generic one
+if [ -e "/PCBSD/xorg-gui/templates/header/${SELDRIVER}.xorg.conf" ]
+then
+  cp "/PCBSD/xorg-gui/templates/header/${SELDRIVER}.xorg.conf" $TMPFILE 
+else
+  cp /PCBSD/xorg-gui/templates/header/xorg.conf.generic $TMPFILE 
+fi
+
+
 # Setup the monitor section with GTF values
 echo '
 Section "Monitor"
@@ -61,42 +76,14 @@
 
 mv $TMPFILE /etc/X11/xorg.conf
 
+# Done generating the xorg.conf file
+###############################################################################
 
-# Make sure we load the nvidia kernel module if the user selected it
-if [ "${DRIVER}" = "nvidia" ]
-then
 
-# Add the nvidia driver to the system
-pkg_add -f /PCBSD/packages/nvidia*.tbz
-
-touch /PCBSD/conf/beryl-enable
-
-#Check if the driver is already loaded
-kldstat | grep nvidia >/dev/null 2>/dev/null
-if [ "${?}" != "0" ]
+# Check if we need to remove any nvidia specific settings
+if [ "${DRIVER}" != "nvidia" ]
 then
- # Not loaded, so load it up!
- kldload nvidia
-fi
 
-cat /boot/loader.conf | grep nvidia_load >/dev/null 2>/dev/null
-if [ "${?}" != "0" ]
-then
-  echo "nvidia_load=\"YES\"" >> /boot/loader.conf
-fi
-
-# Make sure we disable built-in AGP
-cat /boot/device.hints | grep -v "hint.agp.0.disabled" >/tmp/.device.hints
-mv /tmp/.device.hints /boot/device.hints
-echo "hint.agp.0.disabled=\"1\"" >> /boot/device.hints
-
-# If the user didn't select nVidia driver, make sure its not loaded
-else
-
-
-# Remove the nvidia driver from the system
-pkg_delete -f nvidia-driver*
-
 rm /PCBSD/conf/beryl-enable
 
 #Check if the driver is already loaded
@@ -105,6 +92,7 @@
 then
  # Its loaded, so remove the driver
  kldunload nvidia
+ pkg_delete -f nvidia-driver* >/dev/null 2>/dev/null
 fi
 
 cat /boot/loader.conf | grep nvidia_load >/dev/null 2>/dev/null
@@ -122,12 +110,9 @@
 fi
 
 
-# Check for intel i180 driver
-if [ "${DRIVER}" = "i810" ]
+# See if this driver needs any post-setup operations to run
+if [ -e "/PCBSD/xorg-gui/templates/scripts/${SELDRIVER}.sh" ]
 then
-  # Since we are using the i810 driver allow the beryl autostart
-  touch /PCBSD/conf/beryl-enable
+  # We found the file, so run it
+  sh "/PCBSD/xorg-gui/templates/scripts/${SELDRIVER}.sh"
 fi
-
-
-

Added: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/settings/README

Added: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/settings/alias.txt

Modified: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/settings/drivers.txt
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/xorg-gui/settings/drivers.txt	2007-07-08 21:07:48 UTC (rev 427)
+++ pcbsd/trunk/system-overlay/PCBSD/xorg-gui/settings/drivers.txt	2007-07-08 21:51:52 UTC (rev 428)
@@ -4,8 +4,6 @@
 chips
 cirrus
 cyrix
-dummy
-fbdev
 glint
 i128
 i740
@@ -16,7 +14,8 @@
 newport
 nsc
 nv
-nvidia
+nvidia-9746
+nvidia-100.14.11  
 rendition
 s3
 s3virge

Added: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/driver/README

Added: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/header/README

Added: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/README

Added: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/i810.sh


Property changes on: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/i810.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-100.14.11.sh


Property changes on: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-100.14.11.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-9746.sh


Property changes on: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-9746.sh
___________________________________________________________________
Name: svn:executable
   + *



More information about the Commits mailing list