Изменены параметры авторазметки

master3.4 3.4.4.4
parent 6a30944acc
commit f87e69036a

@ -1074,7 +1074,7 @@ class PartitionDistributive(Distributive):
def formatAllPartitions(self): def formatAllPartitions(self):
"""Format all partitions""" """Format all partitions"""
FS, DEV, NEEDFORMAT, NEWID, PARTTABLE = 0, 1, 2, 3, 4 FS, DEV, NEEDFORMAT, NEWID, PARTTABLE, MP = 0, 1, 2, 3, 4, 5
# get all information to matrix # get all information to matrix
dataPartitions = zip(self.multipartition.getFileSystems() + \ dataPartitions = zip(self.multipartition.getFileSystems() + \
[self.fileSystem], [self.fileSystem],
@ -1085,14 +1085,16 @@ class PartitionDistributive(Distributive):
self.multipartition.getSystemId() + \ self.multipartition.getSystemId() + \
[self.systemId], [self.systemId],
self.multipartition.getPartitionTable() + \ self.multipartition.getPartitionTable() + \
[self.partitionTable]) [self.partitionTable],
self.multipartition.getMountPoints() + \
["/"])
# get partition which need format # get partition which need format
formatPartitions = map(lambda x: (x[FS], x[DEV], x[NEWID]), formatPartitions = map(lambda x: (x[FS], x[DEV], x[NEWID], x[MP]),
filter( filter(
lambda x: x[NEEDFORMAT] and x[FS] != "bind", lambda x: x[NEEDFORMAT] and x[FS] != "bind",
dataPartitions)) dataPartitions))
# format all get partition # format all get partition
for fileSystem, dev, newID in formatPartitions: for fileSystem, dev, newID, mp in formatPartitions:
if fileSystem == "swap": if fileSystem == "swap":
self.formatSwapPartition(dev) self.formatSwapPartition(dev)
else: else:
@ -1102,7 +1104,11 @@ class PartitionDistributive(Distributive):
self.formatPartition(dev, format=fileSystem, self.formatPartition(dev, format=fileSystem,
label=self.rootLabel) label=self.rootLabel)
else: else:
self.formatPartition(dev, format=fileSystem) if mp == '/var/calculate':
self.formatPartition(dev, format=fileSystem,
label="Calculate")
else:
self.formatPartition(dev, format=fileSystem)
# change system id for partitions # change system id for partitions
changeidPartitions = map(lambda x: (x[NEWID], x[DEV], x[PARTTABLE]), changeidPartitions = map(lambda x: (x[NEWID], x[DEV], x[PARTTABLE]),
filter(lambda x: x[NEWID], filter(lambda x: x[NEWID],

@ -332,7 +332,7 @@ class AutopartitionHelper(VariableInterface):
yield i yield i
def bindOpts(self, listvalue): def bindOpts(self, listvalue):
return filter(lambda x: x in ("home",), return filter(lambda x: x in ("data",),
listvalue) listvalue)
def mpByOpts(self, value): def mpByOpts(self, value):
@ -345,11 +345,11 @@ class AutopartitionHelper(VariableInterface):
return mapMp.get(value, '') return mapMp.get(value, '')
def sourceMpByOpts(self, value): def sourceMpByOpts(self, value):
mapMp = {'home': '/var/calculate/home'} mapMp = {'data': '/var/calculate/home'}
return mapMp.get(value, '') return mapMp.get(value, '')
def targetMpByOpts(self, value): def targetMpByOpts(self, value):
mapMp = {'home': '/home'} mapMp = {'data': '/home'}
return mapMp.get(value, '') return mapMp.get(value, '')
def getAutopartitionScheme(self): def getAutopartitionScheme(self):
@ -526,8 +526,7 @@ class VariableClAutopartitionBriefSet(VariableClAutopartitionSet):
def uncompatible(self): def uncompatible(self):
if self.Get('os_install_root_type') == 'flash': if self.Get('os_install_root_type') == 'flash':
return \ return _("This option not used for Flash install")
_("This option not used for Flash install")
class VariableClAutopartitionScheme(AutopartitionHelper, AutoPartition, class VariableClAutopartitionScheme(AutopartitionHelper, AutoPartition,
@ -547,22 +546,19 @@ class VariableClAutopartitionScheme(AutopartitionHelper, AutoPartition,
def get(self): def get(self):
if self.Get('os_uefi_set') == 'on': if self.Get('os_uefi_set') == 'on':
return ["uefi", "swap", "data", "home"] return ["uefi", "swap", "root", "data"]
elif self.Get('cl_autopartition_table') == 'gpt': elif self.Get('cl_autopartition_table') == 'gpt':
return ["swap", "data", "home", "grub"] return ["swap", "root", "data"]
else: else:
return ["swap", "data", "home"] return ["swap", "root", "data"]
def choice(self): def choice(self):
return [ return [
("swap", _("Swap partition")), ("swap", _("Swap partition")),
("root", _("Additional root partition")), ("root", _("Additional root partition")),
("data", _("/var/calculate partition")), ("data", _("/var/calculate partition")),
("home", _("Mount /var/calculate/home to /home")),
("boot", _("Separate boot partition")),
("uefi", _("Use the UEFI bootloader")), ("uefi", _("Use the UEFI bootloader")),
("lvm", _("Use LVM")), ("lvm", _("Use LVM")),
("grub", _("Create the bios_grub partition")),
] ]
def check(self, value): def check(self, value):
@ -579,16 +575,6 @@ class VariableClAutopartitionScheme(AutopartitionHelper, AutoPartition,
raise VariableError( raise VariableError(
_("The partition table must be GPT for using " _("The partition table must be GPT for using "
"UEFI bootloader")) "UEFI bootloader"))
else:
if self.Get(
'cl_autopartition_table') == 'gpt' and not "grub" in value:
raise VariableError(
_("A 'bios_grub' partition is needed to install grub"))
if "grub" in value:
if self.Get('cl_autopartition_table') != 'gpt':
raise VariableError(
_(
"The bios_grub partition need the partition table to be GPT"))
class VariableClAutopartitionRootSizeDefault(Variable): class VariableClAutopartitionRootSizeDefault(Variable):
@ -677,7 +663,10 @@ class VariableClAutopartitionBiosGrubSet(ReadonlyVariable):
type = "bool" type = "bool"
def get(self): def get(self):
return "on" if "grub" in self.Get('cl_autopartition_scheme') else "off" if (self.GetBool('cl_autopartition_set') and
self.Get('cl_autopartition_table') == 'gpt'):
return "on"
return "off"
class VariableClAutopartitionLvmSet(ReadonlyVariable): class VariableClAutopartitionLvmSet(ReadonlyVariable):

Loading…
Cancel
Save