|
|
@ -595,7 +595,7 @@ class LocationHelper:
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
|
return \
|
|
|
|
return \
|
|
|
|
_("Locations are not available with autopartitioning")
|
|
|
|
_("The layout is not available with autopartitioning")
|
|
|
|
return ""
|
|
|
|
return ""
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsLocationData(LocationHelper,TableVariable):
|
|
|
|
class VariableOsLocationData(LocationHelper,TableVariable):
|
|
|
@ -618,7 +618,7 @@ class VariableOsLocationData(LocationHelper,TableVariable):
|
|
|
|
"DIR directory. If set to 'none', the mount point will "
|
|
|
|
"DIR directory. If set to 'none', the mount point will "
|
|
|
|
"not be moved. To create a bind mount point, you have "
|
|
|
|
"not be moved. To create a bind mount point, you have "
|
|
|
|
"to specify the source directory as DISK")
|
|
|
|
"to specify the source directory as DISK")
|
|
|
|
self.label = _("Locations")
|
|
|
|
self.label = _("Layout")
|
|
|
|
|
|
|
|
|
|
|
|
def set(self,value):
|
|
|
|
def set(self,value):
|
|
|
|
return sorted(value,key=lambda x:x and x[0])
|
|
|
|
return sorted(value,key=lambda x:x and x[0])
|
|
|
@ -883,11 +883,9 @@ class VariableOsLocationDest(LocationHelper,Variable):
|
|
|
|
if osInstallRootType == "flash":
|
|
|
|
if osInstallRootType == "flash":
|
|
|
|
if filter(lambda x: x and x != '/', value):
|
|
|
|
if filter(lambda x: x and x != '/', value):
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("The Flash install is not supported for "
|
|
|
|
_("Flash install does not support multipartition mode"))
|
|
|
|
"multipartition install"))
|
|
|
|
|
|
|
|
if filter(lambda x: x == "swap",value):
|
|
|
|
if filter(lambda x: x == "swap",value):
|
|
|
|
raise VariableError(_("The Flash install is not supported "
|
|
|
|
raise VariableError(_("Flash install does not support swap disks"))
|
|
|
|
"for swap disks"))
|
|
|
|
|
|
|
|
########################################
|
|
|
|
########################################
|
|
|
|
# check install on member of RAID or LVM
|
|
|
|
# check install on member of RAID or LVM
|
|
|
|
########################################
|
|
|
|
########################################
|
|
|
@ -898,8 +896,7 @@ class VariableOsLocationDest(LocationHelper,Variable):
|
|
|
|
installTypes)
|
|
|
|
installTypes)
|
|
|
|
if memberData:
|
|
|
|
if memberData:
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("Unable to use active {typepart} member {part} "
|
|
|
|
_("Unable to use {part} partition used by active {typepart} for installation").format(
|
|
|
|
"for installation").format(
|
|
|
|
|
|
|
|
typepart=checkType.upper(),
|
|
|
|
typepart=checkType.upper(),
|
|
|
|
part=memberData[0][0]))
|
|
|
|
part=memberData[0][0]))
|
|
|
|
|
|
|
|
|
|
|
@ -964,7 +961,7 @@ class VariableOsLocationFormat(LocationHelper,Variable):
|
|
|
|
for dev,mp,fs in devMpFs:
|
|
|
|
for dev,mp,fs in devMpFs:
|
|
|
|
if dev.startswith('/') and not dev.startswith('/dev/') and fs:
|
|
|
|
if dev.startswith('/') and not dev.startswith('/dev/') and fs:
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("Bind mount points does not use filesystem"))
|
|
|
|
_("The bind mount point does not use filesystem"))
|
|
|
|
# check compatible fs for mount point only root dirs
|
|
|
|
# check compatible fs for mount point only root dirs
|
|
|
|
if dev.startswith('/dev/') and mp and (mp.count('/') == 1 or
|
|
|
|
if dev.startswith('/dev/') and mp and (mp.count('/') == 1 or
|
|
|
|
mp == '/var/calculate'):
|
|
|
|
mp == '/var/calculate'):
|
|
|
@ -973,7 +970,7 @@ class VariableOsLocationFormat(LocationHelper,Variable):
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("The filesystem for '%(mp)s' should not be '%(opt)s'")
|
|
|
|
_("The filesystem for '%(mp)s' should not be '%(opt)s'")
|
|
|
|
%{'mp':mp, 'opt':fs}+" "+
|
|
|
|
%{'mp':mp, 'opt':fs}+" "+
|
|
|
|
_("for the {typedisk} install").format(
|
|
|
|
_("for {typedisk} install").format(
|
|
|
|
typedisk=osInstallRootType))
|
|
|
|
typedisk=osInstallRootType))
|
|
|
|
if mp == "swap" and fs != "swap":
|
|
|
|
if mp == "swap" and fs != "swap":
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
@ -1033,7 +1030,7 @@ class VariableOsLocationPerformFormat(LocationHelper,Variable):
|
|
|
|
# partition use in current system
|
|
|
|
# partition use in current system
|
|
|
|
if diskMount.get(dev,''):
|
|
|
|
if diskMount.get(dev,''):
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("{device} should, but cannot be formatted, as it is "
|
|
|
|
_("{device} must but cannot be formatted, as it is "
|
|
|
|
"mounted to {mountpoint} on the current system").format(
|
|
|
|
"mounted to {mountpoint} on the current system").format(
|
|
|
|
device=dev,mountpoint=diskMount.get(dev,'')))
|
|
|
|
device=dev,mountpoint=diskMount.get(dev,'')))
|
|
|
|
if isMount(dev):
|
|
|
|
if isMount(dev):
|
|
|
@ -1043,12 +1040,12 @@ class VariableOsLocationPerformFormat(LocationHelper,Variable):
|
|
|
|
# but user select non-format
|
|
|
|
# but user select non-format
|
|
|
|
if not self.isTrue(isformat):
|
|
|
|
if not self.isTrue(isformat):
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("{device} should be formatted").format(
|
|
|
|
_("{device} must be formatted").format(
|
|
|
|
device=dev))
|
|
|
|
device=dev))
|
|
|
|
if self.isTrue(isformat):
|
|
|
|
if self.isTrue(isformat):
|
|
|
|
if not mp:
|
|
|
|
if not mp:
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("No need to format the unused device {dev}").format(
|
|
|
|
_("No need to format unused device {dev}").format(
|
|
|
|
dev=dev))
|
|
|
|
dev=dev))
|
|
|
|
if fs in unavailFS:
|
|
|
|
if fs in unavailFS:
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
@ -1058,8 +1055,7 @@ class VariableOsLocationPerformFormat(LocationHelper,Variable):
|
|
|
|
_("Bind mount points should not be formatted"))
|
|
|
|
_("Bind mount points should not be formatted"))
|
|
|
|
elif diskMount.get(dev,"") and isformat:
|
|
|
|
elif diskMount.get(dev,"") and isformat:
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("{device} cannot be formatted, as it is "
|
|
|
|
_("{device} must but cannot be formatted, as it is mounted to {mountpoint} on the current system"
|
|
|
|
"mounted to {mountpoint} on the current system"
|
|
|
|
|
|
|
|
).format(
|
|
|
|
).format(
|
|
|
|
device=dev,mountpoint=diskMount.get(dev,'')))
|
|
|
|
device=dev,mountpoint=diskMount.get(dev,'')))
|
|
|
|
elif isMount(dev):
|
|
|
|
elif isMount(dev):
|
|
|
@ -1152,7 +1148,7 @@ class VariableClUuidSet(Variable):
|
|
|
|
Unavailable for flash installation
|
|
|
|
Unavailable for flash installation
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
if self.Get('os_install_root_type') == 'flash':
|
|
|
|
if self.Get('os_install_root_type') == 'flash':
|
|
|
|
return _("UUID using unavailable for Flash install")
|
|
|
|
return _("Impossible to use UUID for Flash install")
|
|
|
|
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#############################################################
|
|
|
|
# Install disk parameters
|
|
|
|
# Install disk parameters
|
|
|
@ -1488,7 +1484,7 @@ class VariableOsInstallMbr(LocationHelper,Variable):
|
|
|
|
if rootType == "flash":
|
|
|
|
if rootType == "flash":
|
|
|
|
if len(value) > 1:
|
|
|
|
if len(value) > 1:
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("For the Flash install, you need only one disk"))
|
|
|
|
_("For Flash install, you need only one disk"))
|
|
|
|
for mbrDisk in value:
|
|
|
|
for mbrDisk in value:
|
|
|
|
if self.Get('cl_autopartition_set') == 'on':
|
|
|
|
if self.Get('cl_autopartition_set') == 'on':
|
|
|
|
tableOnBootDisk = self.Get('cl_autopartition_table')
|
|
|
|
tableOnBootDisk = self.Get('cl_autopartition_table')
|
|
|
@ -1497,12 +1493,11 @@ class VariableOsInstallMbr(LocationHelper,Variable):
|
|
|
|
where="os_device_dev",eq=mbrDisk,limit=1)
|
|
|
|
where="os_device_dev",eq=mbrDisk,limit=1)
|
|
|
|
if not tableOnBootDisk:
|
|
|
|
if not tableOnBootDisk:
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("Disk '%s' need a partition table for the boot record")%
|
|
|
|
_("Disk '%s' needs a partition table for the boot record")%
|
|
|
|
mbrDisk)
|
|
|
|
mbrDisk)
|
|
|
|
if rootType == "flash":
|
|
|
|
if rootType == "flash":
|
|
|
|
if tableOnBootDisk == "gpt":
|
|
|
|
if tableOnBootDisk == "gpt":
|
|
|
|
raise VariableError(_("For the Flash install, you "
|
|
|
|
raise VariableError(_("You need a disk with a dos table for Flash install"))
|
|
|
|
"need a disk with a dos table"))
|
|
|
|
|
|
|
|
if value:
|
|
|
|
if value:
|
|
|
|
if self.Get('os_grub2_path'):
|
|
|
|
if self.Get('os_grub2_path'):
|
|
|
|
self.checkForGrub2()
|
|
|
|
self.checkForGrub2()
|
|
|
@ -1518,7 +1513,7 @@ class VariableOsInstallMbr(LocationHelper,Variable):
|
|
|
|
sort="DESC",limit=1)
|
|
|
|
sort="DESC",limit=1)
|
|
|
|
if "lvm-raid" in grubDiskType:
|
|
|
|
if "lvm-raid" in grubDiskType:
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("Grub does not support booting from a RAID assembled from LVM")
|
|
|
|
_("Grub does not support booting from a RAID assembled from a LVM")
|
|
|
|
+ ". " +
|
|
|
|
+ ". " +
|
|
|
|
_("Try to use a separate /boot partition"))
|
|
|
|
_("Try to use a separate /boot partition"))
|
|
|
|
if grubDiskType.count("raid")>1:
|
|
|
|
if grubDiskType.count("raid")>1:
|
|
|
@ -1539,8 +1534,7 @@ class VariableOsInstallMbr(LocationHelper,Variable):
|
|
|
|
sort="DESC",limit=1)
|
|
|
|
sort="DESC",limit=1)
|
|
|
|
if "lvm" in bootDiskType or "raid" in bootDiskType:
|
|
|
|
if "lvm" in bootDiskType or "raid" in bootDiskType:
|
|
|
|
raise ValueError(
|
|
|
|
raise ValueError(
|
|
|
|
_("Legacy grub requires a separate /boot partition to "
|
|
|
|
_("Legacy grub requires a separate /boot partition to support boot from a RAID or a LVM"))
|
|
|
|
"support boot from RAID or LVM"))
|
|
|
|
|
|
|
|
if bootDiskFormat in ("btrfs","nilfs2"):
|
|
|
|
if bootDiskFormat in ("btrfs","nilfs2"):
|
|
|
|
raise ValueError(
|
|
|
|
raise ValueError(
|
|
|
|
_("To support booting from %s, legacy grub needs a "
|
|
|
|
_("To support booting from %s, legacy grub needs a "
|
|
|
|