add xorg configuration and driver autodetection

This commit is contained in:
Alexander Grothe
2017-06-20 15:09:15 +02:00
parent d513db21ca
commit 5e5f9f346a
46 changed files with 2313 additions and 199 deletions

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env python
# This Module collects the vendor- and device ids for USB- and PCI(e)-devices and currently loaded kernel modules.
@@ -65,7 +66,7 @@ import kmodpy
from ansible.module_utils.basic import *
PCIDevice = namedtuple("PCIDevice", ['idVendor', 'idProduct', 'idClass'])
PCIDevice = namedtuple("PCIDevice", 'idVendor idProduct idClass pciPath')
def get_pci_devices():
for device in glob.glob('/sys/devices/pci*/*:*:*/'):
@@ -75,7 +76,7 @@ def get_pci_devices():
vendor_id = int(d.read().strip(), 16)
with open(os.path.join(device, 'class')) as d:
class_id = int(d.read().strip(), 16)
yield PCIDevice(idVendor=vendor_id, idProduct=product_id, idClass=class_id)
yield PCIDevice(idVendor=vendor_id, idProduct=product_id, idClass=class_id, pciPath=device)
def format_device_list(iterator):
return ["{:04x}:{:04x}".format(d.idVendor, d.idProduct) for d in iterator]

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env python2
DOCUMENTATION = '''

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env python2
from __future__ import print_function
import ast
@@ -42,6 +43,11 @@ options:
default: ["7680x4320", "3840x2160", "1920x1080", "1280x720", "720x576"]
description:
- ranking of the preferred display resolutions
write_edids:
required: False
default: True
description:
- write edid data to /etc/X11/edid.{connector}.bin
'''
EXAMPLES = '''
- name: "collect facts for connected displays"