summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>1999-09-07 18:48:49 +0000
committerErik Troan <ewt@redhat.com>1999-09-07 18:48:49 +0000
commit9e4e02c9289d3ba8ad426585606c29bddd395d5c (patch)
tree26e2b894d7ba9b0b8f48cd81e6c539cebbf533a1
parente8ba7f3c4b25235859b4263da59db4dfebb71a6c (diff)
downloadanaconda-9e4e02c9289d3ba8ad426585606c29bddd395d5c.tar.gz
anaconda-9e4e02c9289d3ba8ad426585606c29bddd395d5c.tar.xz
anaconda-9e4e02c9289d3ba8ad426585606c29bddd395d5c.zip
added manual (fdisk) partitioning in text mode
-rwxr-xr-xanaconda8
-rw-r--r--kickstart.py1
-rw-r--r--text.py80
-rw-r--r--todo.py6
4 files changed, 88 insertions, 7 deletions
diff --git a/anaconda b/anaconda
index d2b54f20d..5e3d95a01 100755
--- a/anaconda
+++ b/anaconda
@@ -13,7 +13,8 @@ _ = gettext.gettext
(args, extra) = getopt.getopt(sys.argv[1:], 'GTtdr:fm:',
[ 'gui', 'text', 'test', 'debug', 'method=', 'rootpath=',
- 'testpath=', 'mountfs', 'traceonly', 'kickstart=' ])
+ 'testpath=', 'mountfs', 'traceonly', 'kickstart=',
+ 'expert'])
# remove the arguments - gnome_init doesn't understand them
for arg in sys.argv[1:]:
@@ -32,6 +33,7 @@ traceOnly = 0
mouseInfo = None
x = None
kickstart = None
+expert = 0
for n in args:
(str, arg) = n
@@ -55,6 +57,8 @@ for n in args:
forceMount = 1
elif (str == '--traceonly'):
traceOnly = 1
+ elif (str == '--expert'):
+ expert = 1
if (not method):
print "no install method specified"
@@ -174,7 +178,7 @@ else:
try:
todo = ToDo(intf, method, rootPath, installSystem = installPackages,
setupFilesystems = setupFilesystems, mouse = mouseInfo,
- instClass = instClass, x = x)
+ instClass = instClass, x = x, expert = expert)
intf.run(todo, test = test)
except:
(type, value, tb) = sys.exc_info()
diff --git a/kickstart.py b/kickstart.py
index 0e956ece3..5f02af018 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -132,6 +132,7 @@ class Kickstart(InstallClass):
"nfs" : None ,
"part" : self.definePartition ,
"rootpw" : self.doRootPw ,
+ "text" : None ,
"timezone" : self.doTimezone ,
"upgrade" : self.doUpgrade ,
"xdisplay" : None ,
diff --git a/text.py b/text.py
index c85b465c9..2edafcba3 100644
--- a/text.py
+++ b/text.py
@@ -27,9 +27,9 @@ class LanguageWindow:
(button, choice) = \
ListboxChoiceWindow(screen, _("Language Selection"),
- _("What language would you like to use during the "
- "installation process?"), descriptions,
- buttons = [_("OK")], width = 30, default = default)
+ _("What language would you like to use during the "
+ "installation process?"), descriptions,
+ buttons = [_("OK")], width = 30, default = default)
langs = gettext.getlangs ()
langs = [languages [languages.keys()[choice]]] + langs
gettext.setlangs (langs)
@@ -678,6 +678,76 @@ class HostnameWindow:
return INSTALL_OK
+class PartitionMethod:
+ def __call__(self, screen, todo):
+ if not todo.expert or todo.instClass.partitions:
+ todo.skipFdisk = 1
+ return INSTALL_NOOP
+
+ rc = ButtonChoiceWindow(screen, _("Disk Setup"),
+ _("Disk Druid is a tool for partitioning and setting up mount "
+ "points. It is designed to be easier to use than Linux's "
+ "traditional disk partitioning sofware, fdisk, as well "
+ "as more powerful. However, there are some cases where fdisk "
+ "may be preferred.\n"
+ "\n"
+ "Which tool would you like to use?"),
+ [ (_("Disk Druid"), "dd") , (_("fdisk"), "fd"),
+ (_("Back"), "back") ], width = 50)
+
+ if rc == "back":
+ return INSTALL_BACK
+ elif rc == "dd":
+ todo.skipFdisk = 1
+ else:
+ todo.skipFdisk = 0
+
+ return INSTALL_OK
+
+class ManualPartitionWindow:
+ def __call__(self, screen, todo):
+ if todo.skipFdisk: return INSTALL_NOOP
+
+ drives = todo.drives.available ()
+ driveNames = drives.keys()
+ driveNames.sort ()
+
+ choices = []
+ for device in driveNames:
+ descrip = drives[device]
+ if descrip:
+ choices.append("/dev/%s - %s" % (device, descrip))
+ else:
+ choices.append("/dev/%s" % (device,))
+
+ button = None
+ while button != "done" and button != "back":
+ (button, choice) = \
+ ListboxChoiceWindow(screen, _("Disk Setup"),
+ _("To install Red Hat Linux, you must have at least one "
+ "partition of 150 MB dedicated to Linux. We suggest "
+ "placing that partition on one of the first two hard "
+ "drives in your system so you can boot into Linux "
+ "with LILO."), choices,
+ [ (_("Done"), "done") , (_("Edit"), "edit"),
+ (_("Back"), "back") ], width = 50)
+
+ if button != "done" and button != "back":
+ device = driveNames[choice]
+ screen.suspend ()
+ if os.access("/sbin/fdisk", os.X_OK):
+ path = "/sbin/fdisk"
+ else:
+ path = "/usr/sbin/fdisk"
+ iutil.execWithRedirect (path, [ "/dev/" + device ])
+ screen.resume ()
+
+ if button == "back":
+ return INSTALL_BACK
+
+ return INSTALL_OK
+
+
class AutoPartitionWindow:
def __call__(self, screen, todo):
fstab = []
@@ -1536,6 +1606,10 @@ class InstallInterface:
]
self.installSteps = [
+ [_("Partition"), PartitionMethod,
+ (self.screen, todo), "partition" ],
+ [_("Manually Partition"), ManualPartitionWindow,
+ (self.screen, todo), "partition" ],
[_("Automatic Partition"), AutoPartitionWindow,
(self.screen, todo), "partition" ],
[_("Partition"), PartitionWindow, (self.screen, todo),
diff --git a/todo.py b/todo.py
index 696a93f28..391caa61d 100644
--- a/todo.py
+++ b/todo.py
@@ -278,7 +278,8 @@ class Drives:
class ToDo:
def __init__(self, intf, method, rootPath, setupFilesystems = 1,
- installSystem = 1, mouse = None, instClass = None, x = None):
+ installSystem = 1, mouse = None, instClass = None, x = None,
+ expert = 0):
self.intf = intf
self.method = method
self.mounts = {}
@@ -306,6 +307,7 @@ class ToDo:
self.initrdsMade = {}
self.liloImages = {}
self.initlevel = 3
+ self.expert = expert
if (not instClass):
raise TypeError, "installation class expected"
self.setClass(instClass)
@@ -487,7 +489,7 @@ class ToDo:
f.write (format % ( '/dev/' + dev, mntpoint, fs, 'defaults', 1, 2))
else:
f.write (format % ( '/dev/' + dev, mntpoint, fs, 'defaults', 0, 0))
- f.write (format % ("/mnt/floppy", "/dev/fd0", 'ext', 'noauto', 0, 0))
+ f.write (format % ("/dev/fd0", "/mnt/floppy", 'ext', 'noauto', 0, 0))
f.write (format % ("none", "/proc", 'proc', 'defaults', 0, 0))
f.write (format % ("none", "/dev/pts", 'devpts', 'gid=5,mode=620', 0, 0))
f.close ()