diff options
-rw-r--r-- | fstab.py | 24 | ||||
-rw-r--r-- | installclass.py | 4 | ||||
-rw-r--r-- | kickstart.py | 10 | ||||
-rw-r--r-- | textw/partitioning_text.py | 6 |
4 files changed, 37 insertions, 7 deletions
@@ -47,12 +47,12 @@ class Fstab: swapCount = 0 fstab = [] - for (mntpoint, dev, fstype, reformat, size) in self.extraFilesystems: + for (mntpoint, dev, fstype, reformat, size, fsopts) in self.extraFilesystems: fstab.append ((dev, mntpoint)) ddruid = self.createDruid(fstab = fstab, ignoreBadDrives = 1) - for (mntpoint, size, maxsize, grow, device) in partitions: + for (mntpoint, size, maxsize, grow, device, fsopts) in partitions: type = 0x83 if (mntpoint == "swap"): mntpoint = "Swap%04d-auto" % swapCount @@ -180,6 +180,21 @@ class Fstab: if mount[0] == '/' and fsystem == "ext2": self.fsCache[(partition, mount)] = (1,) +# FSOptions is a list of options to be passed when creating fs for mount + def setfsOptions (self, mount, fsopts): + self.fsOptions[mount] = fsopts; + return + + def getfsOptions (self, mount): + if self.fsOptions.has_key(mount): + return self.fsOptions[mount] + else: + return None + + def clearfsOptions (self): + self.fsOptions = {} + return + def partitionList(self): return self.ddruid.partitionList() @@ -394,6 +409,10 @@ class Fstab: if self.badBlockCheck: args.append ("-c") + fsopts = self.getfsOptions(mntpoint) + if fsopts: + args.extend(fsopts) + w = self.waitWindow(_("Formatting"), _("Formatting %s filesystem...") % (mntpoint,)) @@ -607,6 +626,7 @@ class Fstab: readOnly, waitWindow, messageWindow): self.fsedit = fsedit self.fsCache = {} + self.clearfsOptions() self.swapOn = 0 self.supplementalRaid = [] self.beenSaved = 1 diff --git a/installclass.py b/installclass.py index 14aa94aa4..2e4218e2e 100644 --- a/installclass.py +++ b/installclass.py @@ -66,14 +66,14 @@ class InstallClass: self.raidList.append(mntPoint, raidDev, level, devices) - def addNewPartition(self, mntPoint, size, maxSize, grow, device): + def addNewPartition(self, mntPoint, size, maxSize, grow, device, fsopts=None): if not device: device = "" if mntPoint[0] != '/' and mntPoint != 'swap' and \ mntPoint[0:5] != "raid.": raise TypeError, "bad mount point for partitioning: %s" % \ (mntPoint,) - self.partitions.append((mntPoint, size, maxSize, grow, device)) + self.partitions.append((mntPoint, size, maxSize, grow, device, fsopts)) def addToFstab(self, mntpoint, dev, fstype = "ext2" , reformat = 1): self.fstab.append((mntpoint, (dev, fstype, reformat))) diff --git a/kickstart.py b/kickstart.py index f8a94f8bd..ed64caa4c 100644 --- a/kickstart.py +++ b/kickstart.py @@ -420,9 +420,11 @@ class Kickstart(InstallClass): maxSize = -1 device = None onPart = None - + fsopts = None + (args, extra) = isys.getopt(args, '', [ 'size=', 'maxsize=', - 'grow', 'onpart=', 'ondisk=' ]) + 'grow', 'onpart=', 'ondisk=', + 'bytes-per-inode=']) for n in args: (str, arg) = n @@ -436,6 +438,8 @@ class Kickstart(InstallClass): onPart = arg elif str == '--ondisk': device = arg + elif str == '--bytes-per-inode': + fsopts = ['-i', arg] if len(extra) != 1: raise ValueError, "partition command requires one anonymous argument" @@ -447,7 +451,7 @@ class Kickstart(InstallClass): else: self.addToFstab(extra[0], onPart) else: - self.addNewPartition(extra[0], size, maxSize, grow, device) + self.addNewPartition(extra[0], size, maxSize, grow, device, fsopts) def __init__(self, file, serial): InstallClass.__init__(self) diff --git a/textw/partitioning_text.py b/textw/partitioning_text.py index 0b5b2b3a8..44e091579 100644 --- a/textw/partitioning_text.py +++ b/textw/partitioning_text.py @@ -121,6 +121,12 @@ class AutoPartitionWindow: todo.fstab.formatAllFilesystems() todo.instClass.addToSkipList("format") + + # configure kickstart requested ext2 filesystem options + if todo.instClass.partitions: + for (mntpoint, size, maxsize, grow, device, fsopts) in todo.instClass.partitions: + if fsopts != None: + todo.fstab.setfsOptions (mntpoint, fsopts) return (rc, choice) = ListboxChoiceWindow(screen, _("Automatic Partitioning"), |