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

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since 9d49c9d was 9d49c9d, checked in by Kris Moore <kris@…>, 13 months ago

Cleanup the install-overlay

  • 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 2>/dev/null`
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  # Ignore X -configure for now, let startx handle it
20  # Now run the X auto-detection
21  #echo "Detecting X Setup..."
22  #sleep 5
23  #HOME="/root" ; export HOME
24  #X -configure >/dev/null 2>&1
25  # Copy over the new xorg.conf
26  #cp /root/xorg.conf.new /etc/X11/xorg.conf
27  # Use nvidia driver
28  #sed -i '' 's|"nv"|"nvidia"|g' /etc/X11/xorg.conf
29
30}
31
32start_xorg()
33{
34  # Run X Now
35  startx
36  if [ ! -e "/tmp/.xstarted" ]
37  then
38    # Failed to start X with detected driver. Now try our detection mode.
39    echo "ERROR: Failed to start X with detected driver... Trying SAFE mode..."
40    rm /etc/X11/xorg.conf
41    X -configure >/dev/null 2>&1
42    # Copy over the new xorg.conf
43    cp /root/xorg.conf.new /etc/X11/xorg.conf
44
45    startx
46    if [ ! -e "/tmp/.xstarted" ]
47    then
48      echo "ERROR: Failed to start X in SAFE mode... Trying VESA mode..."
49      rm /etc/X11/xorg.conf
50      cp /root/cardDetect/XF86Config.compat /etc/X11/xorg.conf
51      startx
52     if [ ! -e "/tmp/.xstarted" ]
53      then
54        # Try the Intel driver, since nvidia/vesa will fail on optimus cards
55        cp /root/cardDetect/XF86Config.intel /etc/X11/xorg.conf
56        startx
57        if [ ! -e "/tmp/.xstarted" ]
58        then
59          echo "ERROR: Failed to start X..."
60          echo "Dropping to failsafe console... Edit /etc/X11/xorg.conf, and run #startx to bring up the GUI."
61          echo "[Press Enter to Continue]"
62          read tmp
63          /bin/sh
64        fi
65      fi
66    fi
67  fi
68
69}
Note: See TracBrowser for help on using the repository browser.