diff options
Diffstat (limited to 'sys-apps/gpu-detector/files')
-rwxr-xr-x | sys-apps/gpu-detector/files/gpu-configuration | 88 |
1 files changed, 27 insertions, 61 deletions
diff --git a/sys-apps/gpu-detector/files/gpu-configuration b/sys-apps/gpu-detector/files/gpu-configuration index 2f816efe..8e55cb8d 100755 --- a/sys-apps/gpu-detector/files/gpu-configuration +++ b/sys-apps/gpu-detector/files/gpu-configuration @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import os +import errno import subprocess try: from subprocess import getoutput @@ -15,7 +16,7 @@ xorgfile = "/etc/X11/xorg.conf" lspci = '/usr/sbin/lspci' nvidia_settings = "/usr/share/applications/nvidia-settings.desktop" -device_id_prefix = "RogentosVga" +device_id_prefix = "KogaionVga" nvidia_option_prefix = "--nvidia-opt--" screen_layout_sections = [] device_sections = [] @@ -235,23 +236,6 @@ def setup_radeon_kms(): else: print("I was about to modprobe radeon modeset=1") -def remove_tar_members_from_sys(tarpath): - import tarfile - tar = tarfile.open(tarpath) - for el in sorted(tar.getnames(), reverse = True): - el = "/%s" % (el,) - if os.path.isfile(el): - try: - os.remove(el) - except OSError: - pass - if os.path.isdir(el): - try: - os.rmdir(el) - except OSError: - pass - tar.close() - def generate_fglrx_steps(videocard, cardnumber, total_cards, bus_id): print("AMD!") print("total supported AMD cards: %s" % (len(fglrx_supported),)) @@ -344,43 +328,19 @@ def deploy_nvidia_xxxxxx_drivers(ver): continue if pkg.startswith("x11-drivers:nvidia-drivers-" + ver): _packages.append(pkg) - elif pkg.startswith("x11-drivers:nvidia-userspace" + ver): + elif pkg.startswith("x11-drivers:nvidia-userspace-" + ver): _packages.append(pkg) packages = [os.path.join(drivers_dir, x) for x in _packages] - package_names = ["x11-drivers/nvidia-drivers", - "x11-drivers/nvidia-userspace"] if not packages: return False - from entropy.client.interfaces import Client - _entropy = Client() - - # prepare system - for package_name in package_names: - inst_repo = _entropy.installed_repository() - package_id, result = inst_repo.atomMatch(package_name) - if package_id == -1: - continue - content = inst_repo.retrieveContentIter(package_id) - for myfile, ftype in content: - try: - os.remove(myfile) - except (OSError, IOError): - pass - - if hasattr(_entropy,"destroy"): - _entropy.destroy() + rc = subprocess.call(["/usr/bin/equo", "install", "--nodeps"] + packages) + if rc: + return False - for package_file in packages: - # remove old garbage - copy over - create module - subprocess.call( - ["tar", "xjf", package_file, "-C", "/"]) - # try to check driver status now - rc = check_if_proprietary_driver_system_is_healthy("nvidia") - if not rc: - remove_tar_members_from_sys(package_file) - return rc + # try to check driver status now + return check_if_proprietary_driver_system_is_healthy("nvidia") efivars_loaded = False def is_efi(): @@ -430,7 +390,7 @@ Section "Device" # UseEvents is causing segmentation faults with # NVIDIA 6xxx, 7xxx and >=275.xx.xx drivers #Option "UseEvents" "True" - Option "LogoPath" "/usr/share/backgrounds/rogentoslinux-nvidia.png" + Option "LogoPath" "/usr/share/backgrounds/kogaionlinux-nvidia.png" EndSection """ % (device_id_prefix, cardnum, xdriver, bus_id_mark, bus_id,)) @@ -541,17 +501,19 @@ def setup_nvidia_drivers(card_id): ("96", nvidia_173xx_supported,), ("71", nvidia_173xx_supported,), ) - for ver, lst in drivers_map: - if card_id not in lst: - continue - print("NVIDIA %s driver selected" % (ver,)) - drv_string = ver - if livecd: - rc = deploy_nvidia_xxxxxx_drivers(ver) - if rc: - print("NVIDIA %s deployed correctly" % (ver,)) - done_legacy = True - break + + if not nvidia_disablelegacy: + for ver, lst in drivers_map: + if card_id not in lst: + continue + print("NVIDIA %s driver selected" % (ver,)) + drv_string = ver + if livecd: + rc = deploy_nvidia_xxxxxx_drivers(ver) + if rc: + print("NVIDIA %s deployed correctly" % (ver,)) + done_legacy = True + break if not done_legacy: drv_string = '[latest]' @@ -562,7 +524,11 @@ def setup_nvidia_drivers(card_id): print("NVIDIA proprietary driver %s is loaded" % (drv_string,)) if done_legacy: - os.makedirs("/lib/nvidia/legacy") + try: + os.makedirs("/lib/nvidia/legacy") + except OSError as err: + if err.errno != errno.EEXIST: + raise with open("/lib/nvidia/legacy/running", "w") as f: f.write("%s" % (drv_string,)) |