[PC-BSD Commits] r5676 - pcbsd/trunk/XGUISource/resources/templates/scripts

svn at pcbsd.org svn at pcbsd.org
Mon Dec 21 16:12:15 PST 2009


Author: kris
Date: 2009-12-21 16:12:15 -0800 (Mon, 21 Dec 2009)
New Revision: 5676

Modified:
   pcbsd/trunk/XGUISource/resources/templates/scripts/nvidia.sh
Log:

Updated xgui to include support for adding 32bit nvidia drivers



Modified: pcbsd/trunk/XGUISource/resources/templates/scripts/nvidia.sh
===================================================================
--- pcbsd/trunk/XGUISource/resources/templates/scripts/nvidia.sh	2009-12-22 00:00:04 UTC (rev 5675)
+++ pcbsd/trunk/XGUISource/resources/templates/scripts/nvidia.sh	2009-12-22 00:12:15 UTC (rev 5676)
@@ -4,6 +4,28 @@
 # The selected driver version is set at $1
 DRIVERVER="${1}"
 
+# Set some options for amd64 to include 32bit driver as well
+if [ "$ARCH" = "amd64" ]
+then
+  PREFIX64BIT="/usr/local32"
+  DBDIR64BIT="/var/db/pkg32"
+  if [ ! -d "${PREFIX64BIT}" ]
+  then
+    mkdir -p ${PREGID64BIT}
+  fi
+  if [ ! -d "${DBDIR64BIT}" ]
+  then
+    mkdir -p ${DBDIR64BIT}
+  fi
+  PKGDIR="/usr/PCBSD/packages/amd64"
+  PKGDIR32="/usr/PCBSD/packages/i386"
+else
+  PKGDIR="/usr/PCBSD/packages/i386"
+fi
+
+# Get the system arch
+ARCH="`uname -m`"
+
 #Check if the driver is already loaded
 kldstat | grep nvidia >/dev/null 2>/dev/null
 if [ "${?}" = "0" ]
@@ -15,10 +37,19 @@
 # Remove any old nvidia driver from the system
 pkg_delete -f nvidia-driver* >/dev/null 2>/dev/null
 
+# If this is amd64, delete & add the 32bit drivers as well
+if [ "$ARCH" = "amd64" ]
+then
+  PKG_DBDIR="${DBDIR64BIT}" ; export PKG_DBDIR
+  pkg_delete -p ${PREFIX64BIT} -f nvidia-driver* >/dev/null 2>/dev/null
+  pkg_add -p ${PREFIX64BIT} -f ${PKGDIR32}/${PKGNAME}*.tbz
+  PKG_DBDIR="" ; export PKG_DBDIR
+fi
+
 # Add the nvidia driver to the system
 PKGNAME="`echo ${DRIVERVER} | sed -e 's|nvidia-|nvidia-driver-|'`"
-pkg_add -f /usr/PCBSD/packages/${PKGNAME}*.tbz
-pkg_add -f /usr/PCBSD/packages/nvidia-settings*.tbz
+pkg_add -f ${PKGDIR}/${PKGNAME}*.tbz
+pkg_add -f ${PKGDIR}/nvidia-settings*.tbz
 
 #Check if the driver is already loaded
 kldstat | grep nvidia >/dev/null 2>/dev/null



More information about the Commits mailing list