Skip to content

Commit

Permalink
bundle.bbclass: fix parsing with empty IMAGE_FSTYPES
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit a04182b8bab888d4fb675de7a4a2c879f3f587d9)
Signed-off-by: Matthias Schiffer <[email protected]>
  • Loading branch information
tq-schifferm authored and jluebbe committed Dec 12, 2024
1 parent 6f1ab76 commit 8f35e94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion classes-recipe/bundle.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -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 image artifacts. Defaults to first element set in IMAGE_FSTYPES."

do_fetch[cleandirs] = "${S}"
Expand Down

0 comments on commit 8f35e94

Please sign in to comment.