Skip to content

Cannot build imx-boot on scarthgap branch #13

@jadinm

Description

@jadinm

compile_mx93 & do_compile define the same global (i.e., persistent through the do_compile task) variables:

  • UBOOT_CONFIG_EXTRA
  • BOOT_CONFIG_MACHINE_EXTRA

These functions unset this global variables at the end of their respective block, essentially emptying the value of the variable.

The problem is that do_compile calls the other one and still attempts to read BOOT_CONFIG_MACHINE_EXTRA afterwards

compile_${SOC_FAMILY} # transformed to a call to compile_mx93 or compile_mx8ulp
# [...]
if [ -e "${BOOT_STAGING}/flash.bin" ]; then
    cp ${BOOT_STAGING}/flash.bin ${S}/${BOOT_CONFIG_MACHINE_EXTRA}-${target}
fi

(see https://github.com/Avnet/meta-maaxboard/blob/scarthgap/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend)

This code will create a "-${target}" file that won't be found during the do_deploy task and the image won't build.

Since these function set the variables to the same values, the easiest fix is to make all that initialization into do_compile and never change or unset those global variables in any other "sub-function".

If you wish to temporarily shadow a variable, then use function-local variables (just prefix the name by local).
Though, bash is a bit special compared to other languages since a "function-local" variable are accessible to any function called.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions