diff --git a/data/90-fwupd-devices.rules b/data/90-fwupd-devices.rules index 9f0cd7624..2bc9efc49 100644 --- a/data/90-fwupd-devices.rules +++ b/data/90-fwupd-devices.rules @@ -4,8 +4,5 @@ # SPDX-License-Identifier: LGPL-2.1+ # -# PCI cards with ROM -SUBSYSTEM=="pci", TEST=="/sys$devpath/rom", ENV{FWUPD_GUID}="$attr{vendor}:$attr{device}" - # NVMe hardware SUBSYSTEM=="nvme", ENV{ID_VENDOR_FROM_DATABASE}=="", IMPORT{builtin}="hwdb --subsystem=pci" diff --git a/plugins/optionrom/fu-optionrom-device.c b/plugins/optionrom/fu-optionrom-device.c index 248d7a546..2723994c8 100644 --- a/plugins/optionrom/fu-optionrom-device.c +++ b/plugins/optionrom/fu-optionrom-device.c @@ -18,15 +18,15 @@ G_DEFINE_TYPE (FuOptionromDevice, fu_optionrom_device, FU_TYPE_UDEV_DEVICE) static gboolean fu_optionrom_device_probe (FuUdevDevice *device, GError **error) { - GUdevDevice *udev_device = fu_udev_device_get_dev (device); - const gchar *guid = NULL; + g_autofree gchar *fn = NULL; - guid = g_udev_device_get_property (udev_device, "FWUPD_GUID"); - if (guid == NULL) { + /* does the device even have ROM? */ + fn = g_build_filename (fu_udev_device_get_sysfs_path (device), "rom", NULL); + if (!g_file_test (fn, G_FILE_TEST_EXISTS)) { g_set_error_literal (error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED, - "no FWUPD_GUID property"); + "Unable to read firmware from device"); return FALSE; }