[PATCH f17-branch] Fix twisty logic around forcing text mode (#811868)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The existing logic forces text-mode if /usr/bin/Xorg is missing. Except
it doesn't check if you're using VNC first, which caused problems on
certain POWER systems where we're not including Xorg anymore.

We could just add 'and not flags.usevnc' to the if statement but it's
already really, *really* hard to understand what's going on there.

So: this patch cleans up the logic in a way that should be equivalent,
*and* fixes the bug.

A couple notes, if you're checking my work:

- The flags.livecdInstall check was to avoid starting X during liveinst
  (assuming it'd already be running on a live system), so the intent
  there was:
  flags.livecdInstall == flags.preexisting_x11

- The 'isS390' check in the first block was added in commit 4d42471, way
  back in 2004: "enable GUI/VNC installs on mainframe again, there's no
  Xorg binary". So the intent there was:
  isS390 == (flags.preexisting_x11 or flags.usevnc)

Knowing that, you can replace the conditions and do a little juggling
and come up with what I have here. Or something like it.
---
 anaconda |   35 ++++++++++++++++-------------------
 1 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/anaconda b/anaconda
index bf26013..b76af4d 100755
--- a/anaconda
+++ b/anaconda
@@ -507,30 +507,27 @@ def setupDisplay(anaconda, opts):
         log.info("Display mode = %s" % anaconda.displayMode)
         check_memory(anaconda, opts)
 
-        #
-        # now determine if we're going to run in GUI or TUI mode
-        #
-        # if no X server, we have to use text mode
-        if anaconda.displayMode == 'g' and not flags.livecdInstall \
-           and not iutil.isS390() \
-           and not os.access("/usr/bin/Xorg", os.X_OK):
-             stdoutLog.warning(_("Graphical installation is not available. "
-                                 "Starting text mode."))
-             time.sleep(2)
-             anaconda.displayMode = 't'
-
-        # s390/iSeries checks
-        if anaconda.isHeadless and anaconda.displayMode == "g" and not \
-           (flags.preexisting_x11 or flags.usevnc):
+        # Should we try to start Xorg?
+        want_x = anaconda.displayMode == 'g' and \
+                 not (flags.preexisting_x11 or flags.usevnc)
+
+        # X on a headless (e.g. s390) system? Nonsense!
+        if want_x and anaconda.isHeadless:
             stdoutLog.warning(_("DISPLAY variable not set. Starting text mode."))
             anaconda.displayMode = 't'
             graphical_failed = 1
             time.sleep(2)
+            want_x = False
+
+        # Is Xorg is actually available?
+        if want_x and not os.access("/usr/bin/Xorg", os.X_OK):
+            stdoutLog.warning(_("Graphical installation is not available. "
+                                "Starting text mode."))
+            time.sleep(2)
+            anaconda.displayMode = 't'
+            want_x = False
 
-        # if DISPLAY not set either vnc server failed to start or we're not
-        # running on a redirected X display, so start local X server
-        if anaconda.displayMode == 'g' and not flags.preexisting_x11 and \
-           not flags.usevnc:
+        if want_x:
             # The following code depends on no SIGCHLD being delivered,
             # possibly only except the one from a failing X.org. Thus
             # make sure before entering this section that all the other
-- 
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux