|
|
@ -314,7 +314,7 @@ class AutopartitionHelper:
|
|
|
|
return sorted(self.Get('cl_autopartition_scheme'),key=optOrder.get)
|
|
|
|
return sorted(self.Get('cl_autopartition_scheme'),key=optOrder.get)
|
|
|
|
|
|
|
|
|
|
|
|
def uncompatible(self):
|
|
|
|
def uncompatible(self):
|
|
|
|
if self.Get('cl_autopartition_set') == "manual":
|
|
|
|
if self.Get('cl_autopartition_set') == "off":
|
|
|
|
return \
|
|
|
|
return \
|
|
|
|
_("Autopartition parameters are not available "
|
|
|
|
_("Autopartition parameters are not available "
|
|
|
|
"with manual partitioning")
|
|
|
|
"with manual partitioning")
|
|
|
@ -411,7 +411,7 @@ class VariableClAutopartitionDevice(AutopartitionHelper,Variable):
|
|
|
|
self.checkNeeded(valuelist,raidDevices,"RAID")
|
|
|
|
self.checkNeeded(valuelist,raidDevices,"RAID")
|
|
|
|
|
|
|
|
|
|
|
|
def check(self,valuelist):
|
|
|
|
def check(self,valuelist):
|
|
|
|
if self.Get('cl_autopartition_set') == "auto":
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
|
if not valuelist:
|
|
|
|
if not valuelist:
|
|
|
|
raise VariableError(_("For autopartition need select install"
|
|
|
|
raise VariableError(_("For autopartition need select install"
|
|
|
|
" device"))
|
|
|
|
" device"))
|
|
|
@ -441,16 +441,18 @@ class VariableClAutopartitionSet(Variable):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Using autopartition
|
|
|
|
Using autopartition
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
type = "choiceedit"
|
|
|
|
type = "bool"
|
|
|
|
value = "manual"
|
|
|
|
value = "off"
|
|
|
|
element = "radio"
|
|
|
|
element = "radio"
|
|
|
|
|
|
|
|
opt = ["--autopartition"]
|
|
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
def init(self):
|
|
|
|
self.label = _("Partitions")
|
|
|
|
self.label = _("Partitions")
|
|
|
|
|
|
|
|
self.help = _("use autoparitition")
|
|
|
|
|
|
|
|
|
|
|
|
def choice(self):
|
|
|
|
def choice(self):
|
|
|
|
return [("manual",_("Manual partition")),
|
|
|
|
return [("off",_("Manual partition")),
|
|
|
|
("auto",_("Autopartition"))]
|
|
|
|
("on",_("Autopartition"))]
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClAutopartitionScheme(AutopartitionHelper,Variable,AutoPartition):
|
|
|
|
class VariableClAutopartitionScheme(AutopartitionHelper,Variable,AutoPartition):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
@ -459,7 +461,7 @@ class VariableClAutopartitionScheme(AutopartitionHelper,Variable,AutoPartition):
|
|
|
|
type = "choice-list"
|
|
|
|
type = "choice-list"
|
|
|
|
value = ["swap","root","data"]
|
|
|
|
value = ["swap","root","data"]
|
|
|
|
element = "selecttable"
|
|
|
|
element = "selecttable"
|
|
|
|
opt = ["--autopart"]
|
|
|
|
opt = ["--auto-scheme"]
|
|
|
|
metavalue = "AUTOPARTOPTS"
|
|
|
|
metavalue = "AUTOPARTOPTS"
|
|
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
def init(self):
|
|
|
@ -520,7 +522,7 @@ class VariableClAutopartitionRootSize(AutopartitionHelper,Variable):
|
|
|
|
|
|
|
|
|
|
|
|
def check(self,value):
|
|
|
|
def check(self,value):
|
|
|
|
if self.Get('cl_autopartition_device') and \
|
|
|
|
if self.Get('cl_autopartition_device') and \
|
|
|
|
self.Get('cl_autopartition_set') == "auto":
|
|
|
|
self.Get('cl_autopartition_set') == "on":
|
|
|
|
if int(value) < Sizes().to_M(MINROOTSIZE):
|
|
|
|
if int(value) < Sizes().to_M(MINROOTSIZE):
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("Root partition size should not be less {size}").format(
|
|
|
|
_("Root partition size should not be less {size}").format(
|
|
|
@ -612,7 +614,7 @@ class VariableClAutopartitionDiskDev(ReadonlyVariable,AutopartitionHelper):
|
|
|
|
return self.generateDisks
|
|
|
|
return self.generateDisks
|
|
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
if self.Get('cl_autopartition_set') == "auto":
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
|
scheme = self.getAutopartitionScheme()
|
|
|
|
scheme = self.getAutopartitionScheme()
|
|
|
|
devices = self.Get('cl_autopartition_device')
|
|
|
|
devices = self.Get('cl_autopartition_device')
|
|
|
|
if devices:
|
|
|
|
if devices:
|
|
|
@ -637,7 +639,7 @@ class VariableClAutopartitionDiskMount(ReadonlyVariable,AutopartitionHelper):
|
|
|
|
yield self.mpByOpts(line)
|
|
|
|
yield self.mpByOpts(line)
|
|
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
if self.Get('cl_autopartition_set') == "auto":
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
|
scheme = self.getAutopartitionScheme()
|
|
|
|
scheme = self.getAutopartitionScheme()
|
|
|
|
device = self.Get('cl_autopartition_device')
|
|
|
|
device = self.Get('cl_autopartition_device')
|
|
|
|
if device:
|
|
|
|
if device:
|
|
|
@ -659,7 +661,7 @@ class VariableClAutopartitionDiskFormat(ReadonlyVariable,AutopartitionHelper):
|
|
|
|
else: yield FileSystemManager.defaultFS['hdd']
|
|
|
|
else: yield FileSystemManager.defaultFS['hdd']
|
|
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
if self.Get('cl_autopartition_set') == "auto":
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
|
scheme = self.getAutopartitionScheme()
|
|
|
|
scheme = self.getAutopartitionScheme()
|
|
|
|
device = self.Get('cl_autopartition_device')
|
|
|
|
device = self.Get('cl_autopartition_device')
|
|
|
|
if device:
|
|
|
|
if device:
|
|
|
@ -686,7 +688,7 @@ class VariableClAutopartitionDiskPart(ReadonlyVariable,AutopartitionHelper):
|
|
|
|
yield "gpt"
|
|
|
|
yield "gpt"
|
|
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
if self.Get('cl_autopartition_set') == "auto":
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
|
scheme = self.getAutopartitionScheme()
|
|
|
|
scheme = self.getAutopartitionScheme()
|
|
|
|
table = self.Get('cl_autopartition_table')
|
|
|
|
table = self.Get('cl_autopartition_table')
|
|
|
|
if scheme:
|
|
|
|
if scheme:
|
|
|
@ -701,7 +703,7 @@ class VariableClAutopartitionDiskType(ReadonlyVariable,AutopartitionHelper):
|
|
|
|
type = "list"
|
|
|
|
type = "list"
|
|
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
if self.Get('cl_autopartition_set') == "auto":
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
|
if self.Get('cl_autopartition_lvm_set')=="on":
|
|
|
|
if self.Get('cl_autopartition_lvm_set')=="on":
|
|
|
|
diskType = "LVM"
|
|
|
|
diskType = "LVM"
|
|
|
|
else:
|
|
|
|
else:
|
|
|
@ -733,7 +735,7 @@ class VariableClAutopartitionDiskSize(ReadonlyVariable,AutopartitionHelper):
|
|
|
|
yield "allfree"
|
|
|
|
yield "allfree"
|
|
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
if self.Get('cl_autopartition_set') == "auto":
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
|
scheme = self.getAutopartitionScheme()
|
|
|
|
scheme = self.getAutopartitionScheme()
|
|
|
|
device = self.Get('cl_autopartition_device')
|
|
|
|
device = self.Get('cl_autopartition_device')
|
|
|
|
availSize = self.Get('cl_autopartition_device_size')
|
|
|
|
availSize = self.Get('cl_autopartition_device_size')
|
|
|
@ -802,7 +804,7 @@ class VariableClAutopartitionBindPath(ReadonlyVariable,AutopartitionHelper):
|
|
|
|
yield self.sourceMpByOpts(line)
|
|
|
|
yield self.sourceMpByOpts(line)
|
|
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
if self.Get('cl_autopartition_set') == "auto":
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
|
scheme = self.getAutopartitionScheme()
|
|
|
|
scheme = self.getAutopartitionScheme()
|
|
|
|
device = self.Get('cl_autopartition_device')
|
|
|
|
device = self.Get('cl_autopartition_device')
|
|
|
|
return list(self.generatePath(scheme))
|
|
|
|
return list(self.generatePath(scheme))
|
|
|
@ -820,7 +822,7 @@ class VariableClAutopartitionBindMountpoint(ReadonlyVariable,
|
|
|
|
yield self.targetMpByOpts(line)
|
|
|
|
yield self.targetMpByOpts(line)
|
|
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
if self.Get('cl_autopartition_set') == "auto":
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
|
scheme = self.getAutopartitionScheme()
|
|
|
|
scheme = self.getAutopartitionScheme()
|
|
|
|
device = self.Get('cl_autopartition_device')
|
|
|
|
device = self.Get('cl_autopartition_device')
|
|
|
|
return list(self.generateMountPoint(scheme))
|
|
|
|
return list(self.generateMountPoint(scheme))
|
|
|
|