Fix change root password. Change view of report info. Add calculate daemon.

netsetup
Mike Hiretsky 14 years ago
parent 59ebce4466
commit d33c5d7d51

@ -0,0 +1,21 @@
#!/sbin/runscript
depend() {
need localmount root fsck modules keymaps consolefont
before keymaps consolefont dbus
use swap
}
start() {
/usr/bin/cl-install --live
/usr/sbin/env-update
source /etc/profile
/sbin/update-modules
/sbin/rc-update --update
}
stop() {
rc-update del calculate boot
}

@ -585,10 +585,8 @@ class cl_install(color_print):
return dirsFiles
def printInfo(self,sourceDistr,targetDistr):
self.printSUCCESS(_("Installation") + "%s %s"%
(self.clVars.Get('os_install_linux_name'),
self.clVars.Get('os_install_linux_subname')))
self.defaultPrint(_("System information\n"))
self.printSUCCESS(_("Installation") + " Calculate Linux")
self.defaultPrint("%s\n"%_("System information"))
self.printSUCCESS(_("Computer name")+": %s"%
self.clVars.Get('os_net_hostname'))
self.printSUCCESS(_("Domain name")+": %s"%
@ -598,7 +596,7 @@ class cl_install(color_print):
self.printSUCCESS(_("Installed system")+": %s %s"%
(self.clVars.Get('os_linux_name'),
self.clVars.Get('os_linux_ver')))
self.defaultPrint(_("Hardware\n"))
self.defaultPrint("%s\n"%_("Hardware"))
self.printSUCCESS(_("Machine hardware name")+": %s"%
self.clVars.Get('os_arch_machine'))
self.printSUCCESS(_("Quantity processors")+": %s"%
@ -607,7 +605,7 @@ class cl_install(color_print):
'<needed>')
self.printSUCCESS(_("Screen resolution")+": %s"%
'<needed>')
self.defaultPrint(_("Localization\n"))
self.defaultPrint("%s\n"%_("Localization"))
self.printSUCCESS(_("Language")+": %s"%
self.clVars.Get('os_locale_lang'))
self.printSUCCESS(_("Keymap")+": %s"%
@ -615,33 +613,22 @@ class cl_install(color_print):
self.printSUCCESS(_("Timezone")+": %s"%
self.clVars.Get('os_clock_timezone'))
self.defaultPrint(_("Location\n"))
self.printSUCCESS(_("Working volume")+": %s"%
self.getDeviceByField("mount",'/',
secondPrefix="os_install_disk") or "unknown")
self.printSUCCESS(_("Installation volume")+": %s"%
self.clVars.Get('os_root_dev'))
self.printSUCCESS(_("File system")+": %s"%
self.getFieldByField("format","mount","/",
firstPrefix="os_install_disk",
secondPrefix="os_install_disk"))
self.printSUCCESS(_("Swap disk")+": %s"%
self.getFieldByField("dev","mount","swap",
secondPrefix="os_install_disk"))
self.printSUCCESS(_("Mounted disks")+": %s"%
", ".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_mount'))))))
self.defaultPrint(_("Network services\n"))
#self.defaultPrint("%s\n"%_("Location"))
title, headerList, dataList = self.generateTableData()
tableObj = tableReport(title, headerList, dataList)
#cl_overriding.printSUCCESS("")
tableObj.printReport()
#cl_overriding.printSUCCESS("")
self.defaultPrint("%s\n"%_("Network services"))
self.printSUCCESS(_("Authentification")+": %s"%
"<needed>")
self.printSUCCESS(_("PROXY")+": %s"%
"<needed>")
self.printSUCCESS(_("NTP")+": %s"%
"<needed>")
self.printSUCCESS(_("Authentification")+": %s"%
"<needed>")
self.defaultPrint("%s\n"%_("Perform pre-install checkups"))
self.printSUCCESS("Found update: %s %s %s"%
(self.clVars.Get('os_install_linux_name'),
self.clVars.Get('os_install_linux_subname'),
@ -948,7 +935,7 @@ class cl_install(color_print):
def generateTableData(self):
"""Get data from print table"""
title = _("New partition table")
title = _("Location")
allDevicesOpt = self.listDisksOptions + self.listSwapsOptions
listIsFormat = []
for dev in self.clVars.Get('os_disk_dev'):
@ -977,12 +964,15 @@ class cl_install(color_print):
headerList = [_("Size"),_("Device"),_("Directory"),_("File system"),
_("Format"), _("Partition")]
dataList = zip(listSize,
self.clVars.Get('os_disk_dev'),
listMountPoint,
listFileSystem,
listIsFormat,
self.clVars.Get('os_disk_part'))
dataList = map(lambda x:x[:-1],
filter(lambda x:x[-1] != "",
zip(listSize,
self.clVars.Get('os_disk_dev'),
listMountPoint,
listFileSystem,
listIsFormat,
self.clVars.Get('os_disk_part'),
self.clVars.Get('os_install_disk_mount'))))
return title, headerList, dataList
def getPwdHashUser(self, userName):
@ -1034,7 +1024,6 @@ class cl_install(color_print):
if distName:
# print info
sourceDistr = distRep.getDistributiveByFile(distName)
self.printInfo(sourceDistr,targetDistr)
# wait 10 sec
#waittime = 3
#self.printSUCCESS(_("Installation will start pass %d seconds.")
@ -1049,12 +1038,8 @@ class cl_install(color_print):
bootDiskGrub=listbootDiskGrub[0]
else:
raise InstallError(_("Cann't found disk %s")%bootDisk)
self.printInfo(sourceDistr,targetDistr)
if not force:
title, headerList, dataList = self.generateTableData()
tableObj = tableReport(title, headerList, dataList)
cl_overriding.printSUCCESS("")
tableObj.printReport()
cl_overriding.printSUCCESS("")
dialogMessage = _("Continue with the installation of \
the system") + " (yes/no)"
dialogRes = dialogYesNo(dialogMessage)
@ -1127,6 +1112,7 @@ the system") + " (yes/no)"
# install distributive
self.printSUCCESS(_("Unpacking system image into target"))
targetDistr.installFrom(sourceDistr)
self.printOK("Unpacking complete")
# join templates
self.printSUCCESS(_("Update config"))

@ -276,7 +276,7 @@ class migrate(color_print):
def changePassword(self, userName, pwdHash, maxDays="99999", warnDays="7"):
if not filter(lambda x: x[0]==userName, self.dataUsers):
self.printERROR(_("Nof found user %s")%userName)
self.printERROR(_("Not found user %s")%userName)
return False
indexFoundUser = False
for i, data in enumerate(self.dataShadow):
@ -334,6 +334,7 @@ class migrate(color_print):
migrateShadow.fileShadow]
checkNewFiles = map(lambda x: pathJoin(self.prefixNewSystem,x),
checkThisFiles)
parentDir = lambda x: "".join(os.path.split(x)[:-1])
notRead = lambda x: not os.access(x, os.R_OK)
notWrite = lambda x: not os.access(x, os.W_OK)
filesNotRead = filter(notRead,checkThisFiles)
@ -392,15 +393,16 @@ class migrate(color_print):
self.addThisUsersToGroups(thisUsers)
for userName, pwdHash, maxDays, warnDays in pwdUsersList:
if userName == "root":
rootHash = map(lambda x: x[1],
filter(lambda x: x[0] == "root",
objShadow.getData()))
# find root password hash
rootHash = reduce(lambda x,y: y[1] if y[0] == "root" else x,
objShadow.getData(),
None)
# if password of current root is not "root" trasfer
# it to new system
if rootHash:
rootHash = rootHash[0]
salt = "".join(rootHash.rpartition("$")[:1])
if crypt("root",salt) != rootHash:
self.dataShadow[0]=["root",rootHash,"0","","","","",""]
continue
pwdHash = rootHash
if not self.changePassword(userName, pwdHash,
maxDays=maxDays,
warnDays=warnDays):

@ -29,7 +29,7 @@ class share_cmd(color_print, _error):
"""Печать переменных"""
if optObj.vars:
terms = optObj.vars.split(",")
self.logicObj.printVars(terms)
self.printVars(terms)
def setVars(self, optObj):
"""Установка переменных"""
@ -37,8 +37,8 @@ class share_cmd(color_print, _error):
for vals in optObj.set:
for val in vals.split(','):
k,o,v = val.partition('=')
if self.logicObj.clVars.exists(k):
if not self.logicObj.clVars.SetWriteVar(k,v):
if self.clVars.exists(k):
if not self.clVars.SetWriteVar(k,v):
return False
else:
self.printERROR(_('variable %s not found')%k)
@ -48,7 +48,7 @@ class share_cmd(color_print, _error):
def writeVars(self, optObj):
"""Запись переменных"""
if optObj.set:
if not self.logicObj.clVars.WriteVars():
if not self.clVars.WriteVars():
errMsg = self.getError()
if errMsg:
self.printERROR(errMsg.strip())

@ -29,7 +29,7 @@ var_data_files = []
data_dirs_template = ['templates']
share_calculate_dir = "/usr/share/calculate-2.2"
data_dirs_share = ['i18n']
#data_files += [('/etc/init.d', ['data/calculate-2.2'])]
data_files += [('/etc/init.d', ['data/calculate'])]
template_calculate_dir = os.path.join(share_calculate_dir, "templates")
template_replace_dirname = "install"
@ -73,7 +73,7 @@ class cl_install_data(install_data):
def run (self):
install_data.run(self)
#data_file = [("/etc/init.d/calculate-2.2",0755)]
data_file = []
data_file = [("/etc/init.d/calculate",0755)]
fileNames = map(lambda x: os.path.split(x[0])[1], data_file)
listNames = map(lambda x: filter(lambda y: y, x[0].split("/")),
data_file)

Loading…
Cancel
Save