summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--storage/formats/__init__.py3
-rw-r--r--storage/formats/fs.py17
-rw-r--r--storage/formats/lvmpv.py3
-rw-r--r--storage/formats/mdraid.py3
-rw-r--r--storage/formats/prepboot.py3
-rw-r--r--storage/formats/swap.py3
6 files changed, 31 insertions, 1 deletions
diff --git a/storage/formats/__init__.py b/storage/formats/__init__.py
index ffaa90f80..c097e14a3 100644
--- a/storage/formats/__init__.py
+++ b/storage/formats/__init__.py
@@ -364,6 +364,9 @@ class DeviceFormat(object):
""" Minimum size (in MB) for this format type. """
return self._minSize
+ def writeKS(self, f):
+ return
+
collect_device_format_classes()
diff --git a/storage/formats/fs.py b/storage/formats/fs.py
index abecf739a..4527a0362 100644
--- a/storage/formats/fs.py
+++ b/storage/formats/fs.py
@@ -723,7 +723,7 @@ class FS(DeviceFormat):
def setup(self, *args, **kwargs):
""" Mount the filesystem.
- THe filesystem will be mounted at the directory indicated by
+ The filesystem will be mounted at the directory indicated by
self.mountpoint.
"""
return self.mount(**kwargs)
@@ -738,6 +738,9 @@ class FS(DeviceFormat):
return False
return self._mountpoint is not None
+ def writeKS(self, f):
+ f.write("%s --fstype=%s" % (self.mountpoint, self.type))
+
class Ext2FS(FS):
""" ext2 filesystem. """
@@ -1044,6 +1047,9 @@ class AppleBootstrapFS(HFS):
return (isinstance(platform.getPlatform(None), platform.NewWorldPPC)
and self.utilsAvailable)
+ def writeKS(self, f):
+ f.write("appleboot --fstype=%s" % self.type)
+
register_device_format(AppleBootstrapFS)
@@ -1159,6 +1165,9 @@ class Iso9660FS(FS):
_migratable = False
_defaultMountOptions = ["ro"]
+ def writeKS(self, f):
+ return
+
register_device_format(Iso9660FS)
@@ -1177,6 +1186,9 @@ class NoDevFS(FS):
def _getExistingSize(self):
pass
+ def writeKS(self, f):
+ return
+
register_device_format(NoDevFS)
@@ -1217,6 +1229,9 @@ class BindFS(FS):
def _getExistingSize(self):
pass
+ def writeKS(self, f):
+ return
+
register_device_format(BindFS)
diff --git a/storage/formats/lvmpv.py b/storage/formats/lvmpv.py
index a11163533..faec10967 100644
--- a/storage/formats/lvmpv.py
+++ b/storage/formats/lvmpv.py
@@ -119,5 +119,8 @@ class LVMPhysicalVolume(DeviceFormat):
return (self.exists and self.vgName and
os.path.isdir("/dev/mapper/%s" % self.vgName))
+ def writeKS(self, f):
+ f.write("pv.%s" % self.uuid)
+
register_device_format(LVMPhysicalVolume)
diff --git a/storage/formats/mdraid.py b/storage/formats/mdraid.py
index ec1a61782..b29d2f54b 100644
--- a/storage/formats/mdraid.py
+++ b/storage/formats/mdraid.py
@@ -92,6 +92,9 @@ class MDRaidMember(DeviceFormat):
# XXX hack -- we don't have a nice way to see if the array is active
return False
+ def writeKS(self, f):
+ f.write("raid.%s" % self.mdUuid)
+
register_device_format(MDRaidMember)
diff --git a/storage/formats/prepboot.py b/storage/formats/prepboot.py
index 2d851ed04..2191b81e1 100644
--- a/storage/formats/prepboot.py
+++ b/storage/formats/prepboot.py
@@ -56,6 +56,9 @@ class PPCPRePBoot(DeviceFormat):
import platform
return isinstance(platform.getPlatform(None), platform.IPSeriesPPC)
+ def writeKS(self, f):
+ f.write("prepboot --fstype=%s" % self.type)
+
register_device_format(PPCPRePBoot)
diff --git a/storage/formats/swap.py b/storage/formats/swap.py
index 31774dc05..392ed11ae 100644
--- a/storage/formats/swap.py
+++ b/storage/formats/swap.py
@@ -142,6 +142,9 @@ class SwapSpace(DeviceFormat):
swap.mkswap(self.device, label=self.label)
self.exists = True
+ def writeKS(self, f):
+ f.write("swap")
+
register_device_format(SwapSpace)