|
|
|
@ -303,6 +303,25 @@ class DirectoryDistributive(Distributive):
|
|
|
|
|
self.copy(dFrom.directory,self.directory)
|
|
|
|
|
|
|
|
|
|
class PartitionDistributive(Distributive):
|
|
|
|
|
# TODO: need node value for ext2 ext3
|
|
|
|
|
formatUtilities = { 'ext2':'/sbin/mkfs.ext2 %s',
|
|
|
|
|
'ext3':'/sbin/mkfs.ext3 %s',
|
|
|
|
|
'ext4':'/sbin/mkfs.ext4 %s',
|
|
|
|
|
'jfs':'/sbin/mkfs.jfs -f %s',
|
|
|
|
|
'reiserfs':'/sbin/mkfs.reiserfs -f %s',
|
|
|
|
|
'xfs':'/sbin/mkfs.xfs -f %s',
|
|
|
|
|
'vfat':'/sbin/mkfs.vfat -F 32 %s',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
formatId = { 'ext2' : '83',
|
|
|
|
|
'ext3' : '83',
|
|
|
|
|
'ext4' : '83',
|
|
|
|
|
'reiserfs' : '83',
|
|
|
|
|
'jfs' : '83',
|
|
|
|
|
'xfs' : '83',
|
|
|
|
|
'vfat' : 'b',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def __init__(self,partition,parent=None,mdirectory="/mnt/calculate",
|
|
|
|
|
check=False,multipartition=None):
|
|
|
|
|
"""Initialize partition distributive
|
|
|
|
@ -344,25 +363,6 @@ class PartitionDistributive(Distributive):
|
|
|
|
|
self._mountPartition(self.partition,mdirectory)
|
|
|
|
|
return DirectoryDistributive(mdirectory,parent=self)
|
|
|
|
|
|
|
|
|
|
# TODO: need node value for ext2 ext3
|
|
|
|
|
formatUtilities = { 'ext2':'/sbin/mkfs.ext2 %s',
|
|
|
|
|
'ext3':'/sbin/mkfs.ext3 %s',
|
|
|
|
|
'ext4':'/sbin/mkfs.ext4 %s',
|
|
|
|
|
'jfs':'/sbin/mkfs.jfs -f %s',
|
|
|
|
|
'reiserfs':'/sbin/mkfs.reiserfs -f %s',
|
|
|
|
|
'xfs':'/sbin/mkfs.xfs -f %s',
|
|
|
|
|
'vfat':'/sbin/mkfs.vfat -F 32 %s',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
formatId = { 'ext2' : '83',
|
|
|
|
|
'ext3' : '83',
|
|
|
|
|
'ext4' : '83',
|
|
|
|
|
'reiserfs' : '83',
|
|
|
|
|
'jfs' : '83',
|
|
|
|
|
'xfs' : '83',
|
|
|
|
|
'vfat' : 'b',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def formatPartition(self,format="reiserfs"):
|
|
|
|
|
"""Format partition"""
|
|
|
|
|
if not format in self.formatUtilities:
|
|
|
|
|