|
|
|
@ -35,7 +35,7 @@ from calculate.lib.utils.device import (getPartitionSize,
|
|
|
|
|
from calculate.install.variables.autopartition import Sizes
|
|
|
|
|
from calculate.lib.utils.files import getProgPath
|
|
|
|
|
from calculate.lib.utils.mount import isMount, FStab, DiskSpace, Btrfs, \
|
|
|
|
|
BtrfsError
|
|
|
|
|
BtrfsError, try_umount
|
|
|
|
|
from calculate.install.fs_manager import FileSystemManager
|
|
|
|
|
|
|
|
|
|
from calculate.lib.cl_lang import setLocalTranslate, _
|
|
|
|
@ -1418,6 +1418,9 @@ class VariableOsLocationPerformFormat(LocationHelper, Variable):
|
|
|
|
|
|
|
|
|
|
fixNtfs = lambda self, x: {'ntfs-3g': 'ntfs'}.get(x, x)
|
|
|
|
|
|
|
|
|
|
def is_force_param(self):
|
|
|
|
|
return "--force" in self.Get("cl_console_args")
|
|
|
|
|
|
|
|
|
|
def check(self, value):
|
|
|
|
|
"""Check perform format
|
|
|
|
|
|
|
|
|
@ -1453,9 +1456,10 @@ class VariableOsLocationPerformFormat(LocationHelper, Variable):
|
|
|
|
|
"mounted to {mountpoint} on the current system").format(
|
|
|
|
|
device=dev, mountpoint=diskMount.get(dev, '')))
|
|
|
|
|
if isMount(dev):
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Please unmount {device}, as it will be used for "
|
|
|
|
|
"installation").format(device=dev))
|
|
|
|
|
if not self.is_force_param() or not try_umount(dev):
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Please unmount {device}, as it will be used for "
|
|
|
|
|
"installation").format(device=dev))
|
|
|
|
|
# but user select non-format
|
|
|
|
|
if not self.isTrue(isformat):
|
|
|
|
|
raise VariableError(
|
|
|
|
@ -1479,9 +1483,10 @@ class VariableOsLocationPerformFormat(LocationHelper, Variable):
|
|
|
|
|
).format(
|
|
|
|
|
device=dev, mountpoint=diskMount.get(dev, '')))
|
|
|
|
|
elif isMount(dev):
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Please unmount disk {device} to "
|
|
|
|
|
"use it for install").format(device=dev))
|
|
|
|
|
if not self.is_force_param() or not try_umount(dev):
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Please unmount disk {device} to "
|
|
|
|
|
"use it for install").format(device=dev))
|
|
|
|
|
|
|
|
|
|
def defaultPerformFormat(self):
|
|
|
|
|
diskFormat = dict(zip(self.Get('os_disk_dev'),
|
|
|
|
@ -2036,6 +2041,9 @@ class VariableOsInstallUefi(LocationHelper, Variable):
|
|
|
|
|
def install_to_flash(self):
|
|
|
|
|
return self.Get('os_install_root_type') == 'flash'
|
|
|
|
|
|
|
|
|
|
def is_force_param(self):
|
|
|
|
|
return "--force" in self.Get("cl_console_args")
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
# если используется авторазметка список разделов находится в ней
|
|
|
|
|
if self.GetBool('cl_autopartition_set'):
|
|
|
|
@ -2117,9 +2125,11 @@ class VariableOsInstallUefi(LocationHelper, Variable):
|
|
|
|
|
os_disk_format__ne="vfat")
|
|
|
|
|
for efipart in value:
|
|
|
|
|
if efipart in not_fat_efi and isMount(efipart):
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Please unmount {device}, as it will be used for "
|
|
|
|
|
"installation").format(device=efipart))
|
|
|
|
|
|
|
|
|
|
if not self.is_force_param() or not try_umount(efipart):
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Please unmount {device}, as it will be used for "
|
|
|
|
|
"installation").format(device=efipart))
|
|
|
|
|
|
|
|
|
|
for efipart in value:
|
|
|
|
|
if efipart in self.select('os_location_source',
|
|
|
|
|