[PC-BSD Commits] r5688 - in pcbsd/trunk/XGUISource/resources: bin templates/scripts

svn at pcbsd.org svn at pcbsd.org
Sun Dec 27 08:24:38 PST 2009


Author: kris
Date: 2009-12-27 08:24:38 -0800 (Sun, 27 Dec 2009)
New Revision: 5688

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

Fixed up loading of 32bit compat nvidia libs when running amd64, which allows us to run 32bit progs on amd64
with supported GL stuff



Modified: pcbsd/trunk/XGUISource/resources/bin/setupconf.sh
===================================================================
--- pcbsd/trunk/XGUISource/resources/bin/setupconf.sh	2009-12-27 15:31:57 UTC (rev 5687)
+++ pcbsd/trunk/XGUISource/resources/bin/setupconf.sh	2009-12-27 16:24:38 UTC (rev 5688)
@@ -269,6 +269,14 @@
  kldunload nvidia
  pkg_delete -f nvidia-driver* >/dev/null 2>/dev/null
  pkg_delete -f nvidia-settings* >/dev/null 2>/dev/null
+ 
+ # Remove the 32bit compat stuff as well
+ if [ "`uname -m`' = "amd64" ]
+ then
+   PKG_DBDIR="/var/db/pkg32" ; export PKG_DBDIR
+   pkg_delete -p /usr/local32 -f nvidia-driver* >/dev/null 2>/dev/null
+   PKG_DBDIR="" ; export PKG_DBDIR
+ fi
 fi
 
 cat /boot/loader.conf | grep nvidia_load >/dev/null 2>/dev/null

Modified: pcbsd/trunk/XGUISource/resources/templates/scripts/nvidia.sh
===================================================================
--- pcbsd/trunk/XGUISource/resources/templates/scripts/nvidia.sh	2009-12-27 15:31:57 UTC (rev 5687)
+++ pcbsd/trunk/XGUISource/resources/templates/scripts/nvidia.sh	2009-12-27 16:24:38 UTC (rev 5688)
@@ -37,17 +37,73 @@
 # Remove any old nvidia driver from the system
 pkg_delete -f nvidia-driver* >/dev/null 2>/dev/null
 
+# Figure out the nvidia package name
+PKGNAME="`echo ${DRIVERVER} | sed -e 's|nvidia-|nvidia-driver-|'`"
+
 # If this is amd64, delete & add the 32bit drivers as well
 if [ "$ARCH" = "amd64" ]
 then
   PKG_DBDIR="${DBDIR64BIT}" ; export PKG_DBDIR
+  PKGLIST="/tmp/.nvidia-inslist"
   pkg_delete -p ${PREFIX64BIT} -f nvidia-driver* >/dev/null 2>/dev/null
-  pkg_add -p ${PREFIX64BIT} -f ${PKGDIR32}/${PKGNAME}*.tbz
+  pkg_add -M -t /usr/.nvidia32-tmp.XXXXX ${PKGDIR32}/${PKGNAME}*.tbz >${PKGLIST}
+  rm ${PKGLIST}.good
+
+  # Cleanup the package list now to only extract our local32 stuff
+  DEL="0"
+  while read line
+  do
+    echo $line | grep '@cwd ' >/dev/null 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      echo $line | grep '@cwd /usr/local' >/dev/null 2>/dev/null
+      if [ "$?" = "0" ]
+      then
+        DEL="0"
+        line="@cwd /usr/local32"
+      else
+        DEL="1"
+      fi
+
+      echo $line | grep '@cwd \.' >/dev/null 2>/dev/null
+      if [ "$?" = "0" ]
+      then
+        DEL="0"
+      fi
+ 
+    fi
+
+    if [ "${DEL}" = "0" ]
+    then
+      echo "${line}" >>${PKGLIST}.good
+    fi
+
+  done <${PKGLIST}
+
+  # Add the fixed nvidia driver
+  cat ${PKGLIST}.good | pkg_add -S -f >/dev/null 2>/dev/null
+
   PKG_DBDIR="" ; export PKG_DBDIR
+  /etc/rc.d/ldconfig restart
+
+  # Cleanup
+  rm -rf /usr/.nvidia32-tmp.*
+  rm ${PKGLIST}
+  rm ${PKGLIST}.good
 fi
 
+#Check if the driver is already loaded
+kldstat | grep nvidia >/dev/null 2>/dev/null
+if [ "${?}" = "0" ]
+then
+ # Its loaded, so remove the driver
+ kldunload nvidia
+fi
+
+# Remove any left-over nvidia.ko file
+rm /boot/modules/nvidia.ko
+
 # Add the nvidia driver to the system
-PKGNAME="`echo ${DRIVERVER} | sed -e 's|nvidia-|nvidia-driver-|'`"
 pkg_add -f ${PKGDIR}/${PKGNAME}*.tbz
 pkg_add -f ${PKGDIR}/nvidia-settings*.tbz
 



More information about the Commits mailing list