summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xanaconda32
-rw-r--r--iutil.py14
-rw-r--r--iw/network.py3
-rw-r--r--po/anaconda.pot22
-rw-r--r--xserver.py30
5 files changed, 84 insertions, 17 deletions
diff --git a/anaconda b/anaconda
index 160e724dc..636fdcb92 100755
--- a/anaconda
+++ b/anaconda
@@ -56,6 +56,7 @@ extraModules = []
# display mode is either 'g' for graphical or 't' for text
display_mode = 'g'
+forced_display_mode = None
# booleans - value is 0 for false or non-zero for true
# test - in test mode?
@@ -101,9 +102,9 @@ for n in args:
(str, arg) = n
if (str == '-G' or str == '--gui'):
- display_mode = 'g'
+ forced_display_mode = 'g'
elif (str == '-T' or str == '--text'):
- display_mode = 't'
+ forced_display_mode = 't'
elif (str == '-R' or str == '--reconfig'):
reconfigOnly = 1
progmode = 'reconfig'
@@ -120,7 +121,7 @@ for n in args:
debug = 1
elif (str == '--kickstart'):
kickstart = arg
- display_mode = 't'
+ forced_display_mode = 't'
elif (str == '-r' or str == '--rootpath'):
rootPath = arg
localInstall = 1
@@ -190,7 +191,24 @@ from kickstart import Kickstart
#
if (not test):
if (iutil.memInstalled() < 30000):
- display_mode = 't'
+ forced_display_mode = 't'
+
+#
+# if in reconfig mode set display mode based on inittab default runlevel
+#
+# but always let command line specified mode override defaults
+#
+if (forced_display_mode == None):
+ if (reconfigOnly != 0):
+ if (iutil.getDefaultRunlevel() == '5' and
+ os.access("/etc/X11/XF86Config", os.R_OK)):
+ display_mode = 'g'
+ else:
+ display_mode = 't'
+ else:
+ display_mode = 'g'
+else:
+ display_mode = forced_display_mode
#
# startup X server is we're not already running under an X session
@@ -198,7 +216,11 @@ if (not test):
if (display_mode == 'g' and not os.environ.has_key('DISPLAY')):
import xserver
try:
- result = xserver.startX ()
+ if (reconfigOnly == 0):
+ result = xserver.startX ()
+ else:
+ result = xserver.start_existing_X ()
+
except RuntimeError:
print "X startup failed, falling back to text mode"
display_mode = 't'
diff --git a/iutil.py b/iutil.py
index 77202a63a..bba11315e 100644
--- a/iutil.py
+++ b/iutil.py
@@ -154,3 +154,17 @@ def mkdirChain(dir):
if (not os.path.isdir(path)):
os.mkdir(path, 0755)
+
+#
+# get default runlevel - only for use in reconfig mode
+#
+def getDefaultRunlevel ():
+ inittab = open ('/etc/inittab', 'r')
+ lines = inittab.readlines ()
+ inittab.close ()
+ for line in lines:
+ if len (line) > 3 and line[:3] == "id:":
+ fields = string.split (line, ':')
+ return fields[1]
+
+ return None
diff --git a/iw/network.py b/iw/network.py
index 216f107f2..6c802df46 100644
--- a/iw/network.py
+++ b/iw/network.py
@@ -168,7 +168,8 @@ class NetworkWindow (InstallWindow):
self.ipTable = GtkTable (len (options), 2) # this is the iptable used for DNS, et. al
DHCPcb.connect ("toggled", self.DHCPtoggled, (devs[i], ipTable))
- DHCPcb.set_active (devs[i].get ("bootproto") == "dhcp")
+ DHCPcb.set_active (devs[i].get ("bootproto") == "dhcp" or
+ devs[i].get ("bootproto") == "")
forward = lambda widget, box=box: box.focus (DIR_TAB_FORWARD)
diff --git a/po/anaconda.pot b/po/anaconda.pot
index b2874b761..377e73e74 100644
--- a/po/anaconda.pot
+++ b/po/anaconda.pot
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-12-06 12:29-0500\n"
+"POT-Creation-Date: 1999-12-06 15:50-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -329,7 +329,7 @@ msgid ""
"a network, this may be assigned by your network administrator."
msgstr ""
-#: ../iw/network.py:209 ../loader/net.c:458 ../loader/net.c:622 ../text.py:436
+#: ../iw/network.py:210 ../loader/net.c:458 ../loader/net.c:622 ../text.py:436
msgid "Hostname"
msgstr ""
@@ -1051,39 +1051,39 @@ msgstr ""
msgid "Configure using DHCP"
msgstr ""
-#: ../iw/network.py:154
+#: ../iw/network.py:155
msgid "Activate on boot"
msgstr ""
-#: ../iw/network.py:163
+#: ../iw/network.py:164
msgid "IP Address"
msgstr ""
-#: ../iw/network.py:164 ../loader/net.c:620
+#: ../iw/network.py:165 ../loader/net.c:620
msgid "Netmask"
msgstr ""
-#: ../iw/network.py:165 ../loader/loader.c:240
+#: ../iw/network.py:166 ../loader/loader.c:240
msgid "Network"
msgstr ""
-#: ../iw/network.py:166
+#: ../iw/network.py:167
msgid "Broadcast"
msgstr ""
-#: ../iw/network.py:210
+#: ../iw/network.py:211
msgid "Gateway"
msgstr ""
-#: ../iw/network.py:210
+#: ../iw/network.py:211
msgid "Primary DNS"
msgstr ""
-#: ../iw/network.py:210
+#: ../iw/network.py:211
msgid "Secondary DNS"
msgstr ""
-#: ../iw/network.py:210
+#: ../iw/network.py:211
msgid "Ternary DNS"
msgstr ""
diff --git a/xserver.py b/xserver.py
index edf7fe795..c8f602fd7 100644
--- a/xserver.py
+++ b/xserver.py
@@ -212,3 +212,33 @@ EndSection
sys.exit((status >> 8) & 0xf)
return ((mouseProtocol, mouseEmulate, mouseDev), x)
+
+
+
+#
+# to start X server using existing XF86Config file (reconfig mode use only)
+#
+def start_existing_X():
+
+ os.environ['DISPLAY'] = ':1'
+
+ server = os.fork()
+ serverPath = "/etc/X11/X"
+ if (not server):
+ print "Starting X using existing XF86Config"
+ args = [serverPath, ':1', 'vt7', '-s', '1440', '-terminate']
+ os.execv(serverPath, args)
+
+ # give time for the server to fail (if it is going to fail...)
+ # FIXME: Should find out if X server is already running
+ # otherwise with NFS installs the X server may be still being
+ # fetched from the network while we already continue to run
+ time.sleep (4)
+ pid, status = os.waitpid (server, os.WNOHANG)
+ if status:
+ raise RuntimeError, "X server failed to start"
+
+ # startX() function above does a double-fork here, do we need to in
+ # reconfig mode?
+
+ return (None, None)