|
|
|
@ -105,8 +105,8 @@ class cl_install(color_print):
|
|
|
|
|
|
|
|
|
|
def printInfo(self,sourceDistr,targetDistr):
|
|
|
|
|
self.printSUCCESS(_("Installation %s %s")%
|
|
|
|
|
(self.clVars.Get('os_linux_name'),
|
|
|
|
|
self.clVars.Get('os_linux_subname')))
|
|
|
|
|
(self.clVars.Get('os_install_linux_name'),
|
|
|
|
|
self.clVars.Get('os_install_linux_subname')))
|
|
|
|
|
self.defaultPrint(_("System information\n"))
|
|
|
|
|
self.printSUCCESS(_("Computer name")+": %s"%
|
|
|
|
|
self.clVars.Get('os_net_hostname'))
|
|
|
|
@ -115,11 +115,12 @@ class cl_install(color_print):
|
|
|
|
|
self.printSUCCESS(_("Network devices")+": %s"%
|
|
|
|
|
self.clVars.Get("os_net_interfaces_info"))
|
|
|
|
|
self.printSUCCESS(_("Installed system")+": %s %s"%
|
|
|
|
|
(self.old_os_linux_name, self.old_os_linux_ver))
|
|
|
|
|
(self.clVars.Get('os_linux_name'),
|
|
|
|
|
self.clVars.Get('os_linux_ver')))
|
|
|
|
|
self.defaultPrint(_("Hardware\n"))
|
|
|
|
|
self.printSUCCESS(_("Machine hardware name")+": %s"%
|
|
|
|
|
self.clVars.Get('os_arch_machine'))
|
|
|
|
|
self.printSUCCESS(_("Quantity processors")+": %s(var name)"%
|
|
|
|
|
self.printSUCCESS(_("Quantity processors")+": %s"%
|
|
|
|
|
self.clVars.Get('hr_cpu_num'))
|
|
|
|
|
self.printSUCCESS(_("Videocard")+": %s"%
|
|
|
|
|
'<needed>')
|
|
|
|
@ -139,11 +140,14 @@ class cl_install(color_print):
|
|
|
|
|
self.printSUCCESS(_("Installation volume")+": %s"%
|
|
|
|
|
self.clVars.Get('os_root_dev'))
|
|
|
|
|
self.printSUCCESS(_("File system")+": %s"%
|
|
|
|
|
"<needed>")
|
|
|
|
|
self.getFieldByField("format","install","/"))
|
|
|
|
|
self.printSUCCESS(_("Swap disk")+": %s"%
|
|
|
|
|
"<needed>")
|
|
|
|
|
self.getFieldByField("dev","install","swap"))
|
|
|
|
|
self.printSUCCESS(_("Mounted disks")+": %s"%
|
|
|
|
|
"<needed>")
|
|
|
|
|
", ".join(map(lambda x: x[0],
|
|
|
|
|
filter(lambda x: not x[1] in ["","/","swap"],
|
|
|
|
|
zip(self.clVars.Get('os_disk_dev'),
|
|
|
|
|
self.clVars.Get('os_disk_load'))))))
|
|
|
|
|
|
|
|
|
|
self.defaultPrint(_("Network services\n"))
|
|
|
|
|
self.printSUCCESS(_("PROXY")+": %s"%
|
|
|
|
@ -154,9 +158,9 @@ class cl_install(color_print):
|
|
|
|
|
"<needed>")
|
|
|
|
|
|
|
|
|
|
self.printSUCCESS("Found update: %s %s %s"%
|
|
|
|
|
(self.clVars.Get('os_linux_name'),
|
|
|
|
|
self.clVars.Get('os_linux_subname'),
|
|
|
|
|
self.clVars.Get('os_linux_ver')))
|
|
|
|
|
(self.clVars.Get('os_install_linux_name'),
|
|
|
|
|
self.clVars.Get('os_install_linux_subname'),
|
|
|
|
|
self.clVars.Get('os_install_linux_ver')))
|
|
|
|
|
|
|
|
|
|
def wait(self,sec=10):
|
|
|
|
|
self.printSUCCESS(_("Press %s to cancel")%"Ctrl+C"+"... %d"%sec, printBR=False)
|
|
|
|
@ -187,25 +191,58 @@ class cl_install(color_print):
|
|
|
|
|
else:
|
|
|
|
|
return dirsFiles
|
|
|
|
|
|
|
|
|
|
def setInstallDisk(self,disk):
|
|
|
|
|
if not disk in self.clVars.Get('os_disk_dev'):
|
|
|
|
|
raise InstallError(_("Wrong target drive name %s"%disk))
|
|
|
|
|
else:
|
|
|
|
|
osdiskload = \
|
|
|
|
|
filter(lambda x: (x[1] or x[2] == "extended") and x[0] == disk,
|
|
|
|
|
def setInstallDisk(self,disks):
|
|
|
|
|
"""Set installation partitions"""
|
|
|
|
|
osdiskdev = self.clVars.Get('os_disk_dev')
|
|
|
|
|
# find wrong disks
|
|
|
|
|
wrongDisks = filter(lambda x: not x[0] in osdiskdev,disks)
|
|
|
|
|
if wrongDisks:
|
|
|
|
|
raise InstallError(_("Wrong disk names %s"%", ".join(wrongDisks)))
|
|
|
|
|
# default mount point is root
|
|
|
|
|
disks = map(lambda x:[x[0],x[1] or '/',x[2]], disks)
|
|
|
|
|
# root partition needed
|
|
|
|
|
if not filter(lambda x: x[1] == '/',disks):
|
|
|
|
|
raise InstallError(_("Need specify root partition"))
|
|
|
|
|
# detect duplicate mountPoints
|
|
|
|
|
mountPoints = map(lambda x:x[1], disks)
|
|
|
|
|
if list(set(mountPoints)) != mountPoints:
|
|
|
|
|
raise InstallError(_("Duplicate mount points %s")%", ".join(
|
|
|
|
|
filter(lambda x: mountPoints.count(x) > 1,
|
|
|
|
|
list(set(mountPoints)))))
|
|
|
|
|
# detect duplicate partition
|
|
|
|
|
devices = map(lambda x:x[0], disks)
|
|
|
|
|
if list(set(devices)) != devices:
|
|
|
|
|
raise InstallError(_("Duplicate devices points %s")%", ".join(
|
|
|
|
|
filter(lambda x: devices.count(x) > 1,
|
|
|
|
|
list(set(devices)))))
|
|
|
|
|
|
|
|
|
|
# detect using extended drives
|
|
|
|
|
usedExtendedDrives = map(lambda x: x[0] and x in devices,
|
|
|
|
|
filter(lambda x: x[1] == "extended",
|
|
|
|
|
zip(self.clVars.Get('os_disk_dev'),
|
|
|
|
|
self.clVars.Get('os_disk_load'),
|
|
|
|
|
self.clVars.Get('os_disk_part')))
|
|
|
|
|
if len(osdiskload) > 0:
|
|
|
|
|
if osdiskload[0][2] == "extended":
|
|
|
|
|
raise InstallError(
|
|
|
|
|
_("Specified drive '%s' is extended"%disk))
|
|
|
|
|
else:
|
|
|
|
|
raise InstallError(
|
|
|
|
|
_("Specified drive '%s' mounted to '%s'")%
|
|
|
|
|
(disk,osdiskload[0][1]))
|
|
|
|
|
else:
|
|
|
|
|
self.clVars.Set('os_root_dev',disk,True)
|
|
|
|
|
self.clVars.Get('os_disk_part'))))
|
|
|
|
|
if usedExtendedDrives:
|
|
|
|
|
raise InstallError(_("Specified disk '%s' is extended")%", ".join(
|
|
|
|
|
usedExtendedDrives))
|
|
|
|
|
|
|
|
|
|
#for disk in disks:
|
|
|
|
|
#
|
|
|
|
|
#else:
|
|
|
|
|
# osdiskload = \
|
|
|
|
|
# filter(lambda x: (x[1] or x[2] == "extended") and x[0] == disk,
|
|
|
|
|
# zip(self.clVars.Get('os_disk_dev'),
|
|
|
|
|
# self.clVars.Get('os_disk_load'),
|
|
|
|
|
# self.clVars.Get('os_disk_part')))
|
|
|
|
|
# if len(osdiskload) > 0:
|
|
|
|
|
# if osdiskload[0][2] == "extended":
|
|
|
|
|
# raise InstallError(
|
|
|
|
|
# _("Specified drive '%s' is extended"%disk))
|
|
|
|
|
# else:
|
|
|
|
|
# raise InstallError(
|
|
|
|
|
# _("Specified drive '%s' mounted to '%s'")%
|
|
|
|
|
# (disk,osdiskload[0][1]))
|
|
|
|
|
# else:
|
|
|
|
|
# self.clVars.Set('os_root_dev',disk,True)
|
|
|
|
|
|
|
|
|
|
def getDeviceByField(self,field,value):
|
|
|
|
|
"""Get device by fields (install load format uuid grub part name)"""
|
|
|
|
@ -252,12 +289,11 @@ class cl_install(color_print):
|
|
|
|
|
try:
|
|
|
|
|
targetDistr = self.getTargetDistributive(
|
|
|
|
|
self.clVars.Get('os_root_dev'),buildermode)
|
|
|
|
|
distRep = DistributiveRepository('/usr/calculate/share/linux')
|
|
|
|
|
sourceDistr = distRep.getLastDistributive(
|
|
|
|
|
march=self.clVars.Get('os_arch_machine'),
|
|
|
|
|
shortname=self.clVars.Get('os_linux_shortname').lower())
|
|
|
|
|
if sourceDistr:
|
|
|
|
|
distRep = DistributiveRepository()
|
|
|
|
|
distName = self.clVars.Get('cl_image')
|
|
|
|
|
if distName:
|
|
|
|
|
# print info
|
|
|
|
|
sourceDistr = distRep.getDistributiveByFile(distName)
|
|
|
|
|
self.printInfo(sourceDistr,targetDistr)
|
|
|
|
|
# wait 10 sec
|
|
|
|
|
waittime = 3
|
|
|
|
@ -308,6 +344,9 @@ class cl_install(color_print):
|
|
|
|
|
self.printSUCCESS(_("System successfully installed"))
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
def setLinuxName(self,shortname):
|
|
|
|
|
self.clVars.Set('os_install_linux_shortname',shortname,True)
|
|
|
|
|
|
|
|
|
|
def setAllLocaleByLang(self,lang):
|
|
|
|
|
"""Set all locale variable by specified lang"""
|
|
|
|
|
locale = clLocale()
|
|
|
|
|