summaryrefslogtreecommitdiff
path: root/common/fastboot.c
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-05-03 13:48:57 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-05-12 08:00:00 +0200
commitf1dd6339a8d7d62667ba8a1da863319bc5a1dc57 (patch)
treeb2a9a3a75f1ff22c05a2416fe3e8d3311409afbd /common/fastboot.c
parenteecf05d8ced03ab994cd083c7906df434ffd44b7 (diff)
downloadbarebox-f1dd6339a8d7d62667ba8a1da863319bc5a1dc57.tar.gz
fastboot/dfu: use system partitions as fall back
Use the new system partitions infrastructure to have fastboot and DFU fall back to using the same partitions if the global.usbgadget.dfu_function and global.fastboot_partitions are not set, respectively. No functional change intended for configurations that have SYSTEM_PARTITIONS disabled. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-13-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/fastboot.c')
-rw-r--r--common/fastboot.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/common/fastboot.c b/common/fastboot.c
index c8576a8d97..dc80b66e67 100644
--- a/common/fastboot.c
+++ b/common/fastboot.c
@@ -41,6 +41,7 @@
#include <linux/stat.h>
#include <linux/mtd/mtd.h>
#include <fastboot.h>
+#include <system-partitions.h>
#define FASTBOOT_VERSION "0.4"
@@ -932,9 +933,13 @@ bool get_fastboot_bbu(void)
return fastboot_bbu;
}
-const char *get_fastboot_partitions(void)
+struct file_list *get_fastboot_partitions(void)
{
- return fastboot_partitions;
+ if (fastboot_partitions && *fastboot_partitions)
+ return file_list_parse(fastboot_partitions);
+ if (!system_partitions_empty())
+ return system_partitions_get();
+ return NULL;
}
static int fastboot_globalvars_init(void)