[PATCH][master][RHEL] move Xorg test up so we might start vnc instead

Mark Hamzy hamzy at us.ibm.com
Fri Mar 15 15:28:45 UTC 2013


Move the want_x set and check up so that, if disabled, we might still start
the VNC pathway instead. We do not need X for that path.

Also, add so more warning messages so we might know why exactly we are not
going to ask for the VNC path.

---
 anaconda | 47 ++++++++++++++++++++++++++---------------------
 1 file changed, 26 insertions(+), 21 deletions(-)

diff --git a/anaconda b/anaconda
index 604ad1d..a4fdefa 100755
--- a/anaconda
+++ b/anaconda
@@ -469,47 +469,32 @@ def setupDisplay(anaconda, opts, addon_paths=None):
 
     # disable VNC over text question when not enough memory is available
     if blivet.util.total_memory() < isys.MIN_GUI_RAM:
+        stdoutLog.warning("Not asking for VNC because current memory (%d) < MIN_GUI_RAM (%d)" % (iutil.memInstalled(), isys.MIN_GUI_RAM))
         flags.vncquestion = False
 
     # disable VNC question if text mode is requested and this is a ks install
     if anaconda.displayMode == 't' and flags.automatedInstall:
+        stdoutLog.warning("Not asking for VNC because of an automated install")
         flags.vncquestion = False
 
     # disable VNC question if we were explicitly asked for text in kickstart
     if anaconda.ksdata.displaymode.displayMode == DISPLAY_MODE_TEXT:
+        stdoutLog.warning("Not asking for VNC because text mode was explicitly asked for in kickstart")
         flags.vncquestion = False
 
     # disable VNC question if we don't have network
     if not nm_is_connected():
+        stdoutLog.warning("Not asking for VNC because we don't have a network")
         flags.vncquestion = False
 
-    # disable VNC question if we don't have X
+    # disable VNC question if we don't have Xvnc
     if not os.access('/usr/bin/Xvnc', os.X_OK):
+        stdoutLog.warning("Not asking for VNC because we don't have Xvnc")
         flags.vncquestion = False
 
     if os.environ.has_key('DISPLAY'):
         flags.preexisting_x11 = True
 
-    if anaconda.displayMode == 't' and flags.vncquestion:
-        #we prefer vnc over text mode, so ask about that
-        message = _("Text mode provides a limited set of installation "
-                    "options. It does not allow you to specify your "
-                    "own partitioning layout or package selections. "
-                    "Would you like to use VNC mode instead?")
-
-        app = App("VNC Question")
-        spoke = AskVNCSpoke(app, anaconda.ksdata, message=message)
-        app.schedule_screen(spoke)
-        app.run()
-
-        if anaconda.ksdata.vnc.enabled:
-            anaconda.displayMode = 'g'
-            flags.usevnc = 1
-            vncS.password = anaconda.ksdata.vnc.password
-
-    log.info("Display mode = %s" % anaconda.displayMode)
-    check_memory(anaconda, opts)
-
     # Should we try to start Xorg?
     want_x = anaconda.displayMode == 'g' and \
              not (flags.preexisting_x11 or flags.usevnc)
@@ -530,6 +515,26 @@ def setupDisplay(anaconda, opts, addon_paths=None):
         anaconda.displayMode = 't'
         want_x = False
 
+    if anaconda.displayMode == 't' and flags.vncquestion:
+        #we prefer vnc over text mode, so ask about that
+        message = _("Text mode provides a limited set of installation "
+                    "options. It does not allow you to specify your "
+                    "own partitioning layout or package selections. "
+                    "Would you like to use VNC mode instead?")
+
+        app = App("VNC Question")
+        spoke = AskVNCSpoke(app, anaconda.ksdata, message=message)
+        app.schedule_screen(spoke)
+        app.run()
+
+        if anaconda.ksdata.vnc.enabled:
+            anaconda.displayMode = 'g'
+            flags.usevnc = 1
+            vncS.password = anaconda.ksdata.vnc.password
+
+    log.info("Display mode = %s" % anaconda.displayMode)
+    check_memory(anaconda, opts)
+
     if want_x:
         # The following code depends on no SIGCHLD being delivered,
         # possibly only except the one from a failing X.org. Thus
-- 
1.8.1.2



More information about the anaconda-patches mailing list