From a04182b8bab888d4fb675de7a4a2c879f3f587d9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 12 Dec 2024 09:46:41 +0100 Subject: [PATCH] bundle.bbclass: fix parsing with empty IMAGE_FSTYPES If IMAGE_FSTYPES is empty, split() will return an empty array, resulting in an `IndexError: list index out of range` error during parsing. The `or ""` appears to be a previous attempt to handle this, but it is ineffective, and not actually needed: OE-core's bitbake.conf contains a default assignment for `IMAGE_FSTYPES`, so d.getVar() should always return a (possibly empty) string. We have come across this issue in combination with meta-ti, which defines a multiconfig + additional machine for the Cortex-R5 core of TI SoCs. This machine is only used to build bootloader and firmware recipes, so IMAGE_FSTYPES is empty. As all recipes are parsed for all multiconfigs unless skipped explicitly, just the existence of the core-bundle-minimal recipe is enough to bring down the whole build in this configuration. Signed-off-by: Matthias Schiffer --- classes-recipe/bundle.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes-recipe/bundle.bbclass b/classes-recipe/bundle.bbclass index 86f04d6..c009972 100644 --- a/classes-recipe/bundle.bbclass +++ b/classes-recipe/bundle.bbclass @@ -104,7 +104,8 @@ inherit nopackages PACKAGES = "" INHIBIT_DEFAULT_DEPS = "1" -RAUC_IMAGE_FSTYPE ??= "${@(d.getVar('IMAGE_FSTYPES') or "").split()[0]}" +# [""] is added to avoid "list index out of range" error with empty IMAGE_FSTYPES +RAUC_IMAGE_FSTYPE ??= "${@(d.getVar('IMAGE_FSTYPES').split() + [""])[0]}" RAUC_IMAGE_FSTYPE[doc] = "Specifies the default file name extension to expect for collecting images. Defaults to first element set in IMAGE_FSTYPES." do_fetch[cleandirs] = "${S}"