|
|
@ -360,7 +360,7 @@ class VariableOsDiskFormat(ReadonlyVariable):
|
|
|
|
type = "list"
|
|
|
|
type = "list"
|
|
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
"""Get current disk file system"""
|
|
|
|
"""Get current disk filesystem"""
|
|
|
|
fstab = FStab('/etc/fstab')
|
|
|
|
fstab = FStab('/etc/fstab')
|
|
|
|
def getFormat(device):
|
|
|
|
def getFormat(device):
|
|
|
|
prop = getUdevDeviceInfo(name=device)
|
|
|
|
prop = getUdevDeviceInfo(name=device)
|
|
|
@ -591,7 +591,7 @@ class LocationHelper:
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
|
return \
|
|
|
|
return \
|
|
|
|
_("Location not available with autopartitioning")
|
|
|
|
_("Location is not available with autopartitioning")
|
|
|
|
return ""
|
|
|
|
return ""
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsLocationData(LocationHelper,TableVariable):
|
|
|
|
class VariableOsLocationData(LocationHelper,TableVariable):
|
|
|
@ -608,10 +608,9 @@ class VariableOsLocationData(LocationHelper,TableVariable):
|
|
|
|
"os_location_size"]
|
|
|
|
"os_location_size"]
|
|
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
def init(self):
|
|
|
|
self.help = _("DISK for installation, will be mounted to DIR. "
|
|
|
|
self.help = _("DISK bound for installation will be mounted to DIR DIR "
|
|
|
|
"DIR set to 'none' will cancel the mount point "
|
|
|
|
"set to 'none' will cancel the mount point transfer For creating bind "
|
|
|
|
"transfer. For creating bind mount point you have "
|
|
|
|
"mount point you have to specify the source directory as DISK")
|
|
|
|
"to specify the source directory as DISK")
|
|
|
|
|
|
|
|
self.label = _("Locations")
|
|
|
|
self.label = _("Locations")
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsLocationSource(LocationHelper,DeviceHelper,Variable):
|
|
|
|
class VariableOsLocationSource(LocationHelper,DeviceHelper,Variable):
|
|
|
@ -688,7 +687,8 @@ class VariableOsLocationSource(LocationHelper,DeviceHelper,Variable):
|
|
|
|
# check of device specifing
|
|
|
|
# check of device specifing
|
|
|
|
################################
|
|
|
|
################################
|
|
|
|
if not value:
|
|
|
|
if not value:
|
|
|
|
raise VariableError(_("For installation need specify root device"))
|
|
|
|
raise VariableError(
|
|
|
|
|
|
|
|
_("To install the system, you need to specify the root device"))
|
|
|
|
###########################
|
|
|
|
###########################
|
|
|
|
# check wrong dev
|
|
|
|
# check wrong dev
|
|
|
|
###########################
|
|
|
|
###########################
|
|
|
@ -771,7 +771,7 @@ class VariableOsLocationDest(LocationHelper,Variable):
|
|
|
|
izip(value,
|
|
|
|
izip(value,
|
|
|
|
self.Get("os_location_size"))):
|
|
|
|
self.Get("os_location_size"))):
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("Root partition should be not less %s")%"7 Gb")
|
|
|
|
_("The root partition should be at least %s")%"7 Gb")
|
|
|
|
source = self.Get("os_location_source")
|
|
|
|
source = self.Get("os_location_source")
|
|
|
|
################################
|
|
|
|
################################
|
|
|
|
# check of root device specifing
|
|
|
|
# check of root device specifing
|
|
|
@ -779,7 +779,8 @@ class VariableOsLocationDest(LocationHelper,Variable):
|
|
|
|
if not source:
|
|
|
|
if not source:
|
|
|
|
return
|
|
|
|
return
|
|
|
|
if not filter(lambda x:x == "/",value):
|
|
|
|
if not filter(lambda x:x == "/",value):
|
|
|
|
raise VariableError(_("For installation need specify root device"))
|
|
|
|
raise VariableError(_("To install the system, you need to "
|
|
|
|
|
|
|
|
"specify the root device"))
|
|
|
|
################################
|
|
|
|
################################
|
|
|
|
disks = filter(lambda x:x[0].startswith('/dev/') and x[1],
|
|
|
|
disks = filter(lambda x:x[0].startswith('/dev/') and x[1],
|
|
|
|
zip(source,value))
|
|
|
|
zip(source,value))
|
|
|
@ -819,8 +820,8 @@ class VariableOsLocationDest(LocationHelper,Variable):
|
|
|
|
rootDev = self.Get('os_root_dev')
|
|
|
|
rootDev = self.Get('os_root_dev')
|
|
|
|
if rootDev in self.Get('os_install_disk_dev'):
|
|
|
|
if rootDev in self.Get('os_install_disk_dev'):
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("The current root partition %s can not be "
|
|
|
|
_("You may not use the current root partition %s for "
|
|
|
|
"used for installation")%rootDev)
|
|
|
|
"installation")%rootDev)
|
|
|
|
#################################
|
|
|
|
#################################
|
|
|
|
# detect using extended partition
|
|
|
|
# detect using extended partition
|
|
|
|
#################################
|
|
|
|
#################################
|
|
|
@ -829,7 +830,7 @@ class VariableOsLocationDest(LocationHelper,Variable):
|
|
|
|
eq='extended',limit=1)
|
|
|
|
eq='extended',limit=1)
|
|
|
|
if extendedPartitions:
|
|
|
|
if extendedPartitions:
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("Unable to use the extended partition %s for installation")%
|
|
|
|
_("Unable to use extended partition %s for installation")%
|
|
|
|
extendedPartitions)
|
|
|
|
extendedPartitions)
|
|
|
|
##########################
|
|
|
|
##########################
|
|
|
|
# detect using CDROM disks
|
|
|
|
# detect using CDROM disks
|
|
|
@ -863,10 +864,10 @@ 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(
|
|
|
|
_("Installation to flash disk is not supported for "
|
|
|
|
_("Installation on a Flash disk is not supported for "
|
|
|
|
"multipartition install"))
|
|
|
|
"multipartition install"))
|
|
|
|
if filter(lambda x: x == "swap",value):
|
|
|
|
if filter(lambda x: x == "swap",value):
|
|
|
|
raise VariableError(_("Installation to flash disk is not "
|
|
|
|
raise VariableError(_("Installation on a Flash disk is not "
|
|
|
|
"supported for swap disks"))
|
|
|
|
"supported for swap disks"))
|
|
|
|
########################################
|
|
|
|
########################################
|
|
|
|
# check install on member of RAID or LVM
|
|
|
|
# check install on member of RAID or LVM
|
|
|
@ -887,7 +888,7 @@ class VariableOsLocationFormat(LocationHelper,Variable):
|
|
|
|
type = "choice-list"
|
|
|
|
type = "choice-list"
|
|
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
def init(self):
|
|
|
|
self.label = _("File system")
|
|
|
|
self.label = _("Filesystem")
|
|
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
|
if self.Get('cl_autopartition_set') == "on":
|
|
|
@ -948,13 +949,13 @@ class VariableOsLocationFormat(LocationHelper,Variable):
|
|
|
|
if not FileSystemManager.checkFSForType(fs,
|
|
|
|
if not FileSystemManager.checkFSForType(fs,
|
|
|
|
osInstallRootType):
|
|
|
|
osInstallRootType):
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("File system for '%(mp)s' should not be '%(opt)s'")
|
|
|
|
_("Filesystem for '%(mp)s' should not be '%(opt)s'")
|
|
|
|
%{'mp':mp, 'opt':fs}+" "+
|
|
|
|
%{'mp':mp, 'opt':fs}+" "+
|
|
|
|
_("for {typedisk} installation").format(
|
|
|
|
_("for {typedisk} installation").format(
|
|
|
|
typedisk=osInstallRootType))
|
|
|
|
typedisk=osInstallRootType))
|
|
|
|
if mp == "swap" and fs != "swap":
|
|
|
|
if mp == "swap" and fs != "swap":
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("Swap partition {dev} must be formatted as swap").format(
|
|
|
|
_("The swap partition {dev} must be formatted as swap").format(
|
|
|
|
dev=dev))
|
|
|
|
dev=dev))
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsLocationPerformFormat(LocationHelper,Variable):
|
|
|
|
class VariableOsLocationPerformFormat(LocationHelper,Variable):
|
|
|
@ -981,7 +982,7 @@ class VariableOsLocationPerformFormat(LocationHelper,Variable):
|
|
|
|
"""Check perform format
|
|
|
|
"""Check perform format
|
|
|
|
|
|
|
|
|
|
|
|
Check what format will perform for need partition.
|
|
|
|
Check what format will perform for need partition.
|
|
|
|
At example on change file system on partition.
|
|
|
|
At example on change filesystem on partition.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
DEV,MP,FS,FORMAT = 0,1,2,3
|
|
|
|
DEV,MP,FS,FORMAT = 0,1,2,3
|
|
|
|
info = zip(self.Get('os_location_source'),
|
|
|
|
info = zip(self.Get('os_location_source'),
|
|
|
@ -1006,27 +1007,27 @@ 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(
|
|
|
|
_("Disk {device} should be formatted, but can "
|
|
|
|
_("{device}should, but cannot be formatted, because "
|
|
|
|
"not be formatted because mounted to "
|
|
|
|
"mounted to {mountpoint} in "
|
|
|
|
"{mountpoint} in the current system").format(
|
|
|
|
"the current system").format(
|
|
|
|
device=dev,mountpoint=diskMount.get(dev,'')))
|
|
|
|
device=dev,mountpoint=diskMount.get(dev,'')))
|
|
|
|
if isMount(dev):
|
|
|
|
if isMount(dev):
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("Please unmount disk {device} for using in"
|
|
|
|
_("Please unmount {device}, as it will be used for "
|
|
|
|
" installation").format(device=dev))
|
|
|
|
"installation").format(device=dev))
|
|
|
|
# but user select non-format
|
|
|
|
# but user select non-format
|
|
|
|
if not self.isTrue(isformat):
|
|
|
|
if not self.isTrue(isformat):
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("Disk {device} should be formatted").format(
|
|
|
|
_("{device} should 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 {dev} disk").format(
|
|
|
|
_("No need to format the unused device {dev}").format(
|
|
|
|
dev=dev))
|
|
|
|
dev=dev))
|
|
|
|
if fs in unavailFS:
|
|
|
|
if fs in unavailFS:
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("File system '%s' is not available")%fs)
|
|
|
|
_("Filesystem '%s' is not available")%fs)
|
|
|
|
if not dev.startswith('/dev/'):
|
|
|
|
if not dev.startswith('/dev/'):
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("Bind mount points should not be formatted"))
|
|
|
|
_("Bind mount points should not be formatted"))
|
|
|
@ -1357,7 +1358,7 @@ class VariableOsInstallMbr(LocationHelper,Variable):
|
|
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
def init(self):
|
|
|
|
self.label = _("Boot disk")
|
|
|
|
self.label = _("Boot disk")
|
|
|
|
self.help = _("boot disks for the system bound for install")
|
|
|
|
self.help = _("boot disk for the system bound for install")
|
|
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
"""Get default Master boot record install"""
|
|
|
|
"""Get default Master boot record install"""
|
|
|
@ -1432,7 +1433,7 @@ class VariableOsInstallMbr(LocationHelper,Variable):
|
|
|
|
if rootType == "flash":
|
|
|
|
if rootType == "flash":
|
|
|
|
if len(value) > 1:
|
|
|
|
if len(value) > 1:
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("For flash installation need only one disk"))
|
|
|
|
_("For Flash installation, 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')
|
|
|
@ -1445,8 +1446,8 @@ class VariableOsInstallMbr(LocationHelper,Variable):
|
|
|
|
"contains no boot record")%mbrDisk)
|
|
|
|
"contains no boot record")%mbrDisk)
|
|
|
|
if rootType == "flash":
|
|
|
|
if rootType == "flash":
|
|
|
|
if tableOnBootDisk == "gpt":
|
|
|
|
if tableOnBootDisk == "gpt":
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(_("For Flash installation, you need "
|
|
|
|
_("For flash installation need disk with dos table"))
|
|
|
|
"a disk with dos table"))
|
|
|
|
if value:
|
|
|
|
if value:
|
|
|
|
if self.Get('os_grub2_path'):
|
|
|
|
if self.Get('os_grub2_path'):
|
|
|
|
self.checkForGrub2()
|
|
|
|
self.checkForGrub2()
|
|
|
@ -1462,14 +1463,14 @@ 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 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:
|
|
|
|
raise VariableError(
|
|
|
|
raise VariableError(
|
|
|
|
_("Grub does not support booting from a RAID assembled "
|
|
|
|
_("Grub does not support booting from a RAID assembled "
|
|
|
|
"from another RAID.")
|
|
|
|
"from another RAID")
|
|
|
|
+ " " +
|
|
|
|
+ ". " +
|
|
|
|
_("Try to use a separate /boot partition"))
|
|
|
|
_("Try to use a separate /boot partition"))
|
|
|
|
|
|
|
|
|
|
|
|
def checkForLegacyGrub(self):
|
|
|
|
def checkForLegacyGrub(self):
|
|
|
@ -1483,11 +1484,11 @@ 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 does not support boot from raid or lvm "
|
|
|
|
_("Legacy grub requires a separate /boot partition to "
|
|
|
|
"without separate /boot partition"))
|
|
|
|
"support boot from RAID or LVM"))
|
|
|
|
if bootDiskFormat in ("btrfs","nilfs2"):
|
|
|
|
if bootDiskFormat in ("btrfs","nilfs2"):
|
|
|
|
raise ValueError(
|
|
|
|
raise ValueError(
|
|
|
|
_("Legacy grub does not support booting from %s without "
|
|
|
|
_("To support booting from %s, legacy grub needs a "
|
|
|
|
"separate /boot partition")%bootDiskFormat)
|
|
|
|
"separate /boot partition")%bootDiskFormat)
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallRootType(LocationHelper,Variable):
|
|
|
|
class VariableOsInstallRootType(LocationHelper,Variable):
|
|
|
|