From f87e69036a7e113d554bab1d4db96cf8df01e88d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Tue, 8 Dec 2015 13:40:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D1=8B?= =?UTF-8?q?=20=D0=B0=D0=B2=D1=82=D0=BE=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=82?= =?UTF-8?q?=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/install/distr.py | 16 +++++++++---- pym/install/variables/autopartition.py | 33 +++++++++----------------- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/pym/install/distr.py b/pym/install/distr.py index c5cd076..55157e8 100644 --- a/pym/install/distr.py +++ b/pym/install/distr.py @@ -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], diff --git a/pym/install/variables/autopartition.py b/pym/install/variables/autopartition.py index 6bf268f..ca1a869 100644 --- a/pym/install/variables/autopartition.py +++ b/pym/install/variables/autopartition.py @@ -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):