[master] fix: do not initialize the install interface whenever is is accessed (#565872)

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

 



This problem has been present after 39a52ed1ddb2c. VNC+kickstart with %pre
script installs were crashing due to attempt to use X server to early.
---
 anaconda |   65 +++++++++++++++++++++++++++++++++----------------------------
 1 files changed, 35 insertions(+), 30 deletions(-)

diff --git a/anaconda b/anaconda
index 7bac8ce..116c54f 100755
--- a/anaconda
+++ b/anaconda
@@ -514,36 +514,6 @@ class Anaconda(object):
         return self._instLanguage
 
     def _getInterface(self):
-        if self._intf:
-            return self._intf
-
-        # setup links required by graphical mode if installing and verify display mode
-        if self.displayMode == 'g':
-            stdoutLog.info (_("Starting graphical installation."))
-
-            try:
-                from gui import InstallInterface
-            except Exception, e:
-                stdoutLog.error("Exception starting GUI installer: %s" %(e,))
-                # if we're not going to really go into GUI mode, we need to get
-                # back to vc1 where the text install is going to pop up.
-                if not flags.livecdInstall:
-                    isys.vtActivate (1)
-                stdoutLog.warning("GUI installer startup failed, falling back to text mode.")
-                self.displayMode = 't'
-                if 'DISPLAY' in os.environ.keys():
-                    del os.environ['DISPLAY']
-                time.sleep(2)
-
-        if self.displayMode == 't':
-            from text import InstallInterface
-            if not os.environ.has_key("LANG"):
-                os.environ["LANG"] = "en_US.UTF-8"
-
-        if self.displayMode == 'c':
-            from cmdline import InstallInterface
-
-        self._intf = InstallInterface()
         return self._intf
 
     def _setInterface(self, v):
@@ -610,6 +580,39 @@ class Anaconda(object):
 
         exn.write(self, fo)
 
+    def initInterface(self):
+        if self._intf:
+            raise RuntimeError, "Second attempt to initialize the InstallInterface"
+
+        # setup links required by graphical mode if installing and verify display mode
+        if self.displayMode == 'g':
+            stdoutLog.info (_("Starting graphical installation."))
+
+            try:
+                from gui import InstallInterface
+            except Exception, e:
+                stdoutLog.error("Exception starting GUI installer: %s" %(e,))
+                # if we're not going to really go into GUI mode, we need to get
+                # back to vc1 where the text install is going to pop up.
+                if not flags.livecdInstall:
+                    isys.vtActivate (1)
+                stdoutLog.warning("GUI installer startup failed, falling back to text mode.")
+                self.displayMode = 't'
+                if 'DISPLAY' in os.environ.keys():
+                    del os.environ['DISPLAY']
+                time.sleep(2)
+
+        if self.displayMode == 't':
+            from text import InstallInterface
+            if not os.environ.has_key("LANG"):
+                os.environ["LANG"] = "en_US.UTF-8"
+
+        if self.displayMode == 'c':
+            from cmdline import InstallInterface
+
+        self._intf = InstallInterface()
+        return self._intf
+
     def writeXdriver(self):
         # this should go away at some point, but until it does, we
         # need to keep it around.
@@ -1104,6 +1107,8 @@ if __name__ == "__main__":
         runVNC()
         doStartupX11Actions(opts.runres)
 
+    # with X running we can initialize the UI interface
+    anaconda.initInterface()
     anaconda.instClass.configure(anaconda)
 
     # comment out the next line to make exceptions non-fatal
-- 
1.6.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