[PC-BSD Commits] r7210 - in pcbsd/current/XGUISource: . resources/bin resources/cardDetect resources/nvidia-detect

svn at pcbsd.org svn at pcbsd.org
Wed Jul 14 11:47:17 PDT 2010


Author: kris
Date: 2010-07-14 11:47:17 -0700 (Wed, 14 Jul 2010)
New Revision: 7210

Modified:
   pcbsd/current/XGUISource/resources/bin/rundetect.sh
   pcbsd/current/XGUISource/resources/bin/setupconf.sh
   pcbsd/current/XGUISource/resources/cardDetect/x_config.sh
   pcbsd/current/XGUISource/resources/nvidia-detect/detect-nvidia.sh
   pcbsd/current/XGUISource/xgui.cpp
Log:

Update support / helper scripts for XGUI to use new locations



Modified: pcbsd/current/XGUISource/resources/bin/rundetect.sh
===================================================================
--- pcbsd/current/XGUISource/resources/bin/rundetect.sh	2010-07-14 18:25:14 UTC (rev 7209)
+++ pcbsd/current/XGUISource/resources/bin/rundetect.sh	2010-07-14 18:47:17 UTC (rev 7210)
@@ -15,17 +15,24 @@
 HOME="/root" ; export HOME
 
 # Set the log file location
-XLOG="/usr/PCBSD/tmp/xsetup.log" ; export XLOG
+XLOG="/tmp/xsetup.log" ; export XLOG
 
 # Source the language version
 . /usr/PCBSD/LANGS/PCBSDLANG 2>/dev/null
 
 # Program Directory
-PROGDIR="/usr/PCBSD/xorg-gui" ; export PROGDIR
+PROGDIR="/usr/local/share/xorg-gui" ; export PROGDIR
 
+XGUITMP="/tmp/.xgui" ; export XGUITMP
+
 ###############################################################################
 # Start the script now
 
+# Init our tmpdir
+if [ ! -d "${XGUITMP}" ] ; then
+	mkdir -p ${XGUITMP}
+fi
+
 echo "`clear`" >/dev/console
 
 # Move any existing xorg.conf file
@@ -56,7 +63,7 @@
 fi
 
 rm -rf /root/.fluxbox
-cp -R /usr/PCBSD/xorg-gui/conf/.fluxbox /root/.fluxbox
+cp -R ${PROGDIR}/conf/.fluxbox /root/.fluxbox
 
 cd /root/
 
@@ -72,10 +79,10 @@
 
 
 # Remove any files from a previous attempt
-rm /usr/PCBSD/xorg-gui/.canceled >/dev/null 2>/dev/null
-rm /usr/PCBSD/xorg-gui/.selected >/dev/null 2>/dev/null
-rm /usr/PCBSD/xorg-gui/.rerunxsetup >/dev/null 2>/dev/null
-rm /usr/PCBSD/xorg-gui/.done >/dev/null 2>/dev/null
+rm ${XGUITMP}/.canceled >/dev/null 2>/dev/null
+rm ${XGUITMP}/.selected >/dev/null 2>/dev/null
+rm ${XGUITMP}/.rerunxsetup >/dev/null 2>/dev/null
+rm ${XGUITMP}/.done >/dev/null 2>/dev/null
 
 
 # Set the attempt number to 0
@@ -98,26 +105,26 @@
   if [ "${ATTEMPT}" = "0" ]
   then
     # Use the saved xorg.conf.basic file
-    echo "Using saved /usr/PCBSD/xorg-gui/conf/xorg.conf.basic from install..." >/dev/console
-    cp /usr/PCBSD/xorg-gui/conf/xorg.conf.basic /etc/X11/xorg.conf
+    echo "Using saved ${PROGDIR}/conf/xorg.conf.basic from install..." >/dev/console
+    cp ${PROGDIR}/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
-    /usr/PCBSD/xorg-gui/cardDetect/x_config.sh
+    ${PROGDIR}/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 /usr/PCBSD/xorg-gui/cardDetect/XF86Config.compat /etc/X11/xorg.conf
+    cp ${PROGDIR}/cardDetect/XF86Config.compat /etc/X11/xorg.conf
   fi
 
 
   # Check if the previous attempt failed
-  if [ -e "/usr/PCBSD/xorg-gui/.failed" ]
+  if [ -e "${XGUITMP}/.failed" ]
   then
-    rm /usr/PCBSD/xorg-gui/.failed
+    rm ${XGUITMP}/.failed
     ##### Create the xinitrc file
     echo '#!/bin/sh
 
@@ -130,15 +137,15 @@
 . /root/.xprofile
 fi
 
-touch /usr/PCBSD/xorg-gui/.xstartupsuccess
+touch ${XGUITMP}/.xstartupsuccess
 /usr/local/bin/fluxbox &
 PID=$!
 /usr/local/kde4/bin/kdialog --msgbox "The previous attempt failed, please check your settings and try again!"
-/usr/PCBSD/xorg-gui/bin/XGUI
+/usr/local/bin/pc-xgui
 if [ "$?" = "1" ]
 then
  /usr/local/kde4/bin/kdialog --msgbox "PC-BSD will now load using the default resolution."
- echo "Canceled" > /usr/PCBSD/xorg-gui/.canceled
+ echo "Canceled" > ${XGUITMP}/.canceled
 fi
 kill -9 ${PID}
 ' > /root/.xinitrc
@@ -157,14 +164,14 @@
 . /root/.xprofile
 fi
 
-touch /usr/PCBSD/xorg-gui/.xstartupsuccess
+touch ${XGUITMP}/.xstartupsuccess
 /usr/local/bin/fluxbox &
 PID=$!
-/usr/PCBSD/xorg-gui/bin/XGUI
+/usr/local/bin/pc-xgui
 if [ "$?" = "1" ]
 then
  /usr/local/kde4/bin/kdialog --msgbox "PC-BSD will now load using the default resolution."
- echo "Canceled" > /usr/PCBSD/xorg-gui/.canceled
+ echo "Canceled" > ${XGUITMP}/.canceled
 fi
 
 kill -9 ${PID}
@@ -179,20 +186,20 @@
   /usr/local/bin/startx 2>>${XLOG}
 
   # The user canceled the dialog, and chose to use the default
-  if [ -e "/usr/PCBSD/xorg-gui/.canceled" ]
+  if [ -e "${XGUITMP}/.canceled" ]
   then
     break
   fi
 
 
   # Check if a new version of xorg.conf is ready to be tested
-  if [ -e "/usr/PCBSD/xorg-gui/.xsettings.sh" ]
+  if [ -e "${XGUITMP}/.xsettings.sh" ]
   then
-    rm /usr/PCBSD/xorg-gui/.selected >/dev/null 2>/dev/null
+    rm ${XGUITMP}/.selected >/dev/null 2>/dev/null
 
     #### Create the new XF86Config file with the user settings
     echo "Generating new Xorg configuration file..." >/dev/console
-    /usr/PCBSD/xorg-gui/bin/setupconf.sh >>${XLOG} 2>>${XLOG}
+    ${PROGDIR}/bin/setupconf.sh >>${XLOG} 2>>${XLOG}
 
     ##### Create the xinitrc file
     echo '#!/bin/sh
@@ -204,10 +211,10 @@
 
 /usr/local/bin/fluxbox &
 PID=$!
-/usr/PCBSD/xorg-gui/bin/XGUI -test
+/usr/local/bin/pc-xgui -test
 if [ "${?}" = "0" ]
 then
- echo "selected" > /usr/PCBSD/xorg-gui/.selected
+ echo "selected" > ${XGUITMP}/.selected
 fi
 kill -9 ${PID}
 ' > /root/.xinitrc
@@ -219,30 +226,30 @@
 
   fi
 
-  if [ -e "/usr/PCBSD/xorg-gui/.selected" ]
+  if [ -e "${XGUITMP}/.selected" ]
   then
     break
   else
-    echo "failed" > /usr/PCBSD/xorg-gui/.failed 
+    echo "failed" > ${XGUITMP}/.failed 
   fi
 
   # Check if the X startup was a success
-  if [ ! -e "/usr/PCBSD/xorg-gui/.xstartupsuccess" ]
+  if [ ! -e "${XGUITMP}/.xstartupsuccess" ]
   then
     ATTEMPT="`expr $ATTEMPT + 1`"
-    rm /usr/PCBSD/xorg-gui/.failed
+    rm ${XGUITMP}/.failed
   else
-    rm /usr/PCBSD/xorg-gui/.xstartupsuccess
+    rm ${XGUITMP}/.xstartupsuccess
   fi
 
   # Removed any saved settings file
-  rm /usr/PCBSD/xorg-gui/.xsettings.sh
+  rm ${XGUITMP}/.xsettings.sh
 
 done
 
 
 # Copy over the right ttys file now
-cp /usr/PCBSD/xorg-gui/conf/ttys.normal /etc/ttys
+cp ${PROGDIR}/conf/ttys.normal /etc/ttys
 
 rm /root/.xinitrc >/dev/null 2>/dev/null
 # Check if we need to save an existing .xinitrc file
@@ -258,8 +265,8 @@
   mv /root/.fluxbox.xbak /root/.fluxbox
 fi
 
-rm /usr/PCBSD/xorg-gui/.rerunxsetup >/dev/null 2>/dev/null
-rm /usr/PCBSD/xorg-gui/.skipauto >/dev/null 2>/dev/null
+rm ${XGUITMP}/.rerunxsetup >/dev/null 2>/dev/null
+rm ${XGUITMP}/.skipauto >/dev/null 2>/dev/null
 echo "Preparing to start the desktop..." >/dev/console
 sleep 1
 kill -HUP 1

Modified: pcbsd/current/XGUISource/resources/bin/setupconf.sh
===================================================================
--- pcbsd/current/XGUISource/resources/bin/setupconf.sh	2010-07-14 18:25:14 UTC (rev 7209)
+++ pcbsd/current/XGUISource/resources/bin/setupconf.sh	2010-07-14 18:47:17 UTC (rev 7210)
@@ -1,32 +1,34 @@
 #!/bin/sh
 
+XGUITMP="/tmp/.xgui" ; export XGUITMP
+
 # Source the settings file
-chmod 755 /usr/PCBSD/xorg-gui/.xsettings.sh
-. /usr/PCBSD/xorg-gui/.xsettings.sh
+chmod 755 ${XGUITMP}/.xsettings.sh
+. ${XGUITMP}/.xsettings.sh
 
 # Program Directory
-PROGDIR="/usr/PCBSD/xorg-gui" ; export PROGDIR
+PROGDIR="/usr/local/share/xorg-gui" ; export PROGDIR
 
 # Set the tmp xorg file
-TMPFILE="/usr/PCBSD/xorg-gui/.xorg.conf.tmp"
+TMPFILE="${XGUITMP}/.xorg.conf.tmp"
 
 # Get the real driver name and save the value from xorg-gui
 SELDRIVER="${DRIVER}" ; export SELDRIVER
-grep "^${DRIVER}:" /usr/PCBSD/xorg-gui/settings/alias.txt >/dev/null 2>/dev/null
+grep "^${DRIVER}:" ${PROGDIR}/settings/alias.txt >/dev/null 2>/dev/null
 if [ "$?" = "0" ]
 then
-  DRIVER=`cat /usr/PCBSD/xorg-gui/settings/alias.txt | grep "^${DRIVER}:" | cut -d ":" -f 2`
+  DRIVER=`cat ${PROGDIR}/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 "/usr/PCBSD/xorg-gui/templates/header/${DRIVER}.xorg.conf" ]
+if [ -e "${PROGDIR}/templates/header/${DRIVER}.xorg.conf" ]
 then
-  cp "/usr/PCBSD/xorg-gui/templates/header/${DRIVER}.xorg.conf" $TMPFILE 
+  cp "${PROGDIR}/templates/header/${DRIVER}.xorg.conf" $TMPFILE 
 else
-  cp /usr/PCBSD/xorg-gui/templates/header/xorg.conf.generic $TMPFILE 
+  cp ${PROGDIR}/templates/header/xorg.conf.generic $TMPFILE 
 fi
 
 
@@ -166,7 +168,7 @@
 
 
 # Copy over the defined template options for the specific driver
-cat /usr/PCBSD/xorg-gui/templates/driver/${DRIVER}.template >>$TMPFILE
+cat ${PROGDIR}/templates/driver/${DRIVER}.template >>$TMPFILE
 
 # Check if we have a cardbus variable
 CARDBUS="`${PROGDIR}/scripts/cardbus.sh`"
@@ -295,9 +297,9 @@
 
 
 # See if this driver needs any post-setup operations to run
-if [ -e "/usr/PCBSD/xorg-gui/templates/scripts/${DRIVER}.sh" ]
+if [ -e "${PROGDIR}/templates/scripts/${DRIVER}.sh" ]
 then
   # We found the file, so run it
-  sh "/usr/PCBSD/xorg-gui/templates/scripts/${DRIVER}.sh" "${SELDRIVER}"
+  sh "${PROGDIR}/templates/scripts/${DRIVER}.sh" "${SELDRIVER}"
 fi
 

Modified: pcbsd/current/XGUISource/resources/cardDetect/x_config.sh
===================================================================
--- pcbsd/current/XGUISource/resources/cardDetect/x_config.sh	2010-07-14 18:25:14 UTC (rev 7209)
+++ pcbsd/current/XGUISource/resources/cardDetect/x_config.sh	2010-07-14 18:47:17 UTC (rev 7210)
@@ -7,8 +7,8 @@
 
 XFREE_CONF="/etc/X11/xorg.conf"
 XFREE_NEWCONF="/root/xorg.conf.new"
-XFREE_TMPCONF="/usr/PCBSD/xorg-gui/cardDetect/XF86Config.default"
-XFREE_VMWARE="/usr/PCBSD/xorg-gui/cardDetect/XF86Config.vmware"
+XFREE_TMPCONF="/usr/local/share/xorg-gui/cardDetect/XF86Config.default"
+XFREE_VMWARE="/usr/local/share/xorg-gui/cardDetect/XF86Config.vmware"
 
 if [ -f ${XFREE_CONF} ]; then
 	echo "Found config file \"${XFREE_CONF}\" - skiping autoconfiguration."

Modified: pcbsd/current/XGUISource/resources/nvidia-detect/detect-nvidia.sh
===================================================================
--- pcbsd/current/XGUISource/resources/nvidia-detect/detect-nvidia.sh	2010-07-14 18:25:14 UTC (rev 7209)
+++ pcbsd/current/XGUISource/resources/nvidia-detect/detect-nvidia.sh	2010-07-14 18:47:17 UTC (rev 7210)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Script which checks the nvidia cards PCIID and figures out which driver it needs
 ##################################################################################
-PROGDIR="/usr/PCBSD/xorg-gui"
+PROGDIR="/usr/local/share/xorg-gui"
 
 NV17FILE="${PROGDIR}/nvidia-detect/nvidia17-pciid.txt"
 NV9XFILE="${PROGDIR}/nvidia-detect/nvidia9x-pciid.txt"

Modified: pcbsd/current/XGUISource/xgui.cpp
===================================================================
--- pcbsd/current/XGUISource/xgui.cpp	2010-07-14 18:25:14 UTC (rev 7209)
+++ pcbsd/current/XGUISource/xgui.cpp	2010-07-14 18:47:17 UTC (rev 7210)
@@ -13,9 +13,11 @@
 #include <qfile.h>
 #include <qmessagebox.h>
 #include <QTextStream>
+#include <QDir>
 #include <QDebug>
 
-#define PROGDIR QString("/usr/PCBSD/xorg-gui")
+#define PROGDIR QString("/usr/local/share/xorg-gui")
+#define TMPDIR QString("/tmp/.xgui")
 
 
 void XGUI::ProgramInit()
@@ -252,8 +254,12 @@
 {
 	QString tmp;
 
+ 	// Make sure the TMPDIR exists
+	QDir ctmp(TMPDIR);
+	if ( ! ctmp.exists() )
+		ctmp.mkdir(TMPDIR);
 
-	QFile file( PROGDIR + "/.xsettings.sh" );
+	QFile file( TMPDIR + "/.xsettings.sh" );
     	if ( file.open( QIODevice::WriteOnly ) ) {
         QTextStream stream( &file );
             stream << "#!/bin/sh\n";



More information about the Commits mailing list