summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dispatch.py4
-rwxr-xr-xgui.py1
-rw-r--r--installclasses/upgradeclass.py2
-rw-r--r--iw/partition_gui.py2
-rw-r--r--iw/upgrade_migratefs_gui.py91
-rw-r--r--partitioning.py2
-rw-r--r--text.py1
-rw-r--r--textw/upgrade_text.py57
-rw-r--r--upgrade.py9
-rw-r--r--upgradeclass.py2
10 files changed, 166 insertions, 5 deletions
diff --git a/dispatch.py b/dispatch.py
index 12978e31b..1681d6b02 100644
--- a/dispatch.py
+++ b/dispatch.py
@@ -27,7 +27,7 @@ from bootloader import partitioningComplete, writeBootloader
from bootloader import bootloaderSetupChoices
from flags import flags
from upgrade import upgradeFindPackages, upgradeMountFilesystems
-from upgrade import upgradeSwapSuggestion
+from upgrade import upgradeSwapSuggestion, upgradeMigrateFind
# These are all of the install steps, in order. Note that upgrade and
# install steps are the same thing! Upgrades skip install steps, while
@@ -66,6 +66,8 @@ installSteps = [
( "partitiondone", partitioningComplete, ("dispatch", "id.bootloader",
"id.fsset", "id.diskset",
"id.partitions") ),
+ ( "upgrademigfind", upgradeMigrateFind, ("dispatch", "id.partitions")),
+ ( "upgrademigratefs", ("id.partitions",) ),
( "bootloadersetup", bootloaderSetupChoices, ("dispatch", "id.bootloader",
"id.fsset", "id.diskset") ),
( "bootloader", ("dispatch", "id.bootloader", "id.fsset", "id.diskset") ),
diff --git a/gui.py b/gui.py
index 4a6a9e097..d5c442b72 100755
--- a/gui.py
+++ b/gui.py
@@ -48,6 +48,7 @@ stepToClass = {
"autopartition" : ("partition_gui", "AutoPartitionWindow" ),
"findinstall" : ( "examine_gui", "UpgradeExamineWindow" ),
"addswap" : ( "upgrade_swap_gui", "UpgradeSwapWindow" ),
+ "upgrademigratefs" : ("upgrade_migratefs_gui", "UpgradeMigrateFSWindow"),
"fdisk" : ( "fdisk_gui", "FDiskWindow" ),
"format" : ( "format_gui", "FormatWindow" ),
"bootloader": ("bootloader_gui", "BootloaderWindow" ),
diff --git a/installclasses/upgradeclass.py b/installclasses/upgradeclass.py
index b0fadb152..f4650e53c 100644
--- a/installclasses/upgradeclass.py
+++ b/installclasses/upgradeclass.py
@@ -26,6 +26,8 @@ class InstallClass(BaseInstallClass):
"upgrademount",
"upgradeswapsuggestion",
"addswap",
+ "upgrademigfind",
+ "upgrademigratefs",
"upgradecontinue",
"readcomps",
"findpackages",
diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index 388f45257..f12864a6b 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -571,7 +571,6 @@ class PartitionWindow(InstallWindow):
if request.fstype:
ptype = request.fstype.getName()
- print request.format
if request.format:
text[self.titleSlot["Format"]] = _("Yes")
else:
@@ -816,7 +815,6 @@ class PartitionWindow(InstallWindow):
formatrb = GtkRadioButton (label=_("Format partition as:"),
group = noformatrb)
formatrb.set_active(0)
- print isFormatOnByDefault(origrequest)
if origrequest.format:
formatrb.set_active(1)
elif origrequest.format == None and not origrequest.migrate:
diff --git a/iw/upgrade_migratefs_gui.py b/iw/upgrade_migratefs_gui.py
new file mode 100644
index 000000000..111b89c79
--- /dev/null
+++ b/iw/upgrade_migratefs_gui.py
@@ -0,0 +1,91 @@
+#
+# upgrade_migratefs_gui.py: dialog for migrating filesystems on upgrades
+#
+# Mike Fulbright <msf@redhat.com>
+#
+# Copyright 2001 Red Hat, Inc.
+#
+# This software may be freely redistributed under the terms of the GNU
+# library public license.
+#
+# You should have received a copy of the GNU Library Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+from gtk import *
+from iw_gui import *
+from translate import _, N_
+import string
+import isys
+import iutil
+from log import log
+import upgrade
+from gnome.ui import *
+from fsset import *
+import gui
+
+class UpgradeMigrateFSWindow (InstallWindow):
+ windowTitle = N_("Migrate Filesystems")
+ htmlTag = "upmigfs"
+
+ def getNext (self):
+ # reset
+ for req in self.migratereq:
+ req.format = 0
+ req.migrate = 0
+ req.fstype = req.origfstype
+
+ for (cb, req) in self.cbs:
+ if cb.get_active():
+ req.format = 0
+ req.migrate = 1
+ req.fstype = fileSystemTypeGet("ext3")
+
+ return None
+
+ def getScreen (self, partitions):
+
+ self.migratereq = partitions.getMigratableRequests()
+
+ box = GtkVBox (FALSE, 5)
+ box.set_border_width (5)
+
+ text = N_("This release of Red Hat Linux supports "
+ "the ext3 journalling filesystem. It has several "
+ "benefits over the ext2 filesystem traditionally shipped "
+ "in Red Hat Linux. It is possible to migrate the ext2 "
+ "formatted partitions to ext3 without data loss.\n\n"
+ "Which of these partitions would you like to migrate?")
+
+ label = GtkLabel (text)
+ label.set_alignment (0.5, 0.0)
+ label.set_usize(400, -1)
+ label.set_line_wrap (TRUE)
+ box.pack_start(label, FALSE)
+
+ cbox = GtkVBox(FALSE, 5)
+ self.cbs = []
+ for req in self.migratereq:
+ if req.origfstype.getName() != req.fstype.getName():
+ migrating = 1
+ else:
+ migrating = 0
+
+ cb = GtkCheckButton("%s - %s - %s" % (req.device,
+ req.origfstype.getName(),
+ req.mountpoint))
+ cb.set_active(migrating)
+ cbox.pack_start(cb, FALSE)
+
+ self.cbs.append((cb, req))
+
+ a = GtkAlignment(0.25, 0.5)
+ a.add(cbox)
+ box.pack_start(a)
+
+ a = GtkAlignment(0.5, 0.5)
+ a.add(box)
+ return a
+
+
diff --git a/partitioning.py b/partitioning.py
index 059d107f7..0eee45d69 100644
--- a/partitioning.py
+++ b/partitioning.py
@@ -196,8 +196,6 @@ def get_raid_partitions(disk):
part = disk.next_partition(part)
continue
- print get_partition_name(part), part.fs_type.name, part.get_flag(parted.PARTITION_RAID)
-
if part.get_flag(parted.PARTITION_RAID) == 1:
rc.append(part)
part = disk.next_partition(part)
diff --git a/text.py b/text.py
index 45dd62023..a4a2b6426 100644
--- a/text.py
+++ b/text.py
@@ -39,6 +39,7 @@ stepToClasses = {
"autopartition" : ("partition_text", "AutoPartitionWindow"),
"custom-upgrade" : ("upgrade_text", "UpgradeExamineWindow" ),
"addswap" : ("upgrade_text", "UpgradeSwapWindow" ),
+ "upgrademigratefs" : ("upgrade_text", "UpgradeMigrateFSWindow"),
"fdisk" : ("fdisk_text", "fdiskPartitionWindow" ),
"partitionmethod" : ("partmethod_text", ("PartitionMethod") ),
"partition": ("partition_text", ("PartitionWindow") ),
diff --git a/textw/upgrade_text.py b/textw/upgrade_text.py
index 7610fd15f..5edc6805f 100644
--- a/textw/upgrade_text.py
+++ b/textw/upgrade_text.py
@@ -6,8 +6,65 @@ import iutil
from log import log
from flags import flags
from constants_text import *
+from fsset import *
import upgrade
+class UpgradeMigrateFSWindow:
+ def __call__ (self, screen, partitions):
+
+ migratereq = partitions.getMigratableRequests()
+
+ g = GridFormHelp(screen, _("Migrate Filesystems"), "upmigfs", 1, 4)
+
+ text = _("This release of Red Hat Linux supports "
+ "the ext3 journalling filesystem. It has several "
+ "benefits over the ext2 filesystem traditionally shipped "
+ "in Red Hat Linux. It is possible to migrate the ext2 "
+ "formatted partitions to ext3 without data loss.\n\n"
+ "Which of these partitions would you like to migrate?")
+
+ tb = TextboxReflowed(60, text)
+ g.add(tb, 0, 0, anchorLeft = 1, padding = (0, 0, 0, 1))
+
+ partlist = CheckboxTree(height=4, scroll=1)
+ for req in migratereq:
+ if req.origfstype.getName() != req.fstype.getName():
+ migrating = 1
+ else:
+ migrating = 0
+ partlist.append("%s - %s - %s" % (req.device,
+ req.origfstype.getName(),
+ req.mountpoint), req, migrating)
+
+ g.add(partlist, 0, 1, padding = (0, 0, 0, 1))
+
+ buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON] )
+ g.add(buttons, 0, 3, anchorLeft = 1, growx = 1)
+
+ while 1:
+ result = g.run()
+
+ if (buttons.buttonPressed(result)):
+ result = buttons.buttonPressed(result)
+
+ if result == TEXT_BACK_CHECK:
+ screen.popWindow()
+ return INSTALL_BACK
+
+ # reset
+ for req in migratereq:
+ req.format = 0
+ req.migrate = 0
+ req.fstype = req.origfstype
+
+ for req in partlist.getSelection():
+ req.format = 0
+ req.migrate = 1
+ req.fstype = fileSystemTypeGet("ext3")
+
+ screen.popWindow()
+ return INSTALL_OK
+
class UpgradeSwapWindow:
def __call__ (self, screen, intf, fsset, instPath, swapInfo):
rc = swapInfo
diff --git a/upgrade.py b/upgrade.py
index f5dd50253..e41007251 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -78,6 +78,15 @@ def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0,
if flags.setupFilesystems:
oldfsset.mountFilesystems (instPath)
+# returns None if no filesystem exist to migrate
+def upgradeMigrateFind(dispatch, partitions):
+ migratereq = partitions.getMigratableRequests()
+ if not migratereq or len(migratereq) < 1:
+ dispatch.skipStep("upgrademigratefs")
+ else:
+ dispatch.skipStep("upgrademigratefs", skip = 0)
+
+
# returns None if no more swap is needed
def upgradeSwapSuggestion(dispatch, id, instPath):
# mem is in kb -- round it up to the nearest 4Mb
diff --git a/upgradeclass.py b/upgradeclass.py
index b0fadb152..f4650e53c 100644
--- a/upgradeclass.py
+++ b/upgradeclass.py
@@ -26,6 +26,8 @@ class InstallClass(BaseInstallClass):
"upgrademount",
"upgradeswapsuggestion",
"addswap",
+ "upgrademigfind",
+ "upgrademigratefs",
"upgradecontinue",
"readcomps",
"findpackages",