mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
Generate a hwdb instead of udev rules
We only use the rules/hwdb to enable auto-suspend. So, instead of shipping our own rules, we can just use the existing autosuspend rules and ship a hwdb that sets the appropriate flag. Closes: #336
This commit is contained in:
@@ -147,17 +147,20 @@ print_driver (const FpDeviceClass *cls)
|
||||
g_hash_table_insert (printed, key, (void *) cls->id);
|
||||
|
||||
if (num_printed == 0)
|
||||
g_print ("# %s\n", cls->full_name);
|
||||
{
|
||||
if (cls != &whitelist)
|
||||
g_print ("\n# Supported by libfprint driver %s\n", cls->id);
|
||||
else
|
||||
g_print ("\n# Known unsupported devices\n");
|
||||
}
|
||||
|
||||
g_print ("SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"%04x\", ATTRS{idProduct}==\"%04x\", ATTRS{dev}==\"*\", TEST==\"power/control\", ATTR{power/control}=\"auto\"\n",
|
||||
g_print ("usb:v%04Xp%04X*\n",
|
||||
entry->vid, entry->pid);
|
||||
g_print ("SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"%04x\", ATTRS{idProduct}==\"%04x\", ENV{LIBFPRINT_DRIVER}=\"%s\"\n",
|
||||
entry->vid, entry->pid, cls->full_name);
|
||||
num_printed++;
|
||||
}
|
||||
|
||||
if (num_printed > 0)
|
||||
g_print ("\n");
|
||||
g_print (" ID_AUTOSUSPEND=1\n");
|
||||
}
|
||||
|
||||
int
|
||||
@@ -295,19 +295,19 @@ libfprint_private_dep = declare_dependency(
|
||||
]
|
||||
)
|
||||
|
||||
udev_rules = executable('fprint-list-udev-rules',
|
||||
'fprint-list-udev-rules.c',
|
||||
udev_hwdb = executable('fprint-list-udev-hwdb',
|
||||
'fprint-list-udev-hwdb.c',
|
||||
dependencies: libfprint_private_dep,
|
||||
link_with: libfprint_drivers,
|
||||
install: false)
|
||||
|
||||
if get_option('udev_rules')
|
||||
custom_target('udev-rules',
|
||||
output: '60-@0@-autosuspend.rules'.format(versioned_libname),
|
||||
output: '60-autosuspend-@0@.hwdb'.format(versioned_libname),
|
||||
capture: true,
|
||||
command: [ udev_rules ],
|
||||
command: [ udev_hwdb ],
|
||||
install: true,
|
||||
install_dir: udev_rules_dir)
|
||||
install_dir: udev_hwdb_dir)
|
||||
endif
|
||||
|
||||
supported_devices = executable('fprint-list-supported-devices',
|
||||
|
||||
Reference in New Issue
Block a user