diff -Nru fwupd-1.7.9/debian/changelog fwupd-1.7.9/debian/changelog --- fwupd-1.7.9/debian/changelog 2022-09-20 03:18:51.000000000 +0000 +++ fwupd-1.7.9/debian/changelog 2023-05-17 05:35:19.000000000 +0000 @@ -1,3 +1,18 @@ +fwupd (1.7.9-1~22.04.3) jammy; urgency=medium + + * Hide inhibited usb4 device in dell-dock plugin (LP: #1983451) + d/p/0001-Do-not-show-unconnected-or-unreachable-devices-in-th.patch + d/p/0001-trivial-don-t-show-devices-with-inhibit-id-hidden.patch + + -- Kai-Chuan Hsieh Wed, 17 May 2023 13:35:19 +0800 + +fwupd (1.7.9-1~22.04.2) jammy; urgency=medium + + * d/p/0001_make_sure_mtdram_is_set_up.patch: Upstreamed patch that + fix the false alarm in the autopkgtest (LP: #1994143) + + -- Yuan-Chen Cheng Wed, 12 Oct 2022 09:47:21 +0800 + fwupd (1.7.9-1~22.04.1) jammy; urgency=medium * New upstream release, and drop all patches since they are merged. diff -Nru fwupd-1.7.9/debian/control fwupd-1.7.9/debian/control --- fwupd-1.7.9/debian/control 2022-07-03 02:18:51.000000000 +0000 +++ fwupd-1.7.9/debian/control 2023-05-17 05:35:19.000000000 +0000 @@ -1,6 +1,7 @@ Source: fwupd Priority: optional -Maintainer: Debian EFI +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian EFI Uploaders: Steve McIntyre <93sam@debian.org>, Matthias Klumpp , Mario Limonciello diff -Nru fwupd-1.7.9/debian/control.in fwupd-1.7.9/debian/control.in --- fwupd-1.7.9/debian/control.in 2022-02-18 17:49:13.000000000 +0000 +++ fwupd-1.7.9/debian/control.in 2023-05-17 05:35:19.000000000 +0000 @@ -1,6 +1,7 @@ Source: fwupd Priority: optional -Maintainer: Debian EFI +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian EFI Uploaders: Steve McIntyre <93sam@debian.org>, Matthias Klumpp , Mario Limonciello diff -Nru fwupd-1.7.9/debian/libfwupdplugin5.symbols fwupd-1.7.9/debian/libfwupdplugin5.symbols --- fwupd-1.7.9/debian/libfwupdplugin5.symbols 2022-07-03 03:18:51.000000000 +0000 +++ fwupd-1.7.9/debian/libfwupdplugin5.symbols 2023-05-17 05:35:19.000000000 +0000 @@ -57,6 +57,7 @@ LIBFWUPDPLUGIN_1.7.3@LIBFWUPDPLUGIN_1.7.3 1.7.3 LIBFWUPDPLUGIN_1.7.4@LIBFWUPDPLUGIN_1.7.4 1.7.4 LIBFWUPDPLUGIN_1.7.6@LIBFWUPDPLUGIN_1.7.6 1.7.9 + LIBFWUPDPLUGIN_1.8.0@LIBFWUPDPLUGIN_1.8.0 1.7.9-1~22.04.3~ fu_archive_firmware_get_type@LIBFWUPDPLUGIN_1.7.3 1.7.3 fu_archive_firmware_new@LIBFWUPDPLUGIN_1.7.3 1.7.3 fu_archive_get_type@LIBFWUPDPLUGIN_1.2.2 1.2.2 @@ -355,6 +356,7 @@ fu_device_get_specialized_gtype@LIBFWUPDPLUGIN_1.3.3 1.3.3 fu_device_get_type@LIBFWUPDPLUGIN_0.1.0 0.1.0 fu_device_has_guid@LIBFWUPDPLUGIN_1.2.2 1.2.2 + fu_device_has_inhibit@LIBFWUPDPLUGIN_1.8.0 1.7.9-1~22.04.3~ fu_device_has_internal_flag@LIBFWUPDPLUGIN_1.5.5 1.5.5 fu_device_has_parent_guid@LIBFWUPDPLUGIN_1.0.8 1.0.8 fu_device_has_parent_physical_id@LIBFWUPDPLUGIN_1.6.2 1.6.2 diff -Nru fwupd-1.7.9/debian/patches/0001-Do-not-show-unconnected-or-unreachable-devices-in-th.patch fwupd-1.7.9/debian/patches/0001-Do-not-show-unconnected-or-unreachable-devices-in-th.patch --- fwupd-1.7.9/debian/patches/0001-Do-not-show-unconnected-or-unreachable-devices-in-th.patch 1970-01-01 00:00:00.000000000 +0000 +++ fwupd-1.7.9/debian/patches/0001-Do-not-show-unconnected-or-unreachable-devices-in-th.patch 2023-05-17 05:35:19.000000000 +0000 @@ -0,0 +1,104 @@ +From 6b5d933e99dce7f2bf2b771176001191a3bab644 Mon Sep 17 00:00:00 2001 +From: Richard Hughes +Date: Tue, 15 Mar 2022 11:31:00 +0000 +Subject: [PATCH] Do not show unconnected or unreachable devices in the client + tools + +Fixes https://github.com/fwupd/fwupd/issues/4378 +--- + libfwupdplugin/fu-device.c | 24 ++++++++++++++++++++++++ + libfwupdplugin/fu-device.h | 2 ++ + libfwupdplugin/fu-self-test.c | 3 +++ + libfwupdplugin/fwupdplugin.map | 6 ++++++ + src/fu-device-list.c | 2 ++ + 5 files changed, 37 insertions(+) + +--- a/libfwupdplugin/fu-device.c ++++ b/libfwupdplugin/fu-device.c +@@ -2659,6 +2659,30 @@ + } + + /** ++ * fu_device_has_inhibit: ++ * @self: a #FuDevice ++ * @inhibit_id: an ID used for inhibiting, e.g. `low-power` ++ * ++ * Check if the device already has an inhibit with a specific ID. ++ * ++ * Returns: %TRUE if added ++ * ++ * Since: 1.8.0 ++ **/ ++gboolean ++fu_device_has_inhibit(FuDevice *self, const gchar *inhibit_id) ++{ ++ FuDevicePrivate *priv = GET_PRIVATE(self); ++ ++ g_return_val_if_fail(FU_IS_DEVICE(self), FALSE); ++ g_return_val_if_fail(inhibit_id != NULL, FALSE); ++ ++ if (priv->inhibits == NULL) ++ return FALSE; ++ return g_hash_table_contains(priv->inhibits, inhibit_id); ++} ++ ++/** + * fu_device_uninhibit: + * @self: a #FuDevice + * @inhibit_id: an ID used for uninhibiting, e.g. `low-power` +--- a/libfwupdplugin/fu-device.h ++++ b/libfwupdplugin/fu-device.h +@@ -524,6 +524,8 @@ + fu_device_inhibit(FuDevice *self, const gchar *inhibit_id, const gchar *reason); + void + fu_device_uninhibit(FuDevice *self, const gchar *inhibit_id); ++gboolean ++fu_device_has_inhibit(FuDevice *self, const gchar *inhibit_id); + const gchar * + fu_device_get_physical_id(FuDevice *self); + void +--- a/libfwupdplugin/fu-self-test.c ++++ b/libfwupdplugin/fu-self-test.c +@@ -1785,9 +1785,11 @@ + + /* does not exist -> fine */ + fu_device_uninhibit(device, "NOTGOINGTOEXIST"); ++ g_assert_false(fu_device_has_inhibit(device, "NOTGOINGTOEXIST")); + + /* first one */ + fu_device_inhibit(device, "needs-activation", "Device is pending activation"); ++ g_assert_true(fu_device_has_inhibit(device, "needs-activation")); + g_assert_true(fu_device_has_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN)); + g_assert_false(fu_device_has_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE)); + +@@ -1798,6 +1800,7 @@ + + /* activated, power still too low */ + fu_device_uninhibit(device, "needs-activation"); ++ g_assert_false(fu_device_has_inhibit(device, "needs-activation")); + g_assert_true(fu_device_has_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE_HIDDEN)); + g_assert_false(fu_device_has_flag(device, FWUPD_DEVICE_FLAG_UPDATABLE)); + +--- a/libfwupdplugin/fwupdplugin.map ++++ b/libfwupdplugin/fwupdplugin.map +@@ -1003,3 +1003,9 @@ + fu_udev_device_get_parent_with_subsystem; + local: *; + } LIBFWUPDPLUGIN_1.7.4; ++ ++LIBFWUPDPLUGIN_1.8.0 { ++ global: ++ fu_device_has_inhibit; ++ local: *; ++} LIBFWUPDPLUGIN_1.7.6; +--- a/src/fu-device-list.c ++++ b/src/fu-device-list.c +@@ -216,6 +216,8 @@ + g_rw_lock_reader_lock(&self->devices_mutex); + for (guint i = 0; i < self->devices->len; i++) { + FuDeviceItem *item = g_ptr_array_index(self->devices, i); ++ if (fu_device_has_inhibit(item->device, "unconnected")) ++ continue; + g_ptr_array_add(devices, g_object_ref(item->device)); + } + g_rw_lock_reader_unlock(&self->devices_mutex); diff -Nru fwupd-1.7.9/debian/patches/0001_make_sure_mtdram_is_set_up.patch fwupd-1.7.9/debian/patches/0001_make_sure_mtdram_is_set_up.patch --- fwupd-1.7.9/debian/patches/0001_make_sure_mtdram_is_set_up.patch 1970-01-01 00:00:00.000000000 +0000 +++ fwupd-1.7.9/debian/patches/0001_make_sure_mtdram_is_set_up.patch 2023-05-17 05:35:19.000000000 +0000 @@ -0,0 +1,32 @@ +commit d6a455e8567feaea923b546624025b86e5b8dee1 +Author: Mario Limonciello +Date: Wed Sep 7 08:08:26 2022 -0500 + + trivial: try harder to make sure mtdram is set up + + the autopkgtest environment in Ubuntu seems to not be preparing the mtdram + device properly. Sometimes the udev node "exists" but the /dev/mtd0 does not + exist. + + Look for this explicitly and skip the test if it happens. + +diff --git a/plugins/mtd/fu-self-test.c b/plugins/mtd/fu-self-test.c +index 77eaa10fa..d96f7a850 100644 +--- a/plugins/mtd/fu-self-test.c ++++ b/plugins/mtd/fu-self-test.c +@@ -39,6 +39,15 @@ fu_test_mtd_device_func(void) + g_test_skip("could not find mtdram device"); + return; + } ++ dev_name = g_udev_device_get_property(udev_device, "DEVNAME"); ++ if (g_strcmp0(dev_name, "/dev/mtd0") != 0) { ++ g_test_skip("DEVNAME not /dev/mtd0"); ++ return; ++ } ++ if (!g_file_test(dev_name, G_FILE_TEST_EXISTS)) { ++ g_test_skip("/dev/mtd0 doesn't exist"); ++ return; ++ } + + /* create device */ + device = g_object_new(FU_TYPE_MTD_DEVICE, "context", ctx, "udev-device", udev_device, NULL); diff -Nru fwupd-1.7.9/debian/patches/0001-trivial-don-t-show-devices-with-inhibit-id-hidden.patch fwupd-1.7.9/debian/patches/0001-trivial-don-t-show-devices-with-inhibit-id-hidden.patch --- fwupd-1.7.9/debian/patches/0001-trivial-don-t-show-devices-with-inhibit-id-hidden.patch 1970-01-01 00:00:00.000000000 +0000 +++ fwupd-1.7.9/debian/patches/0001-trivial-don-t-show-devices-with-inhibit-id-hidden.patch 2023-05-17 05:35:19.000000000 +0000 @@ -0,0 +1,33 @@ +From 4bf53196fc1198a0688b49bcd16cd0126823f434 Mon Sep 17 00:00:00 2001 +From: hugh712 +Date: Tue, 5 Jul 2022 11:18:23 +0800 +Subject: [PATCH] trivial: don't show devices with inhibit id: hidden + dell-dock: don't show thunderbolt's usb4 device, if inhibited + +--- + plugins/dell-dock/fu-plugin-dell-dock.c | 2 +- + src/fu-device-list.c | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +--- a/plugins/dell-dock/fu-plugin-dell-dock.c ++++ b/plugins/dell-dock/fu-plugin-dell-dock.c +@@ -233,7 +233,7 @@ + g_autofree gchar *msg = NULL; + msg = g_strdup_printf("firmware update inhibited by [%s] plugin", + fu_plugin_get_name(plugin)); +- fu_device_inhibit(device, "usb4-blocked", msg); ++ fu_device_inhibit(device, "hidden", msg); + return; + } + +--- a/src/fu-device-list.c ++++ b/src/fu-device-list.c +@@ -218,6 +218,8 @@ + FuDeviceItem *item = g_ptr_array_index(self->devices, i); + if (fu_device_has_inhibit(item->device, "unconnected")) + continue; ++ if (fu_device_has_inhibit(item->device, "hidden")) ++ continue; + g_ptr_array_add(devices, g_object_ref(item->device)); + } + g_rw_lock_reader_unlock(&self->devices_mutex); diff -Nru fwupd-1.7.9/debian/patches/series fwupd-1.7.9/debian/patches/series --- fwupd-1.7.9/debian/patches/series 2022-07-03 03:18:51.000000000 +0000 +++ fwupd-1.7.9/debian/patches/series 2023-05-17 05:35:19.000000000 +0000 @@ -0,0 +1,3 @@ +0001_make_sure_mtdram_is_set_up.patch +0001-Do-not-show-unconnected-or-unreachable-devices-in-th.patch +0001-trivial-don-t-show-devices-with-inhibit-id-hidden.patch