[PATCH] Put fsprofile support back in.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 kickstart.py          |   15 ++++++---------
 storage/formats/fs.py |    6 +++++-
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/kickstart.py b/kickstart.py
index adab33a..5ba0773 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -484,9 +484,8 @@ class LogVolData(commands.logvol.F12_LogVolData):
                                     maxsize=self.maxSizeMB,
                                     percent=self.percent)
 
-            # FIXME: no way to specify an fsprofile right now
-            # if lvd.fsprofile:
-            #     request.format.fsprofile = lvd.fsprofile
+            if self.fsprofile and hasattr(request.format, "fsprofile"):
+                request.format.fsprofile = self.fsprofile
 
             storage.createDevice(request)
 
@@ -734,9 +733,8 @@ class PartitionData(commands.partition.F12_PartData):
 
             request = storage.newPartition(**kwargs)
 
-            # FIXME: no way to specify an fsprofile right now
-            # if self.fsprofile:
-            #     request.format.fsprofile = self.fsprofile
+            if self.fsprofile and hasattr(request.format, "fsprofile"):
+                request.format.fsprofile = self.fsprofile
 
             storage.createDevice(request)
 
@@ -874,9 +872,8 @@ class RaidData(commands.raid.F12_RaidData):
             except ValueError, e:
                 raise KickstartValueError, formatErrorMsg(self.lineno, msg=str(e))
 
-            # FIXME: no way to specify an fsprofile right now
-            # if pd.fsprofile:
-            #     request.format.fsprofile = pd.fsprofile
+            if self.fsprofile and hasattr(request.format, "fsprofile"):
+                request.format.fsprofile = self.fsprofile
 
             storage.createDevice(request)
 
diff --git a/storage/formats/fs.py b/storage/formats/fs.py
index 239386d..09e764d 100644
--- a/storage/formats/fs.py
+++ b/storage/formats/fs.py
@@ -124,6 +124,7 @@ class FS(DeviceFormat):
     _defaultInfoOptions = []
     _migrationTarget = None
     _existingSizeFields = []
+    _fsProfileSpecifier = None           # mkfs option specifying fsprofile
 
     def __init__(self, *args, **kwargs):
         """ Create a FS instance.
@@ -143,10 +144,10 @@ class FS(DeviceFormat):
             raise TypeError("FS is an abstract class.")
 
         DeviceFormat.__init__(self, *args, **kwargs)
-        # TODO: fsprofiles and other ways to add format args
         self.mountpoint = kwargs.get("mountpoint")
         self.mountopts = kwargs.get("mountopts")
         self.label = kwargs.get("label")
+        self.fsprofile = kwargs.get("fsprofile")
 
         # filesystem size does not necessarily equal device size
         self._size = kwargs.get("size", 0)
@@ -297,6 +298,8 @@ class FS(DeviceFormat):
         if options and isinstance(options, list):
             argv.extend(options)
         argv.extend(self.defaultFormatOptions)
+        if self._fsProfileSpecifier and self.fsprofile:
+            argv.extend([self._fsProfileSpecifier, self.fsprofile])
         argv.append(self.device)
         return argv
     
@@ -872,6 +875,7 @@ class Ext2FS(FS):
     _infofs = "dumpe2fs"
     _defaultInfoOptions = ["-h"]
     _existingSizeFields = ["Block count:", "Block size:"]
+    _fsProfileSpecifier = "-T"
     partedSystem = fileSystemType["ext2"]
 
     def _fsckFailed(self, rc):
-- 
1.6.5.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux