Изменена проверка совместимости --uefi и --mbr

* Перенесена проверка на одновременное использование --uefi --mbr из uncompatible в check
* Добавлена проверка корректности выбора --mbr*
* Исправлена список для выбора для GUI
master-3.5 3.5.7_alpha2
parent a62401e819
commit 221f24d6ff

@ -1976,12 +1976,13 @@ class VariableOsInstallUefi(LocationHelper, Variable):
return self.select('os_device_efi',
os_device_dev=efidev, limit=1) or efidev
return efidev
return map(transform, value)
return filter(lambda x: x != "off", map(transform, value))
def choice(self):
deviceParentMap = self.ZipVars('os_device_efi', 'os_device_name')
return [(efidisk, name or _("Unknown"))
for efidisk, name in deviceParentMap
deviceParentMap = self.ZipVars('os_device_dev',
'os_device_efi', 'os_device_name')
return [(efidisk, "%s (%s)" % (name or _("Unknown"), dev))
for dev, efidisk, name in deviceParentMap
if efidisk]
def check(self, value):
@ -2045,12 +2046,12 @@ class VariableOsInstallMbr(LocationHelper, Variable):
"""
Disks for boot mbr
"""
type = "choice-list"
type = "choiceedit-list"
element = "selecttable"
opt = ["--mbr"]
metavalue = "MBR"
untrusted = True
check_after = ["os_install_uefi_set"]
check_after = ["os_install_uefi"]
def init(self):
self.label = _("Boot disk")
@ -2082,7 +2083,7 @@ class VariableOsInstallMbr(LocationHelper, Variable):
def choice(self):
deviceParentMap = self.ZipVars('os_device_mbr', 'os_device_name')
return [(mbrdisk, name or _("Unknown"))
return [(mbrdisk, "%s (%s)" % (name or _("Unknown"), mbrdisk))
for mbrdisk, name in deviceParentMap
if mbrdisk]
@ -2091,15 +2092,15 @@ class VariableOsInstallMbr(LocationHelper, Variable):
return filter(lambda x: x != "off", value)
def check(self, value):
if self.Get('cl_autopartition_set') == "on":
if self.GetBool('cl_autopartition_set'):
return
rootType = self.Get('os_install_root_type')
if rootType == "flash":
if len(value) > 1:
raise VariableError(
_("For Flash install, you need only one disk"))
if self.Get('os_install_uefi_set') == 'on':
return
if value and self.Get('os_install_uefi_set') == "on":
raise VariableError(_("MBR is not used with the UEFI bootloader"))
useBtrfs = "btrfs" in self.Select('os_install_disk_format',
where='os_install_disk_mount',
_in=('/', '/boot'),
@ -2143,6 +2144,10 @@ class VariableOsInstallMbr(LocationHelper, Variable):
_("Your boot device must have a BIOS Boot "
"partition ({minsize})").format(
minsize=minsize))
if mbrDisk not in self.Get('os_device_mbr'):
raise VariableError(
_("Device {device} has not BIOS Boot partition").format(
device=mbrDisk))
if value:
if not self.Get('os_grub2_path'):
self.checkForLegacyGrub()
@ -2169,8 +2174,6 @@ class VariableOsInstallMbr(LocationHelper, Variable):
"""
Опция несовместима с использованием UEFI
"""
if self.Get('os_install_uefi_set') == "on" and self.Get():
return _("MBR is not used with the UEFI bootloader")
if self.Get('cl_autopartition_set') == "on":
return \
_("The layout is not available with autopartitioning")

Loading…
Cancel
Save