summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fsset.py49
-rw-r--r--partIntfHelpers.py4
-rw-r--r--partedUtils.py11
-rw-r--r--partitioning.py3
-rw-r--r--partitions.py33
5 files changed, 75 insertions, 25 deletions
diff --git a/fsset.py b/fsset.py
index 2db4746b4..fbf037c33 100644
--- a/fsset.py
+++ b/fsset.py
@@ -511,7 +511,7 @@ class ext2FileSystem(extFileSystem):
return
rc = iutil.execWithRedirect("/usr/sbin/tune2fs",
- ["tunefs", "-j", devicePath ],
+ ["tune2fs", "-j", devicePath ],
stdout = "/dev/tty5",
stderr = "/dev/tty5")
@@ -800,6 +800,24 @@ class FileSystemSet:
entry.order)
return fstab
+ def mtab (self):
+ format = "%s %s %s %s 0 0\n"
+ mtab = ""
+ for entry in self.entries:
+ if entry.mountpoint:
+ # swap doesn't end up in the mtab
+ if entry.fsystem.getName() == "swap":
+ continue
+ if entry.options:
+ options = "rw," + entry.options
+ else:
+ options = "rw"
+ mtab = mtab + format % (devify(entry.device.getDevice()),
+ entry.mountpoint,
+ entry.fsystem.getName(),
+ options)
+ return mtab
+
def raidtab(self):
# set up raidtab...
raidtab = ""
@@ -1102,6 +1120,19 @@ class FileSystemSet:
else:
self.labelEntry(entry, chroot)
+ # go through and have labels for the ones we don't format
+ for entry in notformatted:
+ dev = entry.device.getDevice()
+ if not dev or dev == "none":
+ continue
+ if not entry.mountpoint:
+ continue
+ label = isys.readExt2Label(dev)
+ if label:
+ entry.setLabel(label)
+ else:
+ self.labelEntry(entry, chroot)
+
def haveMigratedFilesystems(self):
return self.migratedfs
@@ -1295,8 +1326,14 @@ class FileSystemSetEntry:
def mount(self, chroot='/', devPrefix='/tmp', readOnly = 0):
device = self.device.setupDevice(chroot, devPrefix=devPrefix)
- self.fsystem.mount(device, "%s/%s" % (chroot, self.mountpoint),
- readOnly = readOnly)
+ # FIXME: we really should migrate before turnOnFilesystems.
+ # but it's too late now
+ if (self.migrate == 1) and (self.origfsystem is not None):
+ self.origfsystem.mount(device, "%s/%s" % (chroot, self.mountpoint),
+ readOnly = readOnly)
+ else:
+ self.fsystem.mount(device, "%s/%s" % (chroot, self.mountpoint,
+ readOnly = readOnly)
self.mountcount = self.mountcount + 1
def umount(self, chroot='/'):
@@ -1734,10 +1771,10 @@ def readFstab (path):
if len(fields) < 4:
continue
elif len(fields) == 4:
- fields[4] = 0
- fields[5] = 0
+ fields.append(0)
+ fields.append(0)
elif len(fields) == 5:
- fields[5] = 0
+ fields.append(0)
elif len(fields) > 6:
continue
diff --git a/partIntfHelpers.py b/partIntfHelpers.py
index 3fb93ab42..89b1ff0de 100644
--- a/partIntfHelpers.py
+++ b/partIntfHelpers.py
@@ -321,7 +321,7 @@ def partitionSanityErrors(intf, errors):
"scheme. "
"These errors must be corrected prior "
"to continuing with your install of "
- "Red Hat Linux.\n\n%s") %(errorstr))
+ "%s.\n\n%s") %(errorstr, productName))
return rc
def partitionSanityWarnings(intf, warnings):
@@ -392,7 +392,7 @@ def confirmDeleteRequest(intf, request):
"Are you sure?")
else:
errmsg = _("You are about to delete the /dev/%s partition.\n\n"
- "Are you sure?" % request.device)
+ "Are you sure?" % (request.device,))
else:
errmsg = _("Are you sure you want to delete this partition?")
diff --git a/partedUtils.py b/partedUtils.py
index f339732ac..a61a15b48 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -232,11 +232,12 @@ def checkDiskLabel(disk, intf):
rc = intf.messageWindow(_("Warning"),
_("The partition table on device /dev/%s is of an "
"unexpected type %s for your architecture. To "
- "use this disk for installation of Red Hat Linux, "
+ "use this disk for installation of %s, "
"it must be re-initialized causing the loss of "
"ALL DATA on this drive.\n\n"
"Would you like to initialize this drive?")
- % (disk.dev.path[5:], disk.type.name), type = "yesno")
+ % (disk.dev.path[5:], disk.type.name, productName),
+ type = "yesno")
if rc == 0:
return 1
else:
@@ -323,12 +324,6 @@ class DiskSet:
except SystemError, (errno, msg):
pass
- if not found:
- intf.messageWindow(_("Error"),
- _("Error mounting filesystem "
- "on %s: %s") % (dev, msg))
- continue
-
if os.access (mountpoint + '/etc/fstab', os.R_OK):
rootparts.append ((dev, fs))
isys.umount(mountpoint)
diff --git a/partitioning.py b/partitioning.py
index 2be73f017..8a1a7fe7f 100644
--- a/partitioning.py
+++ b/partitioning.py
@@ -160,7 +160,8 @@ def partitioningComplete(bl, fsset, diskSet, partitions, intf, instPath, dir):
if rc == 0:
sys.exit(0)
return DISPATCH_FORWARD
-
+
+ partitions.sortRequests()
fsset.reset()
for request in partitions.requests:
# XXX improve sanity checking
diff --git a/partitions.py b/partitions.py
index 0ad420d24..c9c0a5361 100644
--- a/partitions.py
+++ b/partitions.py
@@ -413,12 +413,27 @@ class Partitions:
n = 0
while n < len(self.requests):
for request in self.requests:
- if (request.size and self.requests[n].size and
+ # for raid requests, the only thing that matters for sorting
+ # is the raid device since ordering by size is mostly
+ # irrelevant. this also keeps things more consistent
+ if (request.type == REQUEST_RAID or
+ self.requests[n].type == REQUEST_RAID):
+ if (request.type == self.requests[n].type and
+ (self.requests[n].raidminor != None) and
+ ((request.raidminor is None) or
+ request.raidminor > self.requests[n].raidminor)):
+ tmp = self.requests[n]
+ index = self.requests.index(request)
+ self.requests[n] = request
+ self.requests[index] = tmp
+ # for sized requests, we want the larger ones first
+ elif (request.size and self.requests[n].size and
(request.size < self.requests[n].size)):
tmp = self.requests[n]
index = self.requests.index(request)
self.requests[n] = request
self.requests[index] = tmp
+ # for cylinder-based, sort by order on the drive
elif (request.start and self.requests[n].start and
(request.drive == self.requests[n].drive) and
(request.type == self.requests[n].type) and
@@ -427,6 +442,8 @@ class Partitions:
index = self.requests.index(request)
self.requests[n] = request
self.requests[index] = tmp
+ # finally just use when they defined the partition so
+ # there's no randomness thrown in
elif (request.size and self.requests[n].size and
(request.size == self.requests[n].size) and
(request.uniqueID < self.requests[n].uniqueID)):
@@ -474,13 +491,13 @@ class Partitions:
slash = self.getRequestByMountPoint('/')
if not slash:
errors.append(_("You have not defined a root partition (/), "
- "which is required for installation of Red "
- "Hat Linux to continue."))
+ "which is required for installation of %s "
+ "to continue.") % (productName,))
if slash and requestSize(slash, diskset) < 250:
warnings.append(_("Your root partition is less than 250 "
"megabytes which is usually too small to "
- "install Red Hat Linux."))
+ "install %s.") % (productName,))
if iutil.getArch() == "ia64":
bootreq = self.getRequestByMountPoint("/boot/efi")
@@ -495,8 +512,8 @@ class Partitions:
if requestSize(req, diskset) < size:
warnings.append(_("Your %s partition is less than %s "
"megabytes which is lower than recommended "
- "for a normal Red Hat Linux install.")
- %(mount, size))
+ "for a normal %s install.")
+ %(mount, size, productName))
foundSwap = 0
swapSize = 0
@@ -538,8 +555,8 @@ class Partitions:
# XXX number of swaps not exported from kernel and could change
if foundSwap >= 32:
warnings.append(_("You have specified more than 32 swap devices. "
- "The kernel for Red Hat Linux only supports 32 "
- "swap devices."))
+ "The kernel for %s only supports 32 "
+ "swap devices.") % (productName,))
mem = iutil.memInstalled(corrected = 0)
rem = mem % 16384