summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-05-03 13:48:52 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-05-12 07:59:59 +0200
commite74dfeba964519ca38ea095567282971f73a1e99 (patch)
tree47e0343d4cccb3e273708539cd37d2bcbc2eb589 /common
parentff40047b3b6300015a8cc2c6a3e0989676250dbd (diff)
downloadbarebox-e74dfeba964519ca38ea095567282971f73a1e99.tar.gz
barebox-e74dfeba964519ca38ea095567282971f73a1e99.tar.xz
fastboot: handle ill-named partitions gracefully
Users can configure a partition name of bbu-something that would conflict at fastboot init time with a barebox update "something" handler. Current behavior is to silently ignore all remaining barebox update handlers. It would be better to complain loudly and to skip only the entries actually conflicting. Do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/fastboot.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/fastboot.c b/common/fastboot.c
index a394d07e28..c8576a8d97 100644
--- a/common/fastboot.c
+++ b/common/fastboot.c
@@ -158,10 +158,12 @@ static int fastboot_add_bbu_variables(struct bbu_handler *handler, void *ctx)
name = basprintf("bbu-%s", handler->name);
ret = file_list_add_entry(fb->files, name, handler->devicefile, 0);
+ if (ret)
+ pr_warn("duplicate partition name %s\n", name);
free(name);
- return ret;
+ return 0;
}
int fastboot_generic_init(struct fastboot *fb, bool export_bbu)