From f9cdca48a57f24f2babb8f72652e099e08a59cd5 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Tue, 3 Feb 2026 22:54:30 +0100 Subject: [PATCH] docs/manual: use space-separated list for BR2_EXTERNAL Specifying a list of br2-external trees is poorly documented, and the only example uses a colon to separate the br2-external paths. Adding the support for colon-separated list is the biggest mistake that was made when introducing support for multiple br2-external [0]. Indeed, both space and colon can be used to separate entries in the list, and it is also possible to mix the two. However, internally, the list is stored as a space-separated list, and all the code will split on spaces. Besides, all other lists in Buildroot are a space-separated: BR2_ROOTFS_DEVICE_TABLE BR2_ROOTFS_STATIC_DEVICE_TABLE BR2_TARGET_TZ_ZONELIST BR2_ROOTFS_USERS_TABLES BR2_ROOTFS_OVERLAY BR2_ROOTFS_PRE_BUILD_SCRIPT BR2_ROOTFS_POST_BUILD_SCRIPT BR2_ROOTFS_POST_FAKEROOT_SCRIPT BR2_ROOTFS_POST_IMAGE_SCRIPT ... So, using colons is odd. The fact that BR2_EXTERNAL is passed on the command line rather than being a Kconfig item is not a reason enough to justify that it be colon-separated. Change the documentation to only mention using a space-separated list. Of course, for backward compatibility, we keep the code as-is to accept a colon-separated list, but we just do not advertise it. Note that keeping the split on colons means that colons are not accepted in pathnames of br2-external trees; in practice, this is not a new restriction, or one that could lift as usign colons in Makefiles are problematic anyway. [0] in 20cd49738781 core: add support for multiple br2-external trees Reported-by: Fiona Klute (WIWA) Reported-by: Brandon Maier Signed-off-by: Yann E. MORIN Cc: Arnout Vandecappelle (Essensium/Mind) Signed-off-by: Romain Naour --- docs/manual/customize-outside-br.adoc | 5 +++-- support/scripts/br2-external | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/manual/customize-outside-br.adoc b/docs/manual/customize-outside-br.adoc index 78065489d4..8a76f3a998 100644 --- a/docs/manual/customize-outside-br.adoc +++ b/docs/manual/customize-outside-br.adoc @@ -58,10 +58,11 @@ We can switch to another br2-external tree at any time: buildroot/ $ make BR2_EXTERNAL=/where/we/have/bar xconfig ---- -We can also use multiple br2-external trees: +We can also use multiple br2-external trees, by specifying a space-separated +list of paths to use: ---- -buildroot/ $ make BR2_EXTERNAL=/path/to/foo:/where/we/have/bar menuconfig +buildroot/ $ make BR2_EXTERNAL="/path/to/foo /where/we/have/bar" menuconfig ---- Or disable the usage of any br2-external tree: diff --git a/support/scripts/br2-external b/support/scripts/br2-external index 474feaded7..641f8e18ae 100755 --- a/support/scripts/br2-external +++ b/support/scripts/br2-external @@ -34,6 +34,9 @@ main() { error "Cannot create output directory '%s'\n" "${outputdir}" fi + # Historically, BR2_EXTERNAL could also be colon-separated, so for + # backward compatibility, keep splitting on colons (in addition to + # spaces). # shellcheck disable=SC2068 # We do want to split on spaces do_validate "${outputdir}" ${@//:/ } do_mk "${outputdir}"