From f9d83091629a487993f65b12a78ca3161a0e524c Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 16 Mar 2025 15:42:58 +0100 Subject: [PATCH] xf86-video-nvidia: remove obsolete make_nvidia_udev.py script Signed-off-by: Matthias Reichl --- .../scripts/make_nvidia_udev.py | 64 ------------------- 1 file changed, 64 deletions(-) delete mode 100755 packages/x11/driver/xf86-video-nvidia/scripts/make_nvidia_udev.py diff --git a/packages/x11/driver/xf86-video-nvidia/scripts/make_nvidia_udev.py b/packages/x11/driver/xf86-video-nvidia/scripts/make_nvidia_udev.py deleted file mode 100755 index 4f8ed5fea0..0000000000 --- a/packages/x11/driver/xf86-video-nvidia/scripts/make_nvidia_udev.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python3 - -import os, sys - -try: - import requests -except: - print('requests module not installed.\n\nOn Ubuntu, use "sudo apt install python3-requests"') - sys.exit(1) - -try: - from lxml import html -except: - print('lxml module not installed.\n\nOn Ubuntu, use "sudo apt install python3-lxml"') - sys.exit(1) - -__cwd__ = os.path.dirname(os.path.realpath(__file__)) -__rules__ = __cwd__ + '/../udev.d/96-nvidia.rules' -__package__ = __cwd__ + '/../package.mk' - -# Get the Nvidia driver version currently being used -for line in open(__package__, 'r'): - if "PKG_VERSION" in line: - __version__ = line.split('=')[1].replace('"','').strip() - break - -url = 'http://us.download.nvidia.com/XFree86/Linux-x86_64/' + __version__ + '/README/supportedchips.html' - -headers = { - 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1', -} - -page = requests.get(url, headers=headers) -tree = html.fromstring(page.content) - -# These are the tables we want to use (gpu's supported by the current driver) -# NVIDIA GPU product = 2 - -ids = [] -for table in range(1, 2): - ids = ids + tree.xpath('//html/body/div[@class="appendix"]/div[@class="informaltable"][' + str(table) + ']/table/tbody/tr[starts-with(@id, "devid")]/td[2]//text()') - -# If three IDs are listed, the first is the PCI Device ID, the second is the PCI Subsystem Vendor ID, and the third is the PCI Subsystem Device ID. -# We only want the PCI Device ID (the first value) -unique_ids = [] -for id in ids: - unique_ids.append(id.split()[0].lower()) - -# Sort and remove duplicate ID's -unique_ids = sorted(set(unique_ids)) - -# Write the rules to the file -with open(__rules__, 'w') as f: - f.write('ACTION!="add|change", GOTO="end_video"\n') - f.write('SUBSYSTEM=="pci", ATTR{class}=="0x030000", ATTR{vendor}=="0x10de", GOTO="subsystem_pci"\n') - f.write('GOTO="end_video"\n\n') - f.write('LABEL="subsystem_pci"\n') - for id in unique_ids: - f.write('ATTR{device}=="0x' + str(id) + '", GOTO="configure_nvidia"\n') - f.write('GOTO="end_video"\n\n') - f.write('LABEL="configure_nvidia"\n') - f.write('ENV{xorg_driver}="nvidia", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xorg-configure@nvidia.service"\n') - f.write('GOTO="end_video"\n\n') - f.write('LABEL="end_video"\n')