data: Use auto-generated but hardcoded autosuspend hwdb file

This solves various problems:
 1. It stays the same also if some drivers have been disabled
 2. It uses a stable path for being imported by systemd
 3. It is still checked for its validity by tests
 4. It can be auto-generated using a simple command
This commit is contained in:
Marco Trevisan (Treviño)
2021-01-20 20:02:05 +01:00
parent 99c269b3fe
commit 533180a2e6
8 changed files with 332 additions and 12 deletions

View File

@@ -168,8 +168,13 @@ int
main (int argc, char **argv)
{
g_autoptr(GArray) drivers = fpi_get_driver_types ();
g_autofree char *program_name = NULL;
guint i;
program_name = g_path_get_basename (argv[0]);
g_print ("# This file has been generated using %s with all drivers enabled\n",
program_name);
printed = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
for (i = 0; i < drivers->len; i++)

View File

@@ -301,16 +301,24 @@ udev_hwdb = executable('fprint-list-udev-hwdb',
link_with: libfprint_drivers,
install: false)
# We always build this file; primarily so that systemd can pull it
# from the artefacts!
custom_target('udev-rules',
output: '60-autosuspend-@0@.hwdb'.format(meson.project_name()),
udev_hwdb_generator = custom_target('udev-hwdb',
output: 'autosuspend.hwdb',
depend_files: drivers_sources,
capture: true,
command: [ udev_hwdb ],
install: get_option('udev_rules'),
install_dir: udev_hwdb_dir,
build_by_default: true
)
install: false,
)
custom_target('sync-udev-hwdb',
depends: udev_hwdb_generator,
output: 'sync-udev-hwdb',
install: false,
command: [
'cp', '-v',
udev_hwdb_generator.full_path(),
meson.source_root() / 'data'
]
)
supported_devices = executable('fprint-list-supported-devices',
'fprint-list-supported-devices.c',