- Timestamp:
- 05/12/08 10:03:54 (4 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pcbsd/trunk/system-overlay/PCBSD/xorg-gui/bin/rundetect.sh
r697 r1890 25 25 echo "`clear`" >/dev/console 26 26 27 28 echo "Determining monitor refresh rate capabilities..." >/dev/console 29 X -configure 2>/dev/null 30 31 # Clear out any old refresh rates 32 rm /tmp/.horzsync >/dev/null 2>/dev/null 33 rm /tmp/.vertsync >/dev/null 2>/dev/null 34 35 # Check for refresh rate lines 36 cat /root/xorg.conf.new | grep HorizSync >/dev/null 2>/dev/null 37 if [ "$?" = "0" ] 38 then 27 # If we have rebooted for nvidia drivers, skip some inital setup 28 if [ ! -e "/PCBSD/xorg-gui/.nvidiareboot" ] 29 then 30 rm /PCBSD/xorg-gui/.xsettings.sh >/dev/null 2>/dev/null 31 32 # Move any existing xorg.conf file 33 if [ -e "/etc/X11/xorg.conf" ] 34 then 35 mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak 36 fi 37 38 39 echo "Determining monitor refresh rate capabilities..." >/dev/console 40 X -configure 2>/dev/null 41 42 # Clear out any old refresh rates 43 rm /tmp/.horzsync >/dev/null 2>/dev/null 44 rm /tmp/.vertsync >/dev/null 2>/dev/null 45 46 # Check for refresh rate lines 47 cat /root/xorg.conf.new | grep HorizSync >/dev/null 2>/dev/null 48 if [ "$?" = "0" ] 49 then 39 50 cat /root/xorg.conf.new | grep HorizSync > /tmp/.horzsync 40 fi41 42 cat /root/xorg.conf.new | grep VertRefresh >/dev/null 2>/dev/null43 if [ "$?" = "0" ]44 then51 fi 52 53 cat /root/xorg.conf.new | grep VertRefresh >/dev/null 2>/dev/null 54 if [ "$?" = "0" ] 55 then 45 56 cat /root/xorg.conf.new | grep VertRefresh > /tmp/.vertsync 46 fi 57 fi 58 59 fi # End of skip for nvidia reboot 47 60 48 61 echo "Please wait... Start X-Configuration Utility" >/dev/console … … 66 79 cd /root/ 67 80 68 # Move any existing xorg.conf file69 if [ -e "/etc/X11/xorg.conf" ]70 then71 mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak72 fi73 81 74 82 # Recreate our log file … … 81 89 echo "" > ${XLOG} 82 90 91 83 92 # Remove any files from a previous attempt 84 rm /PCBSD/xorg-gui/.done >/dev/null 2>/dev/null85 rm /PCBSD/xorg-gui/.xsettings.sh >/dev/null 2>/dev/null86 93 rm /PCBSD/xorg-gui/.canceled >/dev/null 2>/dev/null 87 94 rm /PCBSD/xorg-gui/.selected >/dev/null 2>/dev/null 95 rm /PCBSD/xorg-gui/.rerunxsetup >/dev/null 2>/dev/null 96 rm /PCBSD/xorg-gui/.done >/dev/null 2>/dev/null 88 97 89 98 … … 98 107 do 99 108 100 # Save the previous xorg.conf file for troubleshooting 101 if [ -e "/etc/X11/xorg.conf" ] 102 then 109 # If we have rebooted for nvidia drivers go straight to confirm screen 110 if [ ! -e "/PCBSD/xorg-gui/.nvidiareboot" ] 111 then 112 # Save the previous xorg.conf file for troubleshooting 113 if [ -e "/etc/X11/xorg.conf" ] 114 then 103 115 mv /etc/X11/xorg.conf /etc/X11/xorg.conf.previous 104 fi116 fi 105 117 106 118 107 119 if [ "${ATTEMPT}" = "0" ] 108 120 then 121 109 122 # Use the saved xorg.conf.basic file 110 123 echo "Using saved /PCBSD/xorg-gui/conf/xorg.conf.basic from install..." >/dev/console 111 124 cp /PCBSD/xorg-gui/conf/xorg.conf.basic /etc/X11/xorg.conf 125 112 126 elif [ "${ATTEMPT}" = "1" ] 113 127 then 128 114 129 # Try running the driver detection again 115 130 rm /etc/X11/xorg.conf 116 131 echo "Saved configuration failed... Running auto-detect..." >/dev/console 117 132 /PCBSD/xorg-gui/cardDetect/x_config.sh 118 else 133 134 else 135 119 136 # Still failed, drop to VESA failsafe 120 137 echo "Auto-detected settings failed... Using failsafe VESA 1024x768 mode..." >/dev/console 121 138 rm /etc/X11/xorg.conf 122 139 cp /PCBSD/xorg-gui/cardDetect/XF86Config.compat /etc/X11/xorg.conf 140 123 141 fi 124 142 … … 129 147 rm /PCBSD/xorg-gui/.failed 130 148 131 ##### Create the xinitrc file132 echo '#!/bin/sh149 ##### Create the xinitrc file 150 echo '#!/bin/sh 133 151 touch /PCBSD/xorg-gui/.xstartupsuccess 134 152 /usr/local/bin/fluxbox & … … 143 161 kill -9 ${PID} 144 162 ' > /root/.xinitrc 145 chmod 755 /root/.xinitrc146 147 else148 149 ##### Create the xinitrc file150 echo '#!/bin/sh163 chmod 755 /root/.xinitrc 164 165 else 166 167 ##### Create the xinitrc file 168 echo '#!/bin/sh 151 169 touch /PCBSD/xorg-gui/.xstartupsuccess 152 170 /usr/local/bin/fluxbox & 153 171 PID=$! 154 #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."155 172 /PCBSD/xorg-gui/bin/XGUI 156 173 if [ "$?" = "1" ] … … 159 176 echo "Canceled" > /PCBSD/xorg-gui/.canceled 160 177 fi 178 179 cat /PCBSD/xorg-gui/.xsettings.sh | grep nvidia >/dev/null 180 if [ "$?" = "0" ] 181 then 182 ls /dev/nvidiactl* >/dev/null 183 if [ "$?" != "0" ] 184 then 185 /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." 186 touch /PCBSD/xorg-gui/.nvidiareboot 187 touch /PCBSD/xorg-gui/.rerunxsetup 188 fi 189 fi 190 161 191 kill -9 ${PID} 162 192 ' > /root/.xinitrc 163 chmod 755 /root/.xinitrc 164 165 166 fi 167 168 169 echo "Please wait... Starting X..." >/dev/console 170 sleep 1 171 # Start the X gui 172 /usr/local/bin/startx 2>>${XLOG} 173 174 175 176 # The user canceled the dialog, and chose to use the default 177 if [ -e "/PCBSD/xorg-gui/.canceled" ] 178 then 179 break 180 fi 193 chmod 755 /root/.xinitrc 194 195 196 fi 197 198 199 echo "Please wait... Starting X..." >/dev/console 200 sleep 1 201 # Start the X gui 202 /usr/local/bin/startx 2>>${XLOG} 203 204 # if the user chose an nvidia driver and we need to reboot, do it 205 if [ -e "/PCBSD/xorg-gui/.nvidiareboot" ] 206 then 207 #### Create the new XF86Config file with the user settings 208 echo "Generating new Xorg configuration file..." >/dev/console 209 /PCBSD/xorg-gui/bin/setupconf.sh >>${XLOG} 2>>${XLOG} 210 fi 211 212 # The user canceled the dialog, and chose to use the default 213 if [ -e "/PCBSD/xorg-gui/.canceled" ] 214 then 215 break 216 fi 217 218 fi # End of nvidia skip 181 219 182 220 # Check if a new version of xorg.conf is ready to be tested … … 185 223 186 224 rm /PCBSD/xorg-gui/.selected >/dev/null 2>/dev/null 187 188 #### Create the new XF86Config file with the user settings 189 echo "Generating new Xorg configuration file..." >/dev/console 190 /PCBSD/xorg-gui/bin/setupconf.sh >>${XLOG} 2>>${XLOG} 225 if [ ! -e "/PCBSD/xorg-gui/.nvidiareboot" ] 226 then 227 #### Create the new XF86Config file with the user settings 228 echo "Generating new Xorg configuration file..." >/dev/console 229 /PCBSD/xorg-gui/bin/setupconf.sh >>${XLOG} 2>>${XLOG} 230 else 231 # Remove the old nvidareboot file 232 rm /PCBSD/xorg-gui/.nvidiareboot 233 fi 191 234 192 235 ##### Create the xinitrc file
