From: Otavio Salvador Date: Tue, 13 Apr 2021 00:29:13 +0000 (-0300) Subject: libubootenv.inc: Allow build after bootloader rework X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=a1952664603583e82025a00f5f0335d899c5b1c9;p=meta-freescale.git libubootenv.inc: Allow build after bootloader rework The libubootenv requires the UBOOT_MACHINE or UBOOT_CONFIG to allow libubootenv to build. This is caused by the commit below: ,----[ libubootenv change ] | commit 10aa1291979fb90bed1beb49be4d406ed0e1e4d5 ┃ | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━ | Author: Ming Liu | Date: Tue Aug 25 20:08:01 2020 +0200 | | libubootenv: inherit uboot-config | | This mainly aims to involve in the sanity check of UBOOT_CONFIG and | UBOOT_MACHINE, it will throw a error message at recipe parsing time if | neither of them is set, and libubootenv would be skipped. | | Signed-off-by: Ming Liu | Signed-off-by: Richard Purdie `---- This an error on libubootenv recipe, in my point of view, either way we can override it based on the selected bootloader thus fixing the build failure. Fixes: 776932e1 ("Rework the u-boot-fslc and u-boot-imx settings logic") Signed-off-by: Otavio Salvador --- diff --git a/recipes-bsp/u-boot/libubootenv_%.bbappend b/recipes-bsp/u-boot/libubootenv_%.bbappend new file mode 100644 index 00000000..2633c344 --- /dev/null +++ b/recipes-bsp/u-boot/libubootenv_%.bbappend @@ -0,0 +1,43 @@ +# Fixup for the libubootenv which rely on uboot-config class for no good reason. +# +# This is not intended to be permanent but we need to get the integration +# working and there is no good solution for now so we are adding this in a +# non-intrusive way and using the `IMX_DEFAULT_BOOTLOADER` as a guard to do any +# code execution. + +def fixup_uboot_config_dependency(d): + ubootmachine = d.getVar("UBOOT_MACHINE") + ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split() + imx_default_bootloader = d.get('IMX_DEFAULT_BOOTLOADER') + + if not ubootmachine and not ubootconfig and imx_default_bootloader: + # FIXME: We need to provide the UBOOT_MACHINE or UBOOT_CONFIG to allow libubootenv to + # build. This is caused by the commit below: + # + # ,----[ libubootenv change ] + # | commit 10aa1291979fb90bed1beb49be4d406ed0e1e4d5 ┃ + # | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━ + # | Author: Ming Liu + # | Date: Tue Aug 25 20:08:01 2020 +0200 + # | + # | libubootenv: inherit uboot-config + # | + # | This mainly aims to involve in the sanity check of UBOOT_CONFIG and + # | UBOOT_MACHINE, it will throw a error message at recipe parsing time if + # | neither of them is set, and libubootenv would be skipped. + # | + # | Signed-off-by: Ming Liu + # | Signed-off-by: Richard Purdie + # `---- + ubootmachine = d.getVar("UBOOT_MACHINE_pn-%s" % imx_default_bootloader) + ubootconfig = (d.getVar("UBOOT_CONFIG_pn-%s" % imx_default_bootloader) or "").split() + + d.setVar("UBOOT_CONFIG", ubootconfig) + d.setVar("UBOOT_MACHINE", ubootmachine) + +python fixup_uboot_config_dependency_handler() { + fixup_uboot_config_dependency(d) +} + +fixup_uboot_config_dependency_handler[eventmask] = "bb.event.RecipePreFinalise" +addhandler fixup_uboot_config_dependency_handler