summaryrefslogtreecommitdiffstats
path: root/text.py
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 /text.py
parente8ba7f3c4b25235859b4263da59db4dfebb71a6c (diff)
downloadanaconda-9e4e02c9289d3ba8ad426585606c29bddd395d5c.tar.gz
anaconda-9e4e02c9289d3ba8ad426585606c29bddd395d5c.tar.xz
anaconda-9e4e02c9289d3ba8ad426585606c29bddd395d5c.zip
added manual (fdisk) partitioning in text mode
Diffstat (limited to 'text.py')
-rw-r--r--text.py80
1 files changed, 77 insertions, 3 deletions
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),