summaryrefslogtreecommitdiffstats
path: root/xserver.py
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2001-07-18 16:54:43 +0000
committerMike Fulbright <msf@redhat.com>2001-07-18 16:54:43 +0000
commit682d4a759e8c87c289f8d13b6c16913e27c0c3c8 (patch)
tree768fb74d0f8ef2fd654aaf3388ef2d1ae8e656f0 /xserver.py
parent128898d8e0937e908f157950b79017b66a33c31e (diff)
downloadanaconda-682d4a759e8c87c289f8d13b6c16913e27c0c3c8.tar.gz
anaconda-682d4a759e8c87c289f8d13b6c16913e27c0c3c8.tar.xz
anaconda-682d4a759e8c87c289f8d13b6c16913e27c0c3c8.zip
rewrote way we fallback from fb to native card to vga16, still has some glitches but better than nested try/excepts before
Diffstat (limited to 'xserver.py')
-rw-r--r--xserver.py90
1 files changed, 46 insertions, 44 deletions
diff --git a/xserver.py b/xserver.py
index 9b0997b22..c859c78bb 100644
--- a/xserver.py
+++ b/xserver.py
@@ -87,56 +87,58 @@ def startX(resolution, nofbmode, video, monitor, mouse):
#--see if framebuffer works on this card
fbavail = isys.fbinfo()
- if fbavail and nofbmode == 0 and canUseFrameBuffer(video.primaryCard()):
- card = FrameBufferCard()
- serverPath = '/usr/X11R6/bin/' + card.getXServer()
+ if fbavail:
+ attempt = 'FB'
else:
- card = None
- if video.primaryCard():
- fallbackcard = video.primaryCard()
- else:
- # if no xserver then try falling back to VGA16 in no fb
- fallbackcard = VGA16Card()
+ attempt = 'PROBED'
-# x = XF86Config (card, monitor, mouse, resolution)
-
- #--If framebuffer server isn't there...try original probed server
- if card and not os.access (serverPath, os.X_OK) and fallbackcard != None:
- serverPath = '/usr/X11R6/bin/' + fallbackcard.getXServer()
-
- #--If original server isn't there...send them to text mode
- if not os.access (serverPath, os.X_OK):
- raise RuntimeError, "No X server binaries found to run"
+ failed = 1
+ next_attempt = None
+ while next_attempt != 'END':
+ card = None
+ if attempt == 'FB':
+ if fbavail and nofbmode == 0 and canUseFrameBuffer(video.primaryCard()):
+ print _("Attempting to start framebuffer based X server")
+ card = FrameBufferCard()
+ else:
+ card = None
- if card:
- try:
- #-- If can't access /dev/fb0, we're not in framebuffer mode
- fbdevice = open("/dev/fb0", "r")
- fbdevice.close()
-
- x = XF86Config (card, monitor, mouse, resolution)
- testx(x)
+ next_attempt = 'PROBED'
+ elif attempt == 'PROBED':
+ if video.primaryCard():
+ print _("Attempting to start native X server")
+ card = video.primaryCard()
+ else:
+ card = None
+ next_attempt = 'VGA16'
+ elif attempt == 'VGA16':
+ # if no xserver then try falling back to VGA16 in no fb
+ card = VGA16Card()
+ print _("Attempting to start VGA16 X server")
+ next_attempt = 'END'
+ else:
+ print "Got off end somehow!"
+ break
+
+ if card and card.getXServer() != None:
+ serverPath = '/usr/X11R6/bin/' + card.getXServer()
+
+ if os.access (serverPath, os.X_OK):
+ try:
+ x = XF86Config (card, monitor, mouse, resolution)
+ testx(x)
+ failed = 0
+ break
- except (RuntimeError, IOError):
- if fallbackcard == None:
- raise RuntimeError, "Unable to start X for unknown card"
-
- x = XF86Config (fallbackcard, monitor, mouse, resolution)
+ except (RuntimeError, IOError):
+ pass
- # if this fails, we want the exception to go back to anaconda to
- # it knows that this didn't work
- testx(x)
-
- else: #-We're in nofb mode
- if fallbackcard == None:
- raise RuntimeError, "Unable to start X for unknown card"
-
- x = XF86Config (fallbackcard, monitor, mouse, resolution)
+ attempt = next_attempt
- # if this fails, we want the exception to go back to anaconda to
- # it knows that this didn't work
- testx(x)
-
+ #--If original server isn't there...send them to text mode
+ if failed:
+ raise RuntimeError, "No X server binaries found to run"
+
return x
def canUseFrameBuffer (videocard):