Добавлена возможность выбора файловой системы для корня и данных при авторазметке

develop 3.6.2.5
parent eeb361db80
commit 420b9b27b2

@ -110,6 +110,7 @@ class FileSystemManager(object):
'gpt': '8200',
'label': '',
'ssd': [],
'auto': False,
'msdos': '82'},
'uefi': {'defaultopt': defaultOpt,
'format': '/usr/sbin/mkfs.vfat',
@ -118,6 +119,7 @@ class FileSystemManager(object):
'label': '-n {labelname}',
'msdos': '0b',
'ssd': [],
'auto': False,
'type': ['hdd']},
'vfat': {'defaultopt': defaultOpt,
'format': '/usr/sbin/mkfs.vfat',
@ -125,6 +127,7 @@ class FileSystemManager(object):
'gpt': '0700',
'label': '-n {labelname}',
'msdos': '0b',
'auto': False,
'ssd': ['discard'],
'type': ['flash']},
'ntfs': {'defaultopt': defaultOpt,
@ -133,6 +136,7 @@ class FileSystemManager(object):
'gpt': '8300',
'label': '-L {labelname}',
'msdos': '7',
'auto': False,
'ssd': [],
'compatible': ['ntfs-3g']},
'ntfs-3g': {'defaultopt': defaultOpt,
@ -141,6 +145,7 @@ class FileSystemManager(object):
'gpt': '8300',
'label': '-L {labelname}',
'ssd': [],
'auto': False,
'msdos': '7',
'compatible': ['ntfs']}}
@ -160,6 +165,8 @@ class FileSystemManager(object):
defaultFS = {
'hdd': ("ext4"
if path.exists(supportFS['ext4']['format']) else
"btrfs"
if path.exists(supportFS['btrfs']['format']) else
"reiserfs"
if path.exists(supportFS['reiserfs']['format']) else
"ext3"),

@ -382,6 +382,12 @@ class VariableClAutopartitionFactory(ReadonlyVariable):
sb = self.Get('cl_autopartition_scheme_builder')
if sb and sb.devices:
df.default_format = sb.default_format
root_purpose = partition.VolumesBuilder.Purpose.MainRoot
data_purpose = partition.VolumesBuilder.Purpose.Calculate
df.purpose_format[root_purpose] = \
self.Get('cl_autopartition_root_format')
df.purpose_format[data_purpose] = \
self.Get('cl_autopartition_calculate_format')
try:
sb.process(df)
except (partition.SchemeError, partition.VirtualDiskError):
@ -402,8 +408,38 @@ class VariableClAutopartitionDefaultFormat(Variable):
return FileSystemManager.defaultFS['hdd']
def choice(self):
return [k for k,v in FileSystemManager.supportFS.items()
if "hdd" in v.get('type',[])]
return list(sorted([k for k,v in FileSystemManager.supportFS.items()
if v.get('auto',True)]))
class VariableClAutopartitionRootFormat(VariableClAutopartitionDefaultFormat):
"""
Формат файловой системы для корня
"""
opt = ["--root-fs"]
metavalue = "FS"
def init(self):
self.label = _("Filesystem for root partition")
self.help = _("set filesystem for root partititon")
def get(self):
return self.Get('cl_autopartition_default_format')
class VariableClAutopartitionCalculateFormat(VariableClAutopartitionDefaultFormat):
"""
Формат файловой системы для calculate
"""
opt = ["--calculate-fs"]
metavalue = "FS"
def init(self):
self.label = _("Filesystem for data partition")
self.help = _("set filesystem for data partititon")
def get(self):
return self.Get('cl_autopartition_default_format')
class VariableClAutopartitionCalculateSize(Variable):

@ -1330,9 +1330,12 @@ class VariableOsLocationFormat(LocationHelper, Variable):
if self.Get('os_root_type_ext') in RootType.HDD:
root_format = self.select(
'os_disk_format', os_disk_mount="/", limit=1)
if root_format and self.select(
'os_format_use', os_format_type=root_format, limit=1) == "yes":
default_format = root_format
autoformat = self.Get('cl_autopartition_default_format')
for _format in (root_format, autoformat):
if _format and self.select(
'os_format_use', os_format_type=_format, limit=1) == "yes":
default_format = _format
break
def wrap(info):
dev, mount, fs = info

@ -83,9 +83,13 @@ class Wsdl(WsdlBase):
normal=('cl_autopartition_set',),
hide=('cl_autopartition_set',
'cl_autopartition_root_size',
'cl_autopartition_root_format',
'cl_autopartition_calculate_format',
'cl_autopartition_swap_size',),
brief=('cl_autopartition_brief_set',),
expert=('cl_autopartition_scheme',
'cl_autopartition_root_format',
'cl_autopartition_calculate_format',
'cl_autopartition_table',
'cl_autopartition_root_size',
'cl_autopartition_swap_size',

Loading…
Cancel
Save