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

master3.4 3.4.4.4
parent 6a30944acc
commit f87e69036a

@ -1074,7 +1074,7 @@ class PartitionDistributive(Distributive):
def formatAllPartitions(self):
"""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
dataPartitions = zip(self.multipartition.getFileSystems() + \
[self.fileSystem],
@ -1085,14 +1085,16 @@ class PartitionDistributive(Distributive):
self.multipartition.getSystemId() + \
[self.systemId],
self.multipartition.getPartitionTable() + \
[self.partitionTable])
[self.partitionTable],
self.multipartition.getMountPoints() + \
["/"])
# 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(
lambda x: x[NEEDFORMAT] and x[FS] != "bind",
dataPartitions))
# format all get partition
for fileSystem, dev, newID in formatPartitions:
for fileSystem, dev, newID, mp in formatPartitions:
if fileSystem == "swap":
self.formatSwapPartition(dev)
else:
@ -1102,7 +1104,11 @@ class PartitionDistributive(Distributive):
self.formatPartition(dev, format=fileSystem,
label=self.rootLabel)
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
changeidPartitions = map(lambda x: (x[NEWID], x[DEV], x[PARTTABLE]),
filter(lambda x: x[NEWID],

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

Loading…
Cancel
Save