summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rwxr-xr-xanaconda148
-rw-r--r--po/anaconda-text.pot58
-rw-r--r--text.py13
-rw-r--r--todo.py15
-rw-r--r--xserver.py206
6 files changed, 263 insertions, 179 deletions
diff --git a/Makefile b/Makefile
index 442bbf286..8ca6e29f7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-SUBDIRS = rpmmodule isys balkan po libfdisk collage loader stubs
+SUBDIRS = rpmmodule isys balkan po libfdisk collage loader stubs kudzu
BUILDONLYSUBDIRS = pump
TOPDIR = ../../..
diff --git a/anaconda b/anaconda
index 2202e2c59..789d5ab77 100755
--- a/anaconda
+++ b/anaconda
@@ -5,6 +5,8 @@ import gettext
import traceback
import string
+setverPath = None
+
gettext.bindtextdomain("anaconda", "/usr/share/locale")
gettext.textdomain("anaconda")
_ = gettext.gettext
@@ -78,152 +80,16 @@ import rpm
import lilo
from todo import ToDo
import isys
-import kudzu
if (mode == 'g' and not os.environ.has_key('DISPLAY')):
- os.environ['DISPLAY'] = ':1'
- serverPath = None
-
- try:
- f = open('/dev/fb0', 'r')
- f.close()
- serverPath = '/usr/X11R6/bin/XF86_FBDev'
- except:
-# serverPath = '/usr/X11R6/bin/XF86_VGA16'
- serverPath = '/usr/X11R6/bin/XF86_SVGA'
-
- print "Probing for mouse type..."
- mice = kudzu.probe (kudzu.CLASS_MOUSE,
- kudzu.BUS_UNSPEC,
- kudzu.PROBE_ALL);
- if not mice:
- print "Unable to find a mouse!"
+ import xserver
+ if xserver.startX ():
mode = 't'
- else:
- device = None
- protocol = None
- (device, driver, descr) = mice[0]
- if device == 'psaux':
- protocol = "PS/2"
- else:
- protocol = "Microsoft"
-
- isys.makeDevInode(device, "/tmp/" + device)
-
- if not test and not localInstall:
- for i in ( "imrc", "im_palette.pal" ):
- os.symlink ("../mnt/source/RedHat/instimage/etc/" + i, "/etc/" + i)
-
- f = open ('/tmp/XF86Config', 'w')
-
- settings = { "mouseDev" : '/tmp/' + device ,
- "mouseProto" : protocol }
-
- f.write ("""
-Section "Files"
- RgbPath "/usr/X11R6/lib/X11/rgb"
- FontPath "/usr/X11R6/lib/X11/fonts/misc/"
- FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
- FontPath "/usr/X11R6/lib/X11/fonts/Speedo/"
- FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
- FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
-EndSection
-
-Section "ServerFlags"
-EndSection
-
-Section "Keyboard"
- Protocol "Standard"
- AutoRepeat 500 5
- LeftAlt Meta
- RightAlt Meta
- ScrollLock Compose
- RightCtl Control
- XkbKeymap "xfree86(us)"
- XkbKeycodes "xfree86"
- XkbTypes "default"
- XkbCompat "default"
- XkbSymbols "us(pc101)"
- XkbGeometry "pc"
- XkbRules "xfree86"
- XkbModel "pc101"
- XkbLayout "us"
-EndSection
-
-Section "Pointer"
- Protocol "%(mouseProto)s"
- Device "%(mouseDev)s"
- Emulate3Buttons
- Emulate3Timeout 50
-EndSection
-
-Section "Monitor"
- Identifier "Monitor"
- VendorName "Vendor"
- ModelName "Model"
- HorizSync 31.5 - 79.0
- VertRefresh 40-150
-
-# XXX fix me descr
-Modeline "640x480" 25.175 640 664 760 800 480 491 493 525
-# 640x480 @ 72 Hz, 36.5 kHz hsync
-Modeline "640x480" 31.5 640 680 720 864 480 488 491 521
-# 640x480 @ 75 Hz, 37.50 kHz hsync
-ModeLine "640x480" 31.5 640 656 720 840 480 481 484 500 -HSync -VSync
-
-EndSection
-
-Section "Device"
- Identifier "Device"
- VendorName "Vendor"
- BoardName "Board"
-EndSection
-
-Section "Screen"
- Driver "vga16"
- Device "Device"
- Monitor "Monitor"
- Subsection "Display"
- Modes "640x480"
- ViewPort 0 0
- EndSubsection
-EndSection
-
-Section "Screen"
- Driver "svga"
- Device "Device"
- Monitor "Monitor"
- Subsection "Display"
- Depth 8
- Modes "640x480"
- ViewPort 0 0
- Virtual 640 480
- EndSubsection
-EndSection
-
-Section "Screen"
- Driver "fbdev"
- Device "Device"
- Monitor "Monitor"
- Subsection "Display"
- Depth 16
- Modes "default"
- EndSubsection
-EndSection
-""" % settings)
- f.close ()
-
- server = os.fork()
- if (not server):
- os.execv(serverPath, [serverPath, ':1', '-xf86config',
- '/tmp/XF86Config', 'vt5'])
- child = os.fork()
- if (child):
- os.waitpid(child, 0)
- os.kill(server, 15)
- sys.exit(0)
if (mode == 'g'):
+ if not test and not localInstall:
+ for i in ( "imrc", "im_palette.pal" ):
+ os.symlink ("../mnt/source/RedHat/instimage/etc/" + i, "/etc/" + i)
from gui import InstallInterface
elif (mode == 't'):
from text import InstallInterface
diff --git a/po/anaconda-text.pot b/po/anaconda-text.pot
index 8997cab5c..5fb755978 100644
--- a/po/anaconda-text.pot
+++ b/po/anaconda-text.pot
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-08-20 14:34-0400\n"
+"POT-Creation-Date: 1999-08-20 20:02-0400\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"
@@ -14,7 +14,7 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING\n"
-#: ../text.py:26 ../text.py:914
+#: ../text.py:26 ../text.py:915
msgid "Language Selection"
msgstr ""
@@ -24,13 +24,13 @@ msgstr ""
#: ../text.py:29 ../text.py:48 ../text.py:96 ../text.py:149 ../text.py:165
#: ../text.py:170 ../text.py:188 ../text.py:210 ../text.py:336 ../text.py:356
-#: ../text.py:423 ../text.py:460 ../text.py:525 ../text.py:576 ../text.py:598
+#: ../text.py:422 ../text.py:460 ../text.py:525 ../text.py:576 ../text.py:598
#: ../text.py:653 ../text.py:670 ../text.py:690 ../text.py:702 ../text.py:714
#: ../text.py:882 ../text.py:888
msgid "OK"
msgstr ""
-#: ../text.py:46 ../text.py:915
+#: ../text.py:46 ../text.py:916
msgid "Keyboard Selection"
msgstr ""
@@ -40,14 +40,14 @@ msgstr ""
#: ../text.py:48 ../text.py:51 ../text.py:62 ../text.py:64 ../text.py:82
#: ../text.py:96 ../text.py:98 ../text.py:117 ../text.py:119 ../text.py:149
-#: ../text.py:188 ../text.py:190 ../text.py:210 ../text.py:336 ../text.py:423
+#: ../text.py:188 ../text.py:190 ../text.py:210 ../text.py:336 ../text.py:422
#: ../text.py:460 ../text.py:525 ../text.py:576 ../text.py:585 ../text.py:598
#: ../text.py:601 ../text.py:618 ../text.py:627 ../text.py:653 ../text.py:660
#: ../text.py:670 ../text.py:671
msgid "Back"
msgstr ""
-#: ../text.py:58 ../text.py:917
+#: ../text.py:58 ../text.py:918
msgid "Installation Path"
msgstr ""
@@ -100,7 +100,7 @@ msgstr ""
msgid "No"
msgstr ""
-#: ../text.py:132 ../text.py:929
+#: ../text.py:132 ../text.py:930
msgid "Root Password"
msgstr ""
@@ -215,7 +215,7 @@ msgstr ""
msgid "You must enter valid IP information to continue"
msgstr ""
-#: ../text.py:401
+#: ../text.py:400
msgid ""
"What partitions would you like to format? We strongly suggest formatting all "
"of the system partitions, including /, /usr, and /var. There is no need to "
@@ -223,11 +223,11 @@ msgid ""
"previous install."
msgstr ""
-#: ../text.py:421
+#: ../text.py:420
msgid "Check for bad blocks during format"
msgstr ""
-#: ../text.py:425
+#: ../text.py:424
msgid "Choose Partitions to Format"
msgstr ""
@@ -239,7 +239,7 @@ msgstr ""
msgid "Package Group Selection"
msgstr ""
-#: ../text.py:554 ../text.py:926
+#: ../text.py:554 ../text.py:927
msgid "Package Dependencies"
msgstr ""
@@ -270,7 +270,7 @@ msgstr ""
msgid "Which model mouse is attached to this computer?"
msgstr ""
-#: ../text.py:608 ../text.py:698 ../text.py:934
+#: ../text.py:608 ../text.py:698 ../text.py:935
msgid "Bootdisk"
msgstr ""
@@ -286,7 +286,7 @@ msgid ""
"Would you like to create a bootdisk for your system?"
msgstr ""
-#: ../text.py:650 ../text.py:931
+#: ../text.py:650 ../text.py:932
msgid "LILO Configuration"
msgstr ""
@@ -390,66 +390,66 @@ msgid ""
"screen"
msgstr ""
-#: ../text.py:916
+#: ../text.py:917
msgid "Welcome"
msgstr ""
-#: ../text.py:921
+#: ../text.py:922
msgid "Network Setup"
msgstr ""
-#: ../text.py:922
+#: ../text.py:923
msgid "Partition"
msgstr ""
-#: ../text.py:923
+#: ../text.py:924
msgid "Filesystem Formatting"
msgstr ""
-#: ../text.py:924
+#: ../text.py:925
msgid "Package Groups"
msgstr ""
-#: ../text.py:925 ../text.py:941
+#: ../text.py:926 ../text.py:942
msgid "Individual Packages"
msgstr ""
-#: ../text.py:927
+#: ../text.py:928
msgid "Mouse Configuration"
msgstr ""
-#: ../text.py:928
+#: ../text.py:929
msgid "Authentication"
msgstr ""
-#: ../text.py:930
+#: ../text.py:931
msgid "Boot Disk"
msgstr ""
-#: ../text.py:932
+#: ../text.py:933
msgid "Installation Begins"
msgstr ""
-#: ../text.py:933
+#: ../text.py:934
msgid "Install System"
msgstr ""
-#: ../text.py:935
+#: ../text.py:936
msgid "Installation Complete"
msgstr ""
-#: ../text.py:939
+#: ../text.py:940
msgid "Examine System"
msgstr ""
-#: ../text.py:940
+#: ../text.py:941
msgid "Customize Upgrade"
msgstr ""
-#: ../text.py:942
+#: ../text.py:943
msgid "Upgrade System"
msgstr ""
-#: ../text.py:943
+#: ../text.py:944
msgid "Upgrade Complete"
msgstr ""
diff --git a/text.py b/text.py
index fe604812c..8717eb4d5 100644
--- a/text.py
+++ b/text.py
@@ -296,8 +296,13 @@ class NetworkWindow:
self.ns.set (ns)
devices = todo.network.available ()
- if devices.items () == 0:
+ if not devices:
return INSTALL_NOOP
+
+ if todo.network.readData:
+ # XXX expert mode, allow changing network settings here
+ return INSTALL_NOOP
+
dev = devices[devices.keys ()[0]]
firstg = Grid (1, 1)
@@ -380,13 +385,13 @@ class PartitionWindow:
if (not todo.setupFilesystems): return INSTALL_NOOP
fstab = []
- for (mntpoint, (dev, fstype, reformat)) in todo.mounts.items ():
+ for mntpoint, (dev, fstype, reformat) in todo.mounts.items ():
fstab.append ((dev, mntpoint))
if not todo.ddruid:
todo.ddruid = fsedit(0, todo.drives.available ().keys (), fstab)
dir = todo.ddruid.edit ()
- for (partition, mount, fstype, size) in todo.ddruid.getFstab ():
+ for partition, mount, fstype, size in todo.ddruid.getFstab ():
todo.addMount(partition, mount, fstype)
return dir
@@ -560,7 +565,7 @@ class PackageDepWindow:
"installed.")), 0, 0, (0, 0, 0, 1))
g.add (Label ("%-20s %-20s" % (_("Package"), _("Requirement"))), 0, 1, anchorLeft = 1)
text = ""
- for (name, suggest) in deps:
+ for name, suggest in deps:
text = text + "%-20s %-20s\n" % (name, suggest)
if len (deps) > 5:
diff --git a/todo.py b/todo.py
index 3866fbd66..1e113c230 100644
--- a/todo.py
+++ b/todo.py
@@ -83,6 +83,7 @@ class Network:
self.secondaryNS = ""
self.ternaryNS = ""
self.domains = []
+ self.readData = 0
try:
f = open ("/tmp/netinfo", "r")
except:
@@ -104,6 +105,7 @@ class Network:
self.gateway = info["GATEWAY"]
if info.has_key ("NS1"):
self.primaryNS = info["NS1"]
+ self.readData = 1
def available (self):
if self.netdevices:
@@ -822,14 +824,17 @@ class ToDo:
ts.order()
- self.instLog = open(self.instPath + '/tmp/install.log', "w+")
+ if self.upgrade:
+ logname = '/tmp/upgrade.log'
+ else:
+ logname = '/tmp/install.log'
+
+ self.instLog = open(self.instPath + logname, "w+")
syslog = Syslogd(root = self.instPath, output = self.instLog)
- instLogFd = os.open(self.instPath + '/tmp/install.log', os.O_APPEND)
- ts.scriptFd = instLogFd
+ ts.scriptFd = self.instLog.fileno ()
# the transaction set dup()s the file descriptor and will close the
# dup'd when we go out of scope
- os.close(instLogFd)
p = self.intf.packageProgressWindow(total, totalSize)
@@ -866,6 +871,8 @@ class ToDo:
del syslog
del p
+ self.instLog.close ()
+
w = self.intf.waitWindow("Post Install",
"Performing post install configuration...")
diff --git a/xserver.py b/xserver.py
new file mode 100644
index 000000000..25039f57c
--- /dev/null
+++ b/xserver.py
@@ -0,0 +1,206 @@
+import os
+import string
+import kudzu
+import isys
+
+def findCardInDB (needle, lines = None):
+ if not lines:
+ db = open ('/usr/X11R6/lib/X11/Cards')
+ lines = db.readlines ()
+ db.close ()
+
+ found = 0
+
+ card = {}
+
+ for line in lines:
+ line = string.strip (line)
+
+ if not line and found:
+ break
+
+ if line and line[0] == '#':
+ continue
+
+ if len (line) > 4 and line[0:4] == 'NAME':
+ haystack = line[5:]
+ if needle == haystack:
+ found = 1
+ continue
+
+ if found:
+ info = string.splitfields (line, ' ')
+ if card.has_key (info[0]):
+ card[info[0]] = card[info[0]] + (string.joinfields (info[1:], ' ') + '\n')
+ else:
+ card[info[0]] = string.joinfields (info[1:], ' ')
+
+ if card.has_key ("SEE"):
+ see = findCardInDB (card["SEE"], lines)
+ for key, item in see.items ():
+ card[key] = item
+
+ return card
+
+def startX():
+ global serverPath
+ global mode
+
+ os.environ['DISPLAY'] = ':1'
+ serverPath = None
+
+ print "Probing for mouse type..."
+ mice = kudzu.probe (kudzu.CLASS_MOUSE,
+ kudzu.BUS_UNSPEC,
+ kudzu.PROBE_ONE);
+ if not mice:
+ print "Unable to find a mouse!"
+ return 1
+ device = None
+ protocol = None
+ (mouseDev, driver, descr) = mice[0]
+ if mouseDev == 'psaux':
+ protocol = "PS/2"
+ else:
+ protocol = "Microsoft"
+
+ cards = kudzu.probe (kudzu.CLASS_VIDEO,
+ kudzu.BUS_UNSPEC,
+ kudzu.PROBE_ALL);
+
+ if len (cards) > 1:
+ print "Warning: multiple video chips detected."
+
+ if not cards:
+ try:
+ f = open('/dev/fb0', 'r')
+ f.close()
+ serverPath = '/usr/X11R6/bin/XF86_FBDev'
+ except:
+ serverPath = '/usr/X11R6/bin/XF86_VGA16'
+
+ print "PCI probe for video cards failed. Falling back to", serverPath
+ else:
+ (device, driver, descr) = cards[0]
+ if driver[0:4] == "Card:":
+ card = findCardInDB (driver[5:])
+ if card.has_key ("SERVER"):
+ serverPath = '/usr/X11R6/bin/XF86_' + card["SERVER"]
+ else:
+ print ("CardDB missing SERVER for " + driver[5:] + ".\n"
+ "Falling back to VGA16")
+ serverPath = '/usr/X11R6/bin/XF86_VGA16'
+ else:
+ if driver[0:6] == "Server:":
+ serverPath = '/usr/X11R6/bin/XF86_' + driver[7:]
+
+ isys.makeDevInode(mouseDev, "/tmp/" + mouseDev)
+
+ f = open ('/tmp/XF86Config', 'w')
+
+ settings = { "mouseDev" : '/tmp/' + mouseDev ,
+ "mouseProto" : protocol }
+
+ f.write ("""
+Section "Files"
+ RgbPath "/usr/X11R6/lib/X11/rgb"
+ FontPath "/usr/X11R6/lib/X11/fonts/misc/"
+ FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
+ FontPath "/usr/X11R6/lib/X11/fonts/Speedo/"
+ FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
+ FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
+EndSection
+
+Section "ServerFlags"
+EndSection
+
+Section "Keyboard"
+ Protocol "Standard"
+ AutoRepeat 500 5
+ LeftAlt Meta
+ RightAlt Meta
+ ScrollLock Compose
+ RightCtl Control
+ XkbKeymap "xfree86(us)"
+ XkbKeycodes "xfree86"
+ XkbTypes "default"
+ XkbCompat "default"
+ XkbSymbols "us(pc101)"
+ XkbGeometry "pc"
+ XkbRules "xfree86"
+ XkbModel "pc101"
+ XkbLayout "us"
+EndSection
+
+Section "Pointer"
+ Protocol "%(mouseProto)s"
+ Device "%(mouseDev)s"
+ Emulate3Buttons
+ Emulate3Timeout 50
+EndSection
+
+Section "Monitor"
+ Identifier "Monitor"
+ VendorName "Vendor"
+ ModelName "Model"
+ HorizSync 31.5 - 79.0
+ VertRefresh 40-150
+
+# XXX fix me descr
+Modeline "640x480" 25.175 640 664 760 800 480 491 493 525
+# 640x480 @ 72 Hz, 36.5 kHz hsync
+Modeline "640x480" 31.5 640 680 720 864 480 488 491 521
+# 640x480 @ 75 Hz, 37.50 kHz hsync
+ModeLine "640x480" 31.5 640 656 720 840 480 481 484 500 -HSync -VSync
+
+EndSection
+
+Section "Device"
+ Identifier "Device"
+ VendorName "Vendor"
+ BoardName "Board"
+EndSection
+
+Section "Screen"
+ Driver "vga16"
+ Device "Device"
+ Monitor "Monitor"
+ Subsection "Display"
+ Modes "640x480"
+ ViewPort 0 0
+ EndSubsection
+EndSection
+
+Section "Screen"
+ Driver "svga"
+ Device "Device"
+ Monitor "Monitor"
+ Subsection "Display"
+ Depth 8
+ Modes "640x480"
+ ViewPort 0 0
+ Virtual 640 480
+ EndSubsection
+EndSection
+
+Section "Screen"
+ Driver "fbdev"
+ Device "Device"
+ Monitor "Monitor"
+ Subsection "Display"
+ Depth 16
+ Modes "default"
+ EndSubsection
+EndSection
+""" % settings)
+ f.close ()
+
+ server = os.fork()
+ if (not server):
+ os.execv(serverPath, [serverPath, ':1', '-xf86config',
+ '/tmp/XF86Config', 'vt5'])
+ child = os.fork()
+ if (child):
+ os.waitpid(child, 0)
+ os.kill(server, 15)
+ sys.exit(0)