unifying: Disable if the kernel has no CONFIG_HIDRAW support

Fixes: https://github.com/hughsie/fwupd/issues/235
This commit is contained in:
Richard Hughes 2017-09-08 10:36:26 +01:00
parent b3c13461e9
commit e4be834ac1

View File

@ -278,6 +278,17 @@ gboolean
fu_plugin_startup (FuPlugin *plugin, GError **error)
{
FuPluginData *data = fu_plugin_get_data (plugin);
/* check the kernel has CONFIG_HIDRAW */
if (!g_file_test ("/sys/class/hidraw", G_FILE_TEST_IS_DIR)) {
g_set_error_literal (error,
FWUPD_ERROR,
FWUPD_ERROR_NOT_SUPPORTED,
"no kernel support for CONFIG_HIDRAW");
return FALSE;
}
/* coldplug */
g_signal_connect (data->ctx, "added",
G_CALLBACK (fu_plugin_unifying_device_added_cb),
plugin);