|
|
@ -23,8 +23,9 @@ import cl_overriding
|
|
|
|
from cl_vars_share import varsShare, clLocale
|
|
|
|
from cl_vars_share import varsShare, clLocale
|
|
|
|
from os.path import exists as pathexists
|
|
|
|
from os.path import exists as pathexists
|
|
|
|
from os import path
|
|
|
|
from os import path
|
|
|
|
from cl_utils import isMount, genpassword, getAvailableX11Drivers, \
|
|
|
|
from cl_utils import isMount, genpassword, \
|
|
|
|
listDirectory,isPkgInstalled,lspci
|
|
|
|
getAvailableVideo, \
|
|
|
|
|
|
|
|
listDirectory,isPkgInstalled,lspci, readLinesFile
|
|
|
|
from utils import ip
|
|
|
|
from utils import ip
|
|
|
|
from encrypt import getHash
|
|
|
|
from encrypt import getHash
|
|
|
|
|
|
|
|
|
|
|
@ -388,23 +389,25 @@ class fillVars(varsShare):
|
|
|
|
xorg_conf = '/etc/X11/xorg.conf'
|
|
|
|
xorg_conf = '/etc/X11/xorg.conf'
|
|
|
|
# Try analize Xorg.{DISPLAY}.log
|
|
|
|
# Try analize Xorg.{DISPLAY}.log
|
|
|
|
display = os.environ.get('DISPLAY')
|
|
|
|
display = os.environ.get('DISPLAY')
|
|
|
|
list_avialable_drivers = \
|
|
|
|
list_available_drivers = \
|
|
|
|
getAvailableX11Drivers(prefix=self.Get('cl_chroot_path'))
|
|
|
|
getAvailableVideo(prefix=self.Get('cl_chroot_path'))
|
|
|
|
if display and list_avialable_drivers:
|
|
|
|
if display and list_available_drivers:
|
|
|
|
reDriver = re.compile('|'.join(map(lambda x: "%s_drv.so"%x,
|
|
|
|
reDriver = re.compile('|'.join(map(lambda x: "%s_drv.so"%x,
|
|
|
|
list_avialable_drivers)))
|
|
|
|
list_available_drivers)))
|
|
|
|
display_number = re.search(r':(\d+)\..*', display)
|
|
|
|
display_number = re.search(r':(\d+)\..*', display)
|
|
|
|
|
|
|
|
reDriverName = re.compile(r'([^/]+)_drv.so')
|
|
|
|
if display_number:
|
|
|
|
if display_number:
|
|
|
|
xorg_log_file = '/var/log/Xorg.%s.log' % \
|
|
|
|
xorg_log_file = '/var/log/Xorg.%s.log' % \
|
|
|
|
display_number.group(1)
|
|
|
|
display_number.group(1)
|
|
|
|
if path.exists(xorg_log_file):
|
|
|
|
if path.exists(xorg_log_file):
|
|
|
|
matchStrs = [i for i in open(xorg_log_file)
|
|
|
|
matchStrs = \
|
|
|
|
if "drv" in i and reDriver.search(i)]
|
|
|
|
map(lambda x:x.group(1),
|
|
|
|
|
|
|
|
filter(lambda x:x,
|
|
|
|
|
|
|
|
map(lambda x:reDriverName.search,
|
|
|
|
|
|
|
|
filter(lambda x:"drv" in x and reDriver.search(x),
|
|
|
|
|
|
|
|
readLinesFile(xorg_log_file)))))
|
|
|
|
if matchStrs:
|
|
|
|
if matchStrs:
|
|
|
|
resDriver = re.search(r'([^/]+)_drv.so',
|
|
|
|
return matchStrs[-1]
|
|
|
|
matchStrs[-1])
|
|
|
|
|
|
|
|
if resDriver:
|
|
|
|
|
|
|
|
return resDriver.group(1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# analize /etc/X11/xorg.conf
|
|
|
|
# analize /etc/X11/xorg.conf
|
|
|
|
if path.exists(xorg_conf):
|
|
|
|
if path.exists(xorg_conf):
|
|
|
@ -413,19 +416,15 @@ class fillVars(varsShare):
|
|
|
|
if matchSect:
|
|
|
|
if matchSect:
|
|
|
|
resDriver = re.search(r'^\S*Driver\s*"([^"]+)"',
|
|
|
|
resDriver = re.search(r'^\S*Driver\s*"([^"]+)"',
|
|
|
|
matchSect.group(0),re.S)
|
|
|
|
matchSect.group(0),re.S)
|
|
|
|
if resDriver and resDriver.group(1) in list_avialable_drivers:
|
|
|
|
if resDriver and resDriver.group(1) in list_available_drivers:
|
|
|
|
return resDriver.group(1)
|
|
|
|
return resDriver.group(1)
|
|
|
|
|
|
|
|
|
|
|
|
videoVal = self.getValueFromCmdLine("calculate","video")
|
|
|
|
videoVal = self.getValueFromCmdLine("calculate","video")
|
|
|
|
videoVal = {'i915':'intel'}.get(videoVal,videoVal)
|
|
|
|
videoVal = {'i915':'intel'}.get(videoVal,videoVal)
|
|
|
|
if not isPkgInstalled('xorg-server') or \
|
|
|
|
if not isPkgInstalled('xorg-server') or \
|
|
|
|
videoVal in list_avialable_drivers:
|
|
|
|
videoVal in list_available_drivers:
|
|
|
|
return videoVal
|
|
|
|
return videoVal
|
|
|
|
workedModules = map(lambda x:x[0],
|
|
|
|
return self.getVideoByDefault(list_available_drivers)
|
|
|
|
filter(lambda x:x[1].isdigit() and int(x[1])>0,
|
|
|
|
|
|
|
|
map(lambda x:x.split()[:3:2],
|
|
|
|
|
|
|
|
open('/proc/modules','r'))))
|
|
|
|
|
|
|
|
return self.getVideoByDefault(list_avialable_drivers)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_os_x11_height(self):
|
|
|
|
def get_os_x11_height(self):
|
|
|
|
"""Get screen height in pixeles"""
|
|
|
|
"""Get screen height in pixeles"""
|
|
|
|