[PC-BSD Commits] r1890 - in pcbsd/trunk/system-overlay/PCBSD: Scripts xorg-gui/bin xorg-gui/templates/scripts

svn at pcbsd.org svn at pcbsd.org
Mon May 12 10:03:55 PDT 2008


Author: kris
Date: 2008-05-12 10:03:54 -0700 (Mon, 12 May 2008)
New Revision: 1890

Modified:
   pcbsd/trunk/system-overlay/PCBSD/Scripts/checkXloader.sh
   pcbsd/trunk/system-overlay/PCBSD/xorg-gui/bin/rundetect.sh
   pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-169.12.sh
   pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-71.86.04.sh
   pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-96.43.05.sh
Log:

Fixed up the problems with loading NVIDIA from the XGUI tool on FreeBSD 7.
Turns out you have to load nvidia driver from /boot/loader.conf at bootup
instead of kldload as on 6.x. Script takes this into account and prompts to
reboot when an nvidia driver is choosen. 



Modified: pcbsd/trunk/system-overlay/PCBSD/Scripts/checkXloader.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/Scripts/checkXloader.sh	2008-05-12 01:38:19 UTC (rev 1889)
+++ pcbsd/trunk/system-overlay/PCBSD/Scripts/checkXloader.sh	2008-05-12 17:03:54 UTC (rev 1890)
@@ -6,4 +6,11 @@
 if [ "$FOUND" = "0" ]
 then
   cp /PCBSD/xorg-gui/conf/ttys.xsetup /etc/ttys
+  exit 0
 fi
+
+if [ -e "/PCBSD/xorg-gui/.rerunxsetup" ]
+then
+  cp /PCBSD/xorg-gui/conf/ttys.xsetup /etc/ttys
+  exit 0
+fi

Modified: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/bin/rundetect.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/xorg-gui/bin/rundetect.sh	2008-05-12 01:38:19 UTC (rev 1889)
+++ pcbsd/trunk/system-overlay/PCBSD/xorg-gui/bin/rundetect.sh	2008-05-12 17:03:54 UTC (rev 1890)
@@ -24,27 +24,40 @@
 
 echo "`clear`" >/dev/console
 
+# If we have rebooted for nvidia drivers, skip some inital setup
+if [ ! -e "/PCBSD/xorg-gui/.nvidiareboot" ]
+then
+ rm /PCBSD/xorg-gui/.xsettings.sh >/dev/null 2>/dev/null
 
-echo "Determining monitor refresh rate capabilities..." >/dev/console
-X -configure 2>/dev/null
+ # Move any existing xorg.conf file
+ if [ -e "/etc/X11/xorg.conf" ]
+ then
+    mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
+ fi
 
-# Clear out any old refresh rates
-rm /tmp/.horzsync >/dev/null 2>/dev/null
-rm /tmp/.vertsync >/dev/null 2>/dev/null
 
-# Check for refresh rate lines
-cat /root/xorg.conf.new | grep HorizSync >/dev/null 2>/dev/null
-if [ "$?" = "0" ]
-then
+ echo "Determining monitor refresh rate capabilities..." >/dev/console
+ X -configure 2>/dev/null
+
+ # Clear out any old refresh rates
+ rm /tmp/.horzsync >/dev/null 2>/dev/null
+ rm /tmp/.vertsync >/dev/null 2>/dev/null
+
+ # Check for refresh rate lines
+ cat /root/xorg.conf.new | grep HorizSync >/dev/null 2>/dev/null
+ if [ "$?" = "0" ]
+ then
   cat /root/xorg.conf.new | grep HorizSync > /tmp/.horzsync
-fi
+ fi
 
-cat /root/xorg.conf.new | grep VertRefresh >/dev/null 2>/dev/null
-if [ "$?" = "0" ]
-then
+ cat /root/xorg.conf.new | grep VertRefresh >/dev/null 2>/dev/null
+ if [ "$?" = "0" ]
+ then
   cat /root/xorg.conf.new | grep VertRefresh > /tmp/.vertsync
-fi
+ fi
 
+fi # End of skip for nvidia reboot
+
 echo "Please wait... Start X-Configuration Utility" >/dev/console
 
 # Check if we need to save an existing .xinitrc file
@@ -65,11 +78,6 @@
 
 cd /root/
 
-# Move any existing xorg.conf file
-if [ -e "/etc/X11/xorg.conf" ]
-then
-   mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
-fi
 
 # Recreate our log file
 if [ -e "${XLOG}" ]
@@ -80,11 +88,12 @@
 # Create an empty log file for appending
 echo "" > ${XLOG}
 
+
 # Remove any files from a previous attempt
-rm /PCBSD/xorg-gui/.done >/dev/null 2>/dev/null
-rm /PCBSD/xorg-gui/.xsettings.sh >/dev/null 2>/dev/null
 rm /PCBSD/xorg-gui/.canceled >/dev/null 2>/dev/null
 rm /PCBSD/xorg-gui/.selected >/dev/null 2>/dev/null
+rm /PCBSD/xorg-gui/.rerunxsetup >/dev/null 2>/dev/null
+rm /PCBSD/xorg-gui/.done >/dev/null 2>/dev/null
 
 
 # Set the attempt number to 0
@@ -97,29 +106,38 @@
 i=1
 do
 
-# Save the previous xorg.conf file for troubleshooting
-if [ -e "/etc/X11/xorg.conf" ]
+# If we have rebooted for nvidia drivers go straight to confirm screen
+if [ ! -e "/PCBSD/xorg-gui/.nvidiareboot" ]
 then
+ # Save the previous xorg.conf file for troubleshooting
+ if [ -e "/etc/X11/xorg.conf" ]
+ then
   mv /etc/X11/xorg.conf /etc/X11/xorg.conf.previous
-fi
+ fi
 
 
 if [ "${ATTEMPT}" = "0" ]
 then
+
   # Use the saved xorg.conf.basic file
   echo "Using saved /PCBSD/xorg-gui/conf/xorg.conf.basic from install..." >/dev/console
   cp /PCBSD/xorg-gui/conf/xorg.conf.basic /etc/X11/xorg.conf
+
 elif [ "${ATTEMPT}" = "1" ]
 then
+
   # Try running the driver detection again
   rm /etc/X11/xorg.conf
   echo "Saved configuration failed... Running auto-detect..." >/dev/console
   /PCBSD/xorg-gui/cardDetect/x_config.sh
+
 else
+
   # Still failed, drop to VESA failsafe
   echo "Auto-detected settings failed... Using failsafe VESA 1024x768 mode..." >/dev/console
   rm /etc/X11/xorg.conf
   cp /PCBSD/xorg-gui/cardDetect/XF86Config.compat /etc/X11/xorg.conf
+
 fi
 
 
@@ -128,8 +146,8 @@
 then
   rm /PCBSD/xorg-gui/.failed
 
-  ##### Create the xinitrc file
-echo '#!/bin/sh
+ ##### Create the xinitrc file
+ echo '#!/bin/sh
 touch /PCBSD/xorg-gui/.xstartupsuccess
 /usr/local/bin/fluxbox &
 PID=$!
@@ -142,53 +160,78 @@
 fi
 kill -9 ${PID}
 ' > /root/.xinitrc
-chmod 755 /root/.xinitrc
+ chmod 755 /root/.xinitrc
 
-else
+ else
 
-##### Create the xinitrc file
-echo '#!/bin/sh
+ ##### Create the xinitrc file
+ echo '#!/bin/sh
 touch /PCBSD/xorg-gui/.xstartupsuccess
 /usr/local/bin/fluxbox &
 PID=$!
-#kdialog --msgbox "PC-BSD will now allow you to setup your monitor resolution and video settings.\n If your system is equipped with a 3D card, please select the appropriate driver. This will enable you to run the 3D desktop, Beryl.\n\nNOTE: Beryl requires a color depth of 24."
 /PCBSD/xorg-gui/bin/XGUI
 if [ "$?" = "1" ]
 then
  kdialog --msgbox "PC-BSD will now load using the default resolution."
  echo "Canceled" > /PCBSD/xorg-gui/.canceled
 fi
-kill -9 ${PID}
-' > /root/.xinitrc
-chmod 755 /root/.xinitrc
 
-
+cat /PCBSD/xorg-gui/.xsettings.sh | grep nvidia >/dev/null
+if [  "$?" = "0" ]
+then
+ ls /dev/nvidiactl* >/dev/null
+ if [ "$?" != "0" ]
+ then
+   /usr/local/bin/kdialog --msgbox "The system will be rebooted to load the NVIDIA kernel module. You will be asked to confirm the resolution after bootup."
+   touch /PCBSD/xorg-gui/.nvidiareboot
+   touch /PCBSD/xorg-gui/.rerunxsetup
+ fi
 fi
 
+kill -9 ${PID}
+' > /root/.xinitrc
+ chmod 755 /root/.xinitrc
 
-echo "Please wait... Starting X..." >/dev/console
-sleep 1
-# Start the X gui
-/usr/local/bin/startx 2>>${XLOG}
+ 
+ fi
 
 
+ echo "Please wait... Starting X..." >/dev/console
+ sleep 1
+ # Start the X gui
+ /usr/local/bin/startx 2>>${XLOG}
 
-# The user canceled the dialog, and chose to use the default
-if [ -e "/PCBSD/xorg-gui/.canceled" ]
+# if the user chose an nvidia driver and we need to reboot, do it
+if [ -e "/PCBSD/xorg-gui/.nvidiareboot" ]
 then
-  break
+ #### Create the new XF86Config file with the user settings
+ echo "Generating new Xorg configuration file..." >/dev/console
+ /PCBSD/xorg-gui/bin/setupconf.sh >>${XLOG} 2>>${XLOG}
 fi
 
+ # The user canceled the dialog, and chose to use the default
+ if [ -e "/PCBSD/xorg-gui/.canceled" ]
+ then
+   break
+ fi
+
+fi # End of nvidia skip
+
 # Check if a new version of xorg.conf is ready to be tested
 if [ -e "/PCBSD/xorg-gui/.xsettings.sh" ]
 then
 
 rm /PCBSD/xorg-gui/.selected >/dev/null 2>/dev/null
+if [ ! -e "/PCBSD/xorg-gui/.nvidiareboot" ]
+then
+  #### Create the new XF86Config file with the user settings
+  echo "Generating new Xorg configuration file..." >/dev/console
+  /PCBSD/xorg-gui/bin/setupconf.sh >>${XLOG} 2>>${XLOG}
+else
+ # Remove the old nvidareboot file
+ rm /PCBSD/xorg-gui/.nvidiareboot
+fi
 
-#### Create the new XF86Config file with the user settings
-echo "Generating new Xorg configuration file..." >/dev/console
-/PCBSD/xorg-gui/bin/setupconf.sh >>${XLOG} 2>>${XLOG}
-
 ##### Create the xinitrc file
 echo '#!/bin/sh
 /usr/local/bin/fluxbox &

Modified: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-169.12.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-169.12.sh	2008-05-12 01:38:19 UTC (rev 1889)
+++ pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-169.12.sh	2008-05-12 17:03:54 UTC (rev 1890)
@@ -15,7 +15,7 @@
 
 
 # Add the nvidia driver to the system
-pkg_add -f /PCBSD/packages/nvidia-driver-169.12.tbz
+pkg_add -f /PCBSD/packages/nvidia-driver-169.12*.tbz
 pkg_add -f /PCBSD/packages/nvidia-settings*.tbz
 
 #Check if the driver is already loaded
@@ -36,3 +36,11 @@
 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
+
+ls /dev/nvidiactl* >/dev/null
+if [  "$?" != "0" ]
+then
+ echo "Rebooting to load nvidia kernel module..."
+ ( shutdown -r now )&
+ sleep 500
+fi

Modified: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-71.86.04.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-71.86.04.sh	2008-05-12 01:38:19 UTC (rev 1889)
+++ pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-71.86.04.sh	2008-05-12 17:03:54 UTC (rev 1890)
@@ -39,3 +39,11 @@
 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
+
+ls /dev/nvidiactl* >/dev/null
+if [  "$?" != "0" ]
+then
+ echo "Rebooting to load nvidia kernel module..."
+ ( shutdown -r now )&
+ sleep 500
+fi

Modified: pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-96.43.05.sh
===================================================================
--- pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-96.43.05.sh	2008-05-12 01:38:19 UTC (rev 1889)
+++ pcbsd/trunk/system-overlay/PCBSD/xorg-gui/templates/scripts/nvidia-96.43.05.sh	2008-05-12 17:03:54 UTC (rev 1890)
@@ -39,3 +39,11 @@
 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
+
+ls /dev/nvidiactl* >/dev/null
+if [  "$?" != "0" ]
+then
+ echo "Rebooting to load nvidia kernel module..."
+ ( shutdown -r now )&
+ sleep 500
+fi



More information about the Commits mailing list