summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannik Schönartz2021-06-29 15:49:24 +0200
committerJannik Schönartz2021-06-29 15:49:24 +0200
commitc3dd37f105ac621322b63f3348309e8aa37eb5b0 (patch)
treead56e08f6059be6559a8b9fc8e57a041bacc54fe
parent[bas-hw-collect] Add sfdisk and blkid information and group it with smartctl ... (diff)
downloadsystemd-init-c3dd37f105ac621322b63f3348309e8aa37eb5b0.tar.gz
systemd-init-c3dd37f105ac621322b63f3348309e8aa37eb5b0.tar.xz
systemd-init-c3dd37f105ac621322b63f3348309e8aa37eb5b0.zip
[bas-hw-collect] Change edid from list to object with the connectionports as keys
-rwxr-xr-xmodules.d/bas-hw-collect/scripts/collect_hw_info_json.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules.d/bas-hw-collect/scripts/collect_hw_info_json.py b/modules.d/bas-hw-collect/scripts/collect_hw_info_json.py
index f9d6994e..8e2913fd 100755
--- a/modules.d/bas-hw-collect/scripts/collect_hw_info_json.py
+++ b/modules.d/bas-hw-collect/scripts/collect_hw_info_json.py
@@ -187,7 +187,7 @@ def get_net_fallback():
# Get and convert EDID data to hex
def get_edid():
- edid = []
+ edid = {}
display_paths = run_subprocess('ls /sys/class/drm/*/edid')
if display_paths:
display_paths = display_paths.split('\n')
@@ -197,7 +197,8 @@ def get_edid():
if dp == '': continue
edid_hex = open(dp, 'rb').read().hex()
if len(edid_hex) > 0:
- edid.append({ 'path': dp, 'edid': edid_hex })
+ # The path is always /sys/class/drm/[..]/edid, so cut the first 15 chars and the last 5 chars
+ edid[dp[15:-5]] = edid_hex
return edid
def get_lshw():