summaryrefslogtreecommitdiffstats
path: root/hwdb.d/acpi-update.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:52 +0000
commit55944e5e40b1be2afc4855d8d2baf4b73d1876b5 (patch)
tree33f869f55a1b149e9b7c2b7e201867ca5dd52992 /hwdb.d/acpi-update.py
parentInitial commit. (diff)
downloadsystemd-55944e5e40b1be2afc4855d8d2baf4b73d1876b5.tar.xz
systemd-55944e5e40b1be2afc4855d8d2baf4b73d1876b5.zip
Adding upstream version 255.4.upstream/255.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'hwdb.d/acpi-update.py')
-rwxr-xr-xhwdb.d/acpi-update.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/hwdb.d/acpi-update.py b/hwdb.d/acpi-update.py
new file mode 100755
index 0000000..41670b3
--- /dev/null
+++ b/hwdb.d/acpi-update.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+from csv import reader
+
+# pylint: disable=consider-using-with
+
+def read_table(filename):
+ table = list(reader(open(filename, newline='')))
+ table = table[1:] # Skip header
+ table.sort(key=lambda x: x[1])
+
+ for row in table:
+ # Some IDs end with whitespace, while they didn't in the old HTML table, so it's probably
+ # a mistake, strip it.
+ print(f'\nacpi:{row[1].strip()}*:\n ID_VENDOR_FROM_DATABASE={row[0].strip()}')
+
+print('''\
+# This file is part of systemd.
+#
+# Data imported from:
+# https://uefi.org/uefi-pnp-export
+# https://uefi.org/uefi-acpi-export''')
+
+read_table('acpi_id_registry.csv')
+read_table('pnp_id_registry.csv')