source: overlays/install-overlay/root/functions.sh @ 1620346

9.1-release9.2-releasereleng/10.0releng/10.0.1releng/10.0.2
Last change on this file since 1620346 was 1620346, checked in by Kris Moore <kris@…>, 16 months ago

Initial import of PC-BSD /current/ SVN repo

  • Property mode set to 100755
File size: 1.8 KB
Line 
1#!/bin/sh
2# Functions we source for starting the install / live mode
3###########################################################
4
5detect_x() 
6{
7  # Check for VESA support
8  xvesa="NO"
9  v=`/bin/kenv xvesa`
10  if [ $? -eq 0 ]; then
11        xvesa=$v
12  fi
13  # If we are starting in VESA only mode
14  if [ "$xvesa" = "YES" ]; then
15    cp /root/cardDetect/XF86Config.compat /etc/X11/xorg.conf
16    return
17  fi
18
19  # Now run the X auto-detection
20  echo "Detecting X Setup..."
21  sleep 5
22  HOME="/root" ; export HOME
23  X -configure >/dev/null 2>&1
24  # Copy over the new xorg.conf
25  cp /root/xorg.conf.new /etc/X11/xorg.conf
26  # Use nvidia driver
27  sed -i '' 's|"nv"|"nvidia"|g' /etc/X11/xorg.conf
28
29}
30
31start_xorg()
32{
33  # Run X Now
34  startx
35  if [ ! -e "/tmp/.xstarted" ]
36  then
37    # Failed to start X with detected driver. Now try our detection mode.
38    echo "ERROR: Failed to start X with detected driver... Trying SAFE mode..."
39    rm /etc/X11/xorg.conf
40    X -configure >/dev/null 2>&1
41    # Copy over the new xorg.conf
42    cp /root/xorg.conf.new /etc/X11/xorg.conf
43
44    startx
45    if [ ! -e "/tmp/.xstarted" ]
46    then
47      echo "ERROR: Failed to start X in SAFE mode... Trying VESA mode..."
48      rm /etc/X11/xorg.conf
49      cp /root/cardDetect/XF86Config.compat /etc/X11/xorg.conf
50      startx
51     if [ ! -e "/tmp/.xstarted" ]
52      then
53        # Try the Intel driver, since nvidia/vesa will fail on optimus cards
54        cp /root/cardDetect/XF86Config.intel /etc/X11/xorg.conf
55        startx
56        if [ ! -e "/tmp/.xstarted" ]
57        then
58          echo "ERROR: Failed to start X..."
59          echo "Dropping to failsafe console... Edit /etc/X11/xorg.conf, and run #startx to bring up the GUI."
60          echo "[Press Enter to Continue]"
61          read tmp
62          /bin/sh
63        fi
64      fi
65    fi
66  fi
67
68}
Note: See TracBrowser for help on using the repository browser.