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

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