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

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