Fix available xorg drivers. (Add drivers from /usr/portage/distfiles).

develop
Mike Hiretsky 13 years ago
parent eb2b5489b3
commit 37b09bc380

@ -418,7 +418,8 @@ class fillVars(varsShare):
xorg_conf = '/etc/X11/xorg.conf'
# Try analize Xorg.{DISPLAY}.log
display = os.environ.get('DISPLAY')
list_avialable_drivers = getAvailableX11Drivers()
list_avialable_drivers = \
getAvailableX11Drivers(prefix=self.Get('cl_chroot_path'))
if display and list_avialable_drivers:
reDriver = re.compile('|'.join(map(lambda x: "%s_drv.so"%x,
list_avialable_drivers)))

@ -925,9 +925,15 @@ def getSquashList():
return map(lambda x:{"lzma":"xz"}.get(x,x),
list(set(usesSquashFs) & wantMethod))
def getAvailableX11Drivers():
def getAvailableX11Drivers(prefix="/"):
"""Get available x11 drivers"""
xorg_modules_dir = '/usr/lib/xorg/modules/drivers'
return map(lambda x: x[:-7],
distfiles = path.join(prefix,'usr/portage/distfiles')
xorg_modules_dir = path.join(prefix,'usr/lib/xorg/modules/drivers')
return list(set(
map(lambda x:'fglrx' if x.startswith('ati-driver') else "nvidia",
filter(lambda x:x.startswith('ati-driver-installer') or
x.startswith('NVIDIA-Linux'),
listDirectory(distfiles))) + \
map(lambda x: x[:-7],
filter(lambda x:x.endswith('_drv.so'),
listDirectory(xorg_modules_dir)))
listDirectory(xorg_modules_dir)))))

Loading…
Cancel
Save