Blame SOURCES/0005-esp-list-allow-external-ESP-again.patch

003958
From d179875e1025cbf0df3987a9c3b42a996eae5354 Mon Sep 17 00:00:00 2001
003958
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
003958
 <congdanhqx@gmail.com>
003958
Date: Sat, 23 Jan 2021 11:36:26 +0700
003958
Subject: [PATCH 05/11] esp-list: allow external ESP again
003958
003958
In fwupd 1.5.1 and before, we allowed ESP on external device.
003958
From 56d816a5, (Fall back to FAT32 internal partitions for detecting
003958
ESP, 2020-11-11), we started to only consider internal devices only.
003958
003958
While it would be desirable to only consider internal devices for
003958
fallback esp partition, there're some setup that put ESP on external
003958
device, e.g. full disk encryption with /boot on a USB.
003958
003958
Let's allow external ESP again.
003958
---
003958
 src/fu-tool.c | 6 ++++--
003958
 1 file changed, 4 insertions(+), 2 deletions(-)
003958
003958
diff --git src/fu-tool.c src/fu-tool.c
003958
index 8624dfed..7c913f29 100644
003958
--- src/fu-tool.c
003958
+++ src/fu-tool.c
003958
@@ -2431,6 +2431,7 @@ fu_util_prompt_for_volume (GError **error)
003958
 {
003958
 	FuVolume *volume;
003958
 	guint idx;
003958
+	gboolean is_fallback = FALSE;
003958
 	g_autoptr(GPtrArray) volumes = NULL;
003958
 	g_autoptr(GPtrArray) volumes_vfat = g_ptr_array_new ();
003958
 	g_autoptr(GError) error_local = NULL;
003958
@@ -2438,6 +2439,7 @@ fu_util_prompt_for_volume (GError **error)
003958
 	/* exactly one */
003958
 	volumes = fu_common_get_volumes_by_kind (FU_VOLUME_KIND_ESP, &error_local);
003958
 	if (volumes == NULL) {
003958
+		is_fallback = TRUE;
003958
 		g_debug ("%s, falling back to %s", error_local->message, FU_VOLUME_KIND_BDP);
003958
 		volumes = fu_common_get_volumes_by_kind (FU_VOLUME_KIND_BDP, error);
003958
 		if (volumes == NULL) {
003958
@@ -2445,13 +2447,13 @@ fu_util_prompt_for_volume (GError **error)
003958
 			return NULL;
003958
 		}
003958
 	}
003958
-	/* only add internal vfat partitions */
003958
+	/* on fallback: only add internal vfat partitions */
003958
 	for (guint i = 0; i < volumes->len; i++) {
003958
 		FuVolume *vol = g_ptr_array_index (volumes, i);
003958
 		g_autofree gchar *type = fu_volume_get_id_type (vol);
003958
 		if (type == NULL)
003958
 			continue;
003958
-		if (!fu_volume_is_internal (vol))
003958
+		if (is_fallback && !fu_volume_is_internal (vol))
003958
 			continue;
003958
 		if (g_strcmp0 (type, "vfat") == 0)
003958
 			g_ptr_array_add (volumes_vfat, vol);
003958
-- 
003958
2.29.2
003958