2017-05-01 00:26:56 +00:00
|
|
|
#!/usr/bin/env python3
|
2021-10-17 07:46:19 +00:00
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
2015-05-19 23:35:02 +00:00
|
|
|
|
2023-11-14 20:46:12 +00:00
|
|
|
from csv import reader
|
2015-05-19 23:35:02 +00:00
|
|
|
|
2023-11-15 14:24:34 +00:00
|
|
|
# pylint: disable=consider-using-with
|
2015-05-19 23:35:02 +00:00
|
|
|
|
2023-11-15 14:24:34 +00:00
|
|
|
def read_table(filename):
|
|
|
|
table = list(reader(open(filename, newline='')))
|
|
|
|
table = table[1:] # Skip header
|
2023-11-14 20:46:12 +00:00
|
|
|
table.sort(key=lambda x: x[1])
|
2015-05-19 23:35:02 +00:00
|
|
|
|
2023-11-14 20:46:12 +00:00
|
|
|
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.
|
2023-11-15 14:24:34 +00:00
|
|
|
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''')
|
2015-05-19 23:35:02 +00:00
|
|
|
|
2023-11-15 14:21:26 +00:00
|
|
|
read_table('acpi_id_registry.csv')
|
|
|
|
read_table('pnp_id_registry.csv')
|