|
|
|
@ -18,32 +18,30 @@ import os
|
|
|
|
|
import sys
|
|
|
|
|
import re
|
|
|
|
|
from crypt import crypt
|
|
|
|
|
import cl_overriding
|
|
|
|
|
from cl_datavars import glob_attr
|
|
|
|
|
from calculate.lib.cl_vars_share import varsShare
|
|
|
|
|
from os import path
|
|
|
|
|
from os import readlink,access,R_OK
|
|
|
|
|
from cl_utils import isMount,typeFile,getTupleVersion,pathJoin,isFstabMount,\
|
|
|
|
|
listDirectory, getAvailableVideo, getUUIDDict, \
|
|
|
|
|
getUdevDeviceInfo, getPartitionDevice, getPartitionSize, \
|
|
|
|
|
isPkgInstalled, process, checkUtils, readLinesFile, \
|
|
|
|
|
FStab, lspci, getInstalledVideo,getDeviceType, \
|
|
|
|
|
getPartitionType, getOsProberHash, getProgPath, \
|
|
|
|
|
getRaidPartitions, getLvmPartitions, getLvmGroups, \
|
|
|
|
|
getPasswdUsers
|
|
|
|
|
from cl_distr import DistributiveRepository,PartitionDistributive
|
|
|
|
|
from cl_fill import clLocale
|
|
|
|
|
from calculate.lib.utils.files import (listDirectory, pathJoin,process,
|
|
|
|
|
checkUtils, readLinesFile, FStab, getProgPath)
|
|
|
|
|
from calculate.lib.utils.common import (getTupleVersion, getAvailableVideo,
|
|
|
|
|
getInstalledVideo, getPasswdUsers)
|
|
|
|
|
from calculate.lib.utils.portage import isPkgInstalled
|
|
|
|
|
from calculate.lib.utils.device import (getUUIDDict, getUdevDeviceInfo,
|
|
|
|
|
getPartitionDevice, getPartitionSize, lspci,
|
|
|
|
|
getDeviceType, getPartitionType, getOsProberHash,
|
|
|
|
|
getRaidPartitions, getLvmPartitions)
|
|
|
|
|
from calculate.lib.utils import ip
|
|
|
|
|
from calculate.lib.cl_fill import clLocale
|
|
|
|
|
from calculate.lib.cl_template import _terms
|
|
|
|
|
from calculate.install.cl_distr import (DistributiveRepository,
|
|
|
|
|
PartitionDistributive)
|
|
|
|
|
from calculate.install.cl_install import convertDictOpt
|
|
|
|
|
from operator import itemgetter
|
|
|
|
|
from cl_template import _terms
|
|
|
|
|
from subprocess import PIPE, Popen
|
|
|
|
|
from cl_install import convertDictOpt
|
|
|
|
|
from utils import ip
|
|
|
|
|
|
|
|
|
|
from cl_lang import lang
|
|
|
|
|
tr = lang()
|
|
|
|
|
tr.setLocalDomain('cl_install')
|
|
|
|
|
tr.setLanguage(sys.modules[__name__])
|
|
|
|
|
from calculate.lib.cl_lang import setLocalTranslate
|
|
|
|
|
setLocalTranslate('cl_install',sys.modules[__name__])
|
|
|
|
|
|
|
|
|
|
class fillVars(object, glob_attr):
|
|
|
|
|
class fillVars(object, varsShare):
|
|
|
|
|
nonTransferedDirs = ["/","/bin", "/dev", "/etc",
|
|
|
|
|
"/lib", "/lib32", "/lib64",
|
|
|
|
|
"/opt", "/proc", "/sbin",
|
|
|
|
@ -645,68 +643,12 @@ class fillVars(object, glob_attr):
|
|
|
|
|
%(x[0],x[1]), bindData))
|
|
|
|
|
return "\n".join(filter(lambda x: x, [rootLine,otherLines,bindLines]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#def get_os_net_config_info(self):
|
|
|
|
|
#"""Content of /etc/conf.d/net file"""
|
|
|
|
|
|
|
|
|
|
#def getNetGateways():
|
|
|
|
|
#"""Get the network gateways"""
|
|
|
|
|
#execStr = 'route -n'
|
|
|
|
|
#res = self._runos(execStr,env={"LANG":"C"})
|
|
|
|
|
#if res is False:
|
|
|
|
|
#cl_overriding.printERROR("Failed to execute '%s'"%execStr)
|
|
|
|
|
#cl_overriding.exit(1)
|
|
|
|
|
#flagData = False
|
|
|
|
|
## retData = {'eth0':'10.0.0.1' ...}
|
|
|
|
|
#retData = {}
|
|
|
|
|
#for line in res:
|
|
|
|
|
#if flagData:
|
|
|
|
|
#routeData = map(lambda y: y.strip(),
|
|
|
|
|
#filter(lambda x: x, line.split(" ")))
|
|
|
|
|
#if len(routeData) == 8:
|
|
|
|
|
#if routeData[3] == "UG" and routeData[7]!="lo":
|
|
|
|
|
#retData[routeData[7]] = routeData[1]
|
|
|
|
|
#if line.startswith('Destination'):
|
|
|
|
|
#flagData = True
|
|
|
|
|
#return retData
|
|
|
|
|
|
|
|
|
|
#strIpAllow = self.Get('os_net_ip')
|
|
|
|
|
#strNetAllow = self.Get('os_net_allow')
|
|
|
|
|
#strInterfInfo = self.Get('os_net_interfaces_info')
|
|
|
|
|
#systemName = self.Get('os_linux_shortname')
|
|
|
|
|
#ret = ""
|
|
|
|
|
#retList = []
|
|
|
|
|
#gatewaysData = getNetGateways()
|
|
|
|
|
#if strIpAllow and strNetAllow:
|
|
|
|
|
#listDevInfo = map(lambda x: x.split(" "),strInterfInfo.split(","))
|
|
|
|
|
#listDevInfo = map(lambda x: (x[0], x[1][1:-1]),listDevInfo)
|
|
|
|
|
#listDevInfo = filter(lambda x: x[1]!="Off" ,listDevInfo)
|
|
|
|
|
#listIpNet = map(lambda x: (x[0],"%s/%s"%(x[1],x[2])),
|
|
|
|
|
#zip(listDevInfo,strIpAllow.split(","),
|
|
|
|
|
#map(lambda x: x.partition("/")[2],
|
|
|
|
|
#strNetAllow.split(","))))
|
|
|
|
|
#flagNotPlug = not systemName in ("CLS")
|
|
|
|
|
#for info, ipNet in listIpNet:
|
|
|
|
|
#dev, data = info
|
|
|
|
|
#if data=="DHCP":
|
|
|
|
|
#retList.append('config_%s=( "dhcp" )'%dev)
|
|
|
|
|
#if flagNotPlug:
|
|
|
|
|
#retList.append('modules_%s=( "!plug" )'%dev)
|
|
|
|
|
#else:
|
|
|
|
|
#retList.append('config_%s=( %s )'%(dev,ipNet))
|
|
|
|
|
#if gatewaysData and dev in gatewaysData:
|
|
|
|
|
#retList.append('routes_%s=( "default gw %s" )'\
|
|
|
|
|
#%(dev,gatewaysData[dev]))
|
|
|
|
|
#if flagNotPlug:
|
|
|
|
|
#retList.append('modules_%s=( "!plug" )'%dev)
|
|
|
|
|
#return "\n".join(retList)
|
|
|
|
|
|
|
|
|
|
def _comment(self,s,mp,dev):
|
|
|
|
|
if s.startswith("UUID"):
|
|
|
|
|
return "# %s was on %s during installation\n%s" % (mp,dev,s)
|
|
|
|
|
else:
|
|
|
|
|
return s
|
|
|
|
|
"""Generate comment for /etc/fstab each line"""
|
|
|
|
|
if s.startswith("UUID"):
|
|
|
|
|
return "# %s was on %s during installation\n%s" % (mp,dev,s)
|
|
|
|
|
else:
|
|
|
|
|
return s
|
|
|
|
|
|
|
|
|
|
def get_os_install_fstab_swap_conf(self):
|
|
|
|
|
"""Information about swap for fstab"""
|