|
|
|
@ -63,7 +63,7 @@ from cl_print import color_print
|
|
|
|
|
from cl_distr import PartitionDistributive,DistributiveRepository,\
|
|
|
|
|
DistributiveError, ScratchPartitionDistributive, \
|
|
|
|
|
MultiPartitions, Spinner, FlashDistributive, SignalInterrupt,\
|
|
|
|
|
Distributive
|
|
|
|
|
Distributive, PxeDistributive
|
|
|
|
|
from cl_string import tableReport
|
|
|
|
|
from time import sleep
|
|
|
|
|
from subprocess import PIPE,STDOUT
|
|
|
|
@ -895,6 +895,8 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
|
mbrdisk = _("will not be changed")
|
|
|
|
|
|
|
|
|
|
flash = clGet('os_install_root_type')=="flash"
|
|
|
|
|
pxe = clGet('os_install_pxe')=='on'
|
|
|
|
|
pxeflash = flash or pxe
|
|
|
|
|
usbhdd = clGet('os_install_root_type')=="usb-hdd"
|
|
|
|
|
hdd = clGet('os_install_root_type')=="hdd"
|
|
|
|
|
if not flash:
|
|
|
|
@ -912,12 +914,12 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
|
self.printSUCCESS(_("Installation") + " Calculate Linux")
|
|
|
|
|
printData = [
|
|
|
|
|
[(_("System"),True),
|
|
|
|
|
(_("Computer name"),clGet('os_install_net_hostname'),not flash),
|
|
|
|
|
(_("Domain name"),clGet('os_install_net_domain'),not flash),
|
|
|
|
|
(_("Users"), musers,not flash),
|
|
|
|
|
(_("Computer name"),clGet('os_install_net_hostname'),not pxeflash),
|
|
|
|
|
(_("Domain name"),clGet('os_install_net_domain'),not pxeflash),
|
|
|
|
|
(_("Users"), musers,not pxeflash),
|
|
|
|
|
(_("Installed system"),installedSystem,True)
|
|
|
|
|
],
|
|
|
|
|
[(_("Localization"),not flash),
|
|
|
|
|
[(_("Localization"),not pxeflash),
|
|
|
|
|
(_("Language"),
|
|
|
|
|
clGet('os_install_locale_lang'),True),
|
|
|
|
|
(_("Keymap"),clGet('os_install_locale_xkbname'),True),
|
|
|
|
@ -939,13 +941,13 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
|
clGet('os_install_x11_video_drv'),hdd),
|
|
|
|
|
(_("Screen resolution"),clGet('os_install_x11_resolution'),hdd)
|
|
|
|
|
],
|
|
|
|
|
[(_("Network devices"),not flash),
|
|
|
|
|
[(_("Network devices"),not pxeflash),
|
|
|
|
|
(self.printNetworkTables,None,True)
|
|
|
|
|
],
|
|
|
|
|
[(_("Routes"),not flash),
|
|
|
|
|
[(_("Routes"),not pxeflash),
|
|
|
|
|
(self.printRouteTables,None,True)
|
|
|
|
|
],
|
|
|
|
|
[(_("Location"),True),
|
|
|
|
|
[(_("Location"),not pxe),
|
|
|
|
|
(_("Master boot record")+" (MBR)",mbrdisk,True),
|
|
|
|
|
(self.printLocationTables,None,True)
|
|
|
|
|
],
|
|
|
|
@ -1021,7 +1023,7 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
|
self.installLegacyGrubBootloader(targetDistr)
|
|
|
|
|
|
|
|
|
|
def getTargetDistributive(self,disk,fileSystem="reiserfs",isFormat=False,
|
|
|
|
|
systemId=None,buildermode=False):
|
|
|
|
|
systemId=None,buildermode=False,pxemode=False):
|
|
|
|
|
"""Get target distributive by params"""
|
|
|
|
|
rootLabelName = "%s-%s"%(self.clVars.Get('os_install_linux_shortname'),
|
|
|
|
|
self.clVars.Get('os_install_linux_ver'))
|
|
|
|
@ -1032,6 +1034,8 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
|
isFormat=isFormat, systemId=systemId,
|
|
|
|
|
rootLabel=rootLabelName,
|
|
|
|
|
partitionTable=mapPartPT.get(disk,None))
|
|
|
|
|
elif pxemode:
|
|
|
|
|
return PxeDistributive('/var/calculate/pxe')
|
|
|
|
|
elif self.clVars.Get('os_install_root_type')=="flash":
|
|
|
|
|
return FlashDistributive(disk,mdirectory="/mnt/install",
|
|
|
|
|
check=True, fileSystem=fileSystem,
|
|
|
|
@ -2430,7 +2434,7 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def installSystem(self, force=False, bootDisk=None, stdinReadPwd=False,
|
|
|
|
|
builder=False, flagSpinner=True, update=False):
|
|
|
|
|
builder=False, flagSpinner=True, update=False, pxe=False):
|
|
|
|
|
"""install System by current variable enviroment"""
|
|
|
|
|
sourceDistr = None
|
|
|
|
|
targetDistr = None
|
|
|
|
@ -2453,6 +2457,7 @@ class cl_install(color_print, SignalInterrupt):
|
|
|
|
|
|
|
|
|
|
targetDistr = self.getTargetDistributive(rootPartdev,
|
|
|
|
|
buildermode=builder,
|
|
|
|
|
pxemode=pxe,
|
|
|
|
|
fileSystem=rootPartFileSystem,
|
|
|
|
|
isFormat=rootPartIsFormat,
|
|
|
|
|
systemId=rootPartSystemId)
|
|
|
|
@ -2483,7 +2488,8 @@ the system") + " (yes/no)"
|
|
|
|
|
self.printERROR(_("Installation interrupted"))
|
|
|
|
|
return False
|
|
|
|
|
# set Users passwords
|
|
|
|
|
if self.clVars.Get('os_install_root_type') != "flash":
|
|
|
|
|
if self.clVars.Get('os_install_root_type') != "flash" and \
|
|
|
|
|
self.clVars.Get('os_install_pxe') != 'on':
|
|
|
|
|
changePwdUsers = \
|
|
|
|
|
self.generateHashRoot(stdinRead=stdinReadPwd)
|
|
|
|
|
addUsers = self.generateHashUsers(stdinRead=stdinReadPwd)
|
|
|
|
@ -2508,14 +2514,20 @@ the system") + " (yes/no)"
|
|
|
|
|
targetDistr.installFrom(sourceDistr)
|
|
|
|
|
self.printByResult(True)
|
|
|
|
|
|
|
|
|
|
if self.clVars.Get('os_install_root_type') != "flash":
|
|
|
|
|
if self.clVars.Get('os_install_root_type') != "flash" and \
|
|
|
|
|
self.clVars.Get('os_install_pxe') != 'on':
|
|
|
|
|
self.afterCopyHDDinstall(targetDistr, addUsers,
|
|
|
|
|
changePwdUsers, migrateUsers)
|
|
|
|
|
else:
|
|
|
|
|
# join templates
|
|
|
|
|
self.printMessageForTest(
|
|
|
|
|
_("Configure flash installation"))
|
|
|
|
|
self.applyTemplatesFlash(targetDistr.getDirectory())
|
|
|
|
|
if self.clVars.Get('os_install_pxe') == 'on':
|
|
|
|
|
self.printMessageForTest(
|
|
|
|
|
_("Configure PXE installation"))
|
|
|
|
|
self.applyTemplatesFlash('/')
|
|
|
|
|
else:
|
|
|
|
|
# join templates
|
|
|
|
|
self.printMessageForTest(
|
|
|
|
|
_("Configure flash installation"))
|
|
|
|
|
self.applyTemplatesFlash(targetDistr.getDirectory())
|
|
|
|
|
self.printByResult(True)
|
|
|
|
|
self.closeClTemplate()
|
|
|
|
|
# change boot config
|
|
|
|
|