From 0b8640929cfe6f9b4c6b9a51e2bf9a195f4d5eed Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Tue, 6 Sep 2022 17:10:20 +0100 Subject: [PATCH] android-boot: Only add the device if updatable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we get devices like: ├─EFI\x20system\x20partition: │ Device ID: 003a0352e13dc2defe8548eb541d56067e5e5d71 │ Summary: Android Bootloader │ Current version: 0.0.0 │ GUIDs: a4001789-0ca9-5f4c-8c53-e65f8ec8a825 │ 9d825eae-ef58-501c-944f-6a0a8d9cfb49 │ Device Flags: • Internal device │ • System requires external power source │ • Needs a reboot after installation │ • Cryptographic hash verification is available --- plugins/android-boot/fu-android-boot-device.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/android-boot/fu-android-boot-device.c b/plugins/android-boot/fu-android-boot-device.c index 4bb7050f3..bc55468be 100644 --- a/plugins/android-boot/fu-android-boot-device.c +++ b/plugins/android-boot/fu-android-boot-device.c @@ -122,6 +122,15 @@ fu_android_boot_device_probe(FuDevice *device, GError **error) fu_device_build_instance_id(device, NULL, "DRIVE", "UUID", "LABEL", NULL); fu_device_build_instance_id(device, NULL, "DRIVE", "UUID", "LABEL", "SLOT", NULL); + /* quirks will have matched now */ + if (!fu_device_has_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE)) { + g_set_error_literal(error, + FWUPD_ERROR, + FWUPD_ERROR_NOT_SUPPORTED, + "device is not updatable"); + return FALSE; + } + return TRUE; }