|
|
|
@ -594,7 +594,7 @@ class LocationHelper:
|
|
|
|
|
"""
|
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
|
|
return \
|
|
|
|
|
_("Location is not available with autopartitioning")
|
|
|
|
|
_("Locations are not available with autopartitioning")
|
|
|
|
|
return ""
|
|
|
|
|
|
|
|
|
|
class VariableOsLocationData(LocationHelper,TableVariable):
|
|
|
|
@ -611,9 +611,10 @@ class VariableOsLocationData(LocationHelper,TableVariable):
|
|
|
|
|
"os_location_size"]
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
|
self.help = _("DISK bound for installation will be mounted to DIR DIR "
|
|
|
|
|
"set to 'none' will cancel the mount point transfer For creating bind "
|
|
|
|
|
"mount point you have to specify the source directory as DISK")
|
|
|
|
|
self.help = _("DISK bound for installation will be mounted to the "
|
|
|
|
|
"DIR directory. If set to 'none', the mount point will "
|
|
|
|
|
"not be moved. To create a bind mount point, you have "
|
|
|
|
|
"to specify the source directory as DISK")
|
|
|
|
|
self.label = _("Locations")
|
|
|
|
|
|
|
|
|
|
class VariableOsLocationSource(LocationHelper,DeviceHelper,Variable):
|
|
|
|
@ -705,11 +706,11 @@ class VariableOsLocationSource(LocationHelper,DeviceHelper,Variable):
|
|
|
|
|
wrongDevices = list(set(disks) - \
|
|
|
|
|
set(self.fixOsDiskDev()))
|
|
|
|
|
if wrongDevices:
|
|
|
|
|
raise VariableError(_("Incorrect device '%s'")%wrongDevices[0])
|
|
|
|
|
raise VariableError(_("Wrong device '%s'")%wrongDevices[0])
|
|
|
|
|
wrongSource = filter(lambda x:x and not x.startswith('/'),value)
|
|
|
|
|
if wrongSource:
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Incorrect bind mount point '%s'")%wrongSource[0])
|
|
|
|
|
_("Wrong bind mount point '%s'")%wrongSource[0])
|
|
|
|
|
##########################
|
|
|
|
|
# detect duplicate devices
|
|
|
|
|
##########################
|
|
|
|
@ -822,7 +823,7 @@ class VariableOsLocationDest(LocationHelper,Variable):
|
|
|
|
|
wrongMP = filter(lambda x:x and not x.startswith("/") and x != "swap",
|
|
|
|
|
value)
|
|
|
|
|
if wrongMP:
|
|
|
|
|
raise VariableError(_("Incorrect mount point '%s'")%wrongMP[0])
|
|
|
|
|
raise VariableError(_("Wrong mount point '%s'")%wrongMP[0])
|
|
|
|
|
#########################################
|
|
|
|
|
# Check using current root
|
|
|
|
|
#########################################
|
|
|
|
@ -861,7 +862,7 @@ class VariableOsLocationDest(LocationHelper,Variable):
|
|
|
|
|
incompBind = filter(lambda x:x[1]==wrongBind[0],
|
|
|
|
|
zip(srcMountPoints,destMountPoints))
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Source directory %(src)s already used "
|
|
|
|
|
_("Source directory %(src)s is already used "
|
|
|
|
|
"for binding '%(bindSrc)s' to '%(bindDst)s'")\
|
|
|
|
|
%{'src':wrongBind[0],
|
|
|
|
|
'bindSrc':incompBind[0][0],
|
|
|
|
@ -873,11 +874,11 @@ class VariableOsLocationDest(LocationHelper,Variable):
|
|
|
|
|
if osInstallRootType == "flash":
|
|
|
|
|
if filter(lambda x: x and x != '/', value):
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Installation on a Flash disk is not supported for "
|
|
|
|
|
"multipartition install"))
|
|
|
|
|
_("The Flash install is not supported for "
|
|
|
|
|
"multipartition install"))
|
|
|
|
|
if filter(lambda x: x == "swap",value):
|
|
|
|
|
raise VariableError(_("Installation on a Flash disk is not "
|
|
|
|
|
"supported for swap disks"))
|
|
|
|
|
raise VariableError(_("The Flash install is not supported "
|
|
|
|
|
"for swap disks"))
|
|
|
|
|
########################################
|
|
|
|
|
# check install on member of RAID or LVM
|
|
|
|
|
########################################
|
|
|
|
@ -958,9 +959,9 @@ class VariableOsLocationFormat(LocationHelper,Variable):
|
|
|
|
|
if not FileSystemManager.checkFSForType(fs,
|
|
|
|
|
osInstallRootType):
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Filesystem for '%(mp)s' should not be '%(opt)s'")
|
|
|
|
|
_("The filesystem for '%(mp)s' should not be '%(opt)s'")
|
|
|
|
|
%{'mp':mp, 'opt':fs}+" "+
|
|
|
|
|
_("for {typedisk} installation").format(
|
|
|
|
|
_("for the {typedisk} install").format(
|
|
|
|
|
typedisk=osInstallRootType))
|
|
|
|
|
if mp == "swap" and fs != "swap":
|
|
|
|
|
raise VariableError(
|
|
|
|
@ -1016,9 +1017,8 @@ class VariableOsLocationPerformFormat(LocationHelper,Variable):
|
|
|
|
|
# partition use in current system
|
|
|
|
|
if diskMount.get(dev,''):
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("{device}should, but cannot be formatted, because "
|
|
|
|
|
"mounted to {mountpoint} in "
|
|
|
|
|
"the current system").format(
|
|
|
|
|
_("{device}should, but cannot be formatted, as it is "
|
|
|
|
|
"mounted to {mountpoint} on the current system").format(
|
|
|
|
|
device=dev,mountpoint=diskMount.get(dev,'')))
|
|
|
|
|
if isMount(dev):
|
|
|
|
|
raise VariableError(
|
|
|
|
@ -1042,8 +1042,8 @@ class VariableOsLocationPerformFormat(LocationHelper,Variable):
|
|
|
|
|
_("Bind mount points should not be formatted"))
|
|
|
|
|
elif isMount(dev):
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Please unmount disk {device} for using in"
|
|
|
|
|
" installation").format(device=dev))
|
|
|
|
|
_("Please unmount disk {device} to "
|
|
|
|
|
"use it for install").format(device=dev))
|
|
|
|
|
|
|
|
|
|
def defaultPerformFormat(self):
|
|
|
|
|
diskFormat = dict(zip(self.Get('os_disk_dev'),
|
|
|
|
@ -1440,7 +1440,7 @@ class VariableOsInstallMbr(LocationHelper,Variable):
|
|
|
|
|
if rootType == "flash":
|
|
|
|
|
if len(value) > 1:
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("For Flash installation, you need only one disk"))
|
|
|
|
|
_("For the Flash install, you need only one disk"))
|
|
|
|
|
for mbrDisk in value:
|
|
|
|
|
if self.Get('cl_autopartition_set') == 'on':
|
|
|
|
|
tableOnBootDisk = self.Get('cl_autopartition_table')
|
|
|
|
@ -1449,12 +1449,12 @@ class VariableOsInstallMbr(LocationHelper,Variable):
|
|
|
|
|
where="os_device_dev",eq=mbrDisk,limit=1)
|
|
|
|
|
if not tableOnBootDisk:
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Disk '%s' without partition table "
|
|
|
|
|
"contains no boot record")%mbrDisk)
|
|
|
|
|
_("Disk '%s' need a partition table for the boot record")%
|
|
|
|
|
mbrDisk)
|
|
|
|
|
if rootType == "flash":
|
|
|
|
|
if tableOnBootDisk == "gpt":
|
|
|
|
|
raise VariableError(_("For Flash installation, you need "
|
|
|
|
|
"a disk with dos table"))
|
|
|
|
|
raise VariableError(_("For the Flash install, you "
|
|
|
|
|
"need a disk with a dos table"))
|
|
|
|
|
if value:
|
|
|
|
|
if self.Get('os_grub2_path'):
|
|
|
|
|
self.checkForGrub2()
|
|
|
|
|