|
|
|
@ -35,6 +35,7 @@ class FileSystemManager(object):
|
|
|
|
|
'label': '-L {labelname}',
|
|
|
|
|
'ssd': [],
|
|
|
|
|
'msdos': '83',
|
|
|
|
|
'compress': None,
|
|
|
|
|
'type': ['hdd', 'usb-hdd']},
|
|
|
|
|
'ext3': {'defaultopt': defaultOpt,
|
|
|
|
|
'format': '/sbin/mkfs.ext3',
|
|
|
|
@ -43,6 +44,7 @@ class FileSystemManager(object):
|
|
|
|
|
'label': '-L {labelname}',
|
|
|
|
|
'ssd': [],
|
|
|
|
|
'msdos': '83',
|
|
|
|
|
'compress': None,
|
|
|
|
|
'type': ['hdd', 'usb-hdd']},
|
|
|
|
|
'ext4': {'defaultopt': defaultOpt,
|
|
|
|
|
'format': '/sbin/mkfs.ext4',
|
|
|
|
@ -51,6 +53,7 @@ class FileSystemManager(object):
|
|
|
|
|
'label': '-L {labelname}',
|
|
|
|
|
'ssd': ['discard'],
|
|
|
|
|
'msdos': '83',
|
|
|
|
|
'compress': None,
|
|
|
|
|
'type': ['hdd', 'usb-hdd']},
|
|
|
|
|
'reiserfs': {'defaultopt': defaultOpt,
|
|
|
|
|
'format': '/sbin/mkfs.reiserfs',
|
|
|
|
@ -58,6 +61,7 @@ class FileSystemManager(object):
|
|
|
|
|
'gpt': '8300',
|
|
|
|
|
'label': '-l {labelname}',
|
|
|
|
|
'msdos': '83',
|
|
|
|
|
'compress': None,
|
|
|
|
|
'ssd': [],
|
|
|
|
|
'type': ['hdd', 'usb-hdd']},
|
|
|
|
|
'btrfs': {'defaultopt': defaultOpt,
|
|
|
|
@ -68,10 +72,12 @@ class FileSystemManager(object):
|
|
|
|
|
'msdos': '83',
|
|
|
|
|
'ssd': ['ssd', 'discard', 'space_cache'],
|
|
|
|
|
'type': ['hdd', 'usb-hdd'],
|
|
|
|
|
'compress': None,
|
|
|
|
|
'compatible': ['btrfs-compress']},
|
|
|
|
|
'btrfs-compress': {'defaultopt': defaultOpt,
|
|
|
|
|
'format': '/sbin/mkfs.btrfs',
|
|
|
|
|
'orig': 'btrfs',
|
|
|
|
|
'compress': "compress=%s",
|
|
|
|
|
'formatparam': '{labelparam} -f {device}',
|
|
|
|
|
'gpt': '8300',
|
|
|
|
|
'label': '-L {labelname}',
|
|
|
|
@ -86,6 +92,7 @@ class FileSystemManager(object):
|
|
|
|
|
'label': '-L {labelname}',
|
|
|
|
|
'msdos': '83',
|
|
|
|
|
'ssd': ['discard'],
|
|
|
|
|
'compress': None,
|
|
|
|
|
'type': ['hdd', 'usb-hdd']},
|
|
|
|
|
'xfs': {'defaultopt': defaultOpt,
|
|
|
|
|
'format': '/sbin/mkfs.xfs',
|
|
|
|
@ -95,6 +102,7 @@ class FileSystemManager(object):
|
|
|
|
|
'msdos': '83',
|
|
|
|
|
'boot': '-i sparce=0',
|
|
|
|
|
'ssd': ['discard'],
|
|
|
|
|
'compress': None,
|
|
|
|
|
'type': ['hdd', 'usb-hdd']},
|
|
|
|
|
# 'nilfs2': {'defaultopt': defaultOpt,
|
|
|
|
|
# 'format': '/sbin/mkfs.nilfs2',
|
|
|
|
@ -111,6 +119,7 @@ class FileSystemManager(object):
|
|
|
|
|
'label': '',
|
|
|
|
|
'ssd': [],
|
|
|
|
|
'auto': False,
|
|
|
|
|
'compress': None,
|
|
|
|
|
'msdos': '82'},
|
|
|
|
|
'uefi': {'defaultopt': defaultOpt,
|
|
|
|
|
'format': '/usr/sbin/mkfs.vfat',
|
|
|
|
@ -120,6 +129,7 @@ class FileSystemManager(object):
|
|
|
|
|
'msdos': '0b',
|
|
|
|
|
'ssd': [],
|
|
|
|
|
'auto': False,
|
|
|
|
|
'compress': None,
|
|
|
|
|
'type': ['hdd']},
|
|
|
|
|
'vfat': {'defaultopt': defaultOpt,
|
|
|
|
|
'format': '/usr/sbin/mkfs.vfat',
|
|
|
|
@ -129,6 +139,7 @@ class FileSystemManager(object):
|
|
|
|
|
'msdos': '0b',
|
|
|
|
|
'auto': False,
|
|
|
|
|
'ssd': ['discard'],
|
|
|
|
|
'compress': None,
|
|
|
|
|
'type': ['flash']},
|
|
|
|
|
'ntfs': {'defaultopt': defaultOpt,
|
|
|
|
|
'format': '/usr/sbin/mkfs.ntfs',
|
|
|
|
@ -138,6 +149,7 @@ class FileSystemManager(object):
|
|
|
|
|
'msdos': '7',
|
|
|
|
|
'auto': False,
|
|
|
|
|
'ssd': [],
|
|
|
|
|
'compress': None,
|
|
|
|
|
'compatible': ['ntfs-3g']},
|
|
|
|
|
'ntfs-3g': {'defaultopt': defaultOpt,
|
|
|
|
|
'format': '/usr/sbin/mkfs.ntfs',
|
|
|
|
@ -147,11 +159,13 @@ class FileSystemManager(object):
|
|
|
|
|
'ssd': [],
|
|
|
|
|
'auto': False,
|
|
|
|
|
'msdos': '7',
|
|
|
|
|
'compress': None,
|
|
|
|
|
'compatible': ['ntfs']}}
|
|
|
|
|
|
|
|
|
|
default_param = {'defaultopt': defaultOpt,
|
|
|
|
|
'gpt': '8300',
|
|
|
|
|
'msdos': '83',
|
|
|
|
|
'compress': None,
|
|
|
|
|
'ssd': []}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
@ -179,10 +193,12 @@ class FileSystemManager(object):
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def getDefaultOpt(cls, fs, ssd=False):
|
|
|
|
|
return ",".join(cls.supportFS.get(fs, cls.default_param)['defaultopt'] +
|
|
|
|
|
(cls.supportFS.get(fs, cls.default_param)['ssd']
|
|
|
|
|
if ssd else []))
|
|
|
|
|
def getDefaultOpt(cls, fs, ssd=False, compress=None):
|
|
|
|
|
fsopts = cls.supportFS.get(fs, cls.default_param)
|
|
|
|
|
return ",".join(fsopts['defaultopt'] +
|
|
|
|
|
(fsopts['ssd'] if ssd else []) +
|
|
|
|
|
([fsopts['compress'] % compress]
|
|
|
|
|
if fsopts['compress'] and compress else []))
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def checkFSForTypeMount(cls, fs, roottype, mp):
|
|
|
|
|