|
|
|
@ -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):
|
|
|
|
|