[PC-BSD Commits] r15373 - in pcbsd/current/src-qt4/pc-xgui/resources: bin scripts

svn at pcbsd.org svn at pcbsd.org
Wed Feb 15 12:11:42 PST 2012


Author: kris
Date: 2012-02-15 20:11:41 +0000 (Wed, 15 Feb 2012)
New Revision: 15373

Added:
   pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-autodetect
   pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-check
   pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-displaywiz
   pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-failed
Modified:
   pcbsd/current/src-qt4/pc-xgui/resources/bin/rundetect.sh
Log:

Improve the xorg display wizard, now we rely on xorg to auto-detect the best
settings initially, and only prompt the user to accept them via yes/no. If
no, then the display wizard will show up and let them make changes. 

Also improved the dialogs shown. 



Modified: pcbsd/current/src-qt4/pc-xgui/resources/bin/rundetect.sh
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/resources/bin/rundetect.sh	2012-02-15 19:19:25 UTC (rev 15372)
+++ pcbsd/current/src-qt4/pc-xgui/resources/bin/rundetect.sh	2012-02-15 20:11:41 UTC (rev 15373)
@@ -42,8 +42,7 @@
 echo "`clear`" >/dev/console
 
 # Move any existing xorg.conf file
-if [ -e "/etc/X11/xorg.conf" ]
-then
+if [ -e "/etc/X11/xorg.conf" ] ; then
    mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
 fi
 
@@ -57,14 +56,12 @@
 echo "Please wait... Start X-Configuration Utility" >/dev/console
 
 # Check if we need to save an existing .xinitrc file
-if [ -e "/root/.xinitrc" ]
-then
+if [ -e "/root/.xinitrc" ] ; then
  mv /root/.xinitrc /root/.xinitrc.xbak
 fi
 
 # Check if we need to move the .fluxbox profile
-if [ -e "/root/.fluxbox" ]
-then
+if [ -e "/root/.fluxbox" ] ; then
   rm -rf /root/.fluxbox.xbak 2>/dev/null
   mv /root/.fluxbox /root/.fluxbox.xbak 2>/dev/null
 fi
@@ -76,8 +73,7 @@
 
 
 # Recreate our log file
-if [ -e "${XLOG}" ]
-then
+if [ -e "${XLOG}" ] ; then
   mv ${XLOG} ${XLOG}.old
 fi
 
@@ -90,6 +86,7 @@
 rm ${XGUITMP}/.selected >/dev/null 2>/dev/null
 rm ${XGUITMP}/.rerunxsetup >/dev/null 2>/dev/null
 rm ${XGUITMP}/.done >/dev/null 2>/dev/null
+rm ${XGUITMP}/.failed >/dev/null 2>/dev/null
 
 
 # Set the attempt number to 0
@@ -103,111 +100,71 @@
 do
 
   # 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
+  if [ -e "/etc/X11/xorg.conf" ] ; then mv /etc/X11/xorg.conf /etc/X11/xorg.conf.previous ; fi
 
+  #  Don't keep displaying the autores question
+  AUTORES="NO"
 
-  if [ "${ATTEMPT}" = "0" ]
-  then
+  if [ "${ATTEMPT}" = "0" ] ; then
+    # Check if we are supposed to run in vesa mode
     xvesa="NO"
     v=`kenv xvesa`
-    if [ $? -eq 0 ]; then
-       xvesa=$v
-    fi
+    if [ $? -eq 0 ]; then xvesa=$v ; fi
 
     # Check if user requested to run in vesa mode specifically and do it
     if [ "$xvesa" = "YES" ] ; then
       echo "Using failsafe VESA 1024x768 mode..." >/dev/console
       cp ${PROGDIR}/cardDetect/XF86Config.compat /etc/X11/xorg.conf
     else
-      # Use the saved xorg.conf.basic file
-      echo "Using saved ${PROGDIR}/conf/xorg.conf.basic from install..." >/dev/console
-      cp ${PROGDIR}/conf/xorg.conf.basic /etc/X11/xorg.conf
+      # Now run the X auto-detection
+      echo "Detecting X Setup..."
+      sleep 1
+      HOME="/root" ; export HOME
+      X -configure >/dev/null 2>&1
+      # Copy over the new xorg.conf
+      cp /root/xorg.conf.new /etc/X11/xorg.conf
+      AUTORES="YES"
     fi
-  elif [ "${ATTEMPT}" = "1" ]
-  then
+  elif [ "${ATTEMPT}" = "1" ] ; then
     # Try running the driver detection again
     rm /etc/X11/xorg.conf
-    echo "Saved configuration failed... Running auto-detect..." >/dev/console
+    echo "Saved configuration failed... Running failsafe-detect..." >/dev/console
     ${PROGDIR}/cardDetect/x_config.sh
   else
     # Still failed, drop to VESA failsafe
-    echo "Auto-detected settings failed... Using failsafe VESA 1024x768 mode..." >/dev/console
+    echo "Detected settings failed... Using failsafe VESA 1024x768 mode..." >/dev/console
     rm /etc/X11/xorg.conf
     cp ${PROGDIR}/cardDetect/XF86Config.compat /etc/X11/xorg.conf
   fi
 
+  # Setup touch-screen support
+  ${PROGDIR}/bin/setuptouch.sh /etc/X11/xorg.conf
 
   # Check if the previous attempt failed
   if [ -e "${XGUITMP}/.failed" ]
   then
+  # Failed display, show the failed screen
     rm ${XGUITMP}/.failed
-    ##### Create the xinitrc file
-    echo '#!/bin/sh
-
-# Set all our path variables
-PATH="/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/bin:/usr/local/sbin"
-export PATH
-
-if [ -e "/root/.xprofile" ]
-then
-. /root/.xprofile
-fi
-
-touch ${XGUITMP}/.xstartupsuccess
-/usr/local/bin/startfluxbox &
-PID=$!
-/usr/local/bin/pc-xgui
-if [ "$?" = "1" ]
-then
- echo "Canceled" > ${XGUITMP}/.canceled
-fi
-kill -9 ${PID}
-' > /root/.xinitrc
+    cp ${PROGDIR}/scripts/xinit-failed /root/.xinitrc
     chmod 755 /root/.xinitrc
-
+  elif [ "$AUTORES" = "YES" ] ; then
+  # First time running, ask user if they want to use auto-detected resolution
+    cp ${PROGDIR}/scripts/xinit-autodetect /root/.xinitrc
+    chmod 755 /root/.xinitrc
   else
-    ##### Create the xinitrc file
-    echo '#!/bin/sh
-
-# Set all our path variables
-PATH="/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/bin:/usr/local/sbin"
-export PATH
-
-if [ -e "/root/.xprofile" ]
-then
-. /root/.xprofile
-fi
-
-touch ${XGUITMP}/.xstartupsuccess
-/usr/local/bin/startfluxbox &
-PID=$!
-/usr/local/bin/pc-xgui
-if [ "$?" = "1" ]
-then
- echo "Canceled" > ${XGUITMP}/.canceled
-fi
-
-kill -9 ${PID}
-' > /root/.xinitrc
+  # Did not fail, create normal config
+    cp ${PROGDIR}/scripts/xinit-displaywiz /root/.xinitrc
     chmod 755 /root/.xinitrc
   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 "${XGUITMP}/.canceled" ]
-  then
-    break
-  fi
+  if [ -e "${XGUITMP}/.canceled" ] ; then break ; fi
 
-
   # Check if a new version of xorg.conf is ready to be tested
   if [ -e "${XGUITMP}/.xsettings.sh" ]
   then
@@ -217,41 +174,23 @@
     echo "Generating new Xorg configuration file..." >/dev/console
     ${PROGDIR}/bin/setupconf.sh >>${XLOG} 2>>${XLOG}
 
-    ##### Create the xinitrc file
-    echo '#!/bin/sh
-
-if [ -e "/root/.xprofile" ]
-then
-. /root/.xprofile
-fi
-
-/usr/local/bin/startfluxbox &
-PID=$!
-/usr/local/bin/pc-xgui -test
-if [ "${?}" = "0" ]
-then
- echo "selected" > ${XGUITMP}/.selected
-fi
-kill -9 ${PID}
-' > /root/.xinitrc
+    ##### Copy the xinitrc file
+    cp ${PROGDIR}/scripts/xinit-check /root/.xinitrc
     chmod 755 /root/.xinitrc
 
     echo "Please wait... Starting X..." >/dev/console
     sleep 1
     /usr/local/bin/startx 2>>${XLOG}
-
   fi
 
-  if [ -e "${XGUITMP}/.selected" ]
-  then
+  if [ -e "${XGUITMP}/.selected" ] ; then
     break
   else
     echo "failed" > ${XGUITMP}/.failed 
   fi
 
   # Check if the X startup was a success
-  if [ ! -e "${XGUITMP}/.xstartupsuccess" ]
-  then
+  if [ ! -e "${XGUITMP}/.xstartupsuccess" ] ; then
     ATTEMPT="`expr $ATTEMPT + 1`"
     rm ${XGUITMP}/.failed
   else
@@ -273,14 +212,12 @@
 
 rm /root/.xinitrc >/dev/null 2>/dev/null
 # Check if we need to save an existing .xinitrc file
-if [ -e "/root/.xinitrc.xbak" ]
-then
+if [ -e "/root/.xinitrc.xbak" ] ; then
    mv /root/.xinitrc.xbak /etc/.xinitrc
 fi
 
 # Check if we need to move the .fluxbox profile
-if [ -e "/root/.fluxbox.xbak" ]
-then
+if [ -e "/root/.fluxbox.xbak" ] ; then
   rm -rf /root/.fluxbox >/dev/null 2>/dev/null
   mv /root/.fluxbox.xbak /root/.fluxbox
 fi

Index: pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-autodetect
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-autodetect	2012-02-15 19:19:25 UTC (rev 15372)
+++ pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-autodetect	2012-02-15 20:11:41 UTC (rev 15373)

Property changes on: pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-autodetect
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
Index: pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-check
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-check	2012-02-15 19:19:25 UTC (rev 15372)
+++ pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-check	2012-02-15 20:11:41 UTC (rev 15373)

Property changes on: pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-check
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
Index: pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-displaywiz
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-displaywiz	2012-02-15 19:19:25 UTC (rev 15372)
+++ pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-displaywiz	2012-02-15 20:11:41 UTC (rev 15373)

Property changes on: pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-displaywiz
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
Index: pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-failed
===================================================================
--- pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-failed	2012-02-15 19:19:25 UTC (rev 15372)
+++ pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-failed	2012-02-15 20:11:41 UTC (rev 15373)

Property changes on: pcbsd/current/src-qt4/pc-xgui/resources/scripts/xinit-failed
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*


More information about the Commits mailing list