summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/u-boot
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2021-04-12 21:29:13 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2021-04-13 17:29:25 -0300
commita1952664603583e82025a00f5f0335d899c5b1c9 (patch)
tree7ddef18b1a88e232c89b904ca5433f452250fc33 /recipes-bsp/u-boot
parent7e8bafd29eb36a30f39c783a096768f0ba8cca08 (diff)
downloadmeta-freescale-a1952664603583e82025a00f5f0335d899c5b1c9.tar.gz
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 <liu.ming50@gmail.com> | 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 <liu.ming50@gmail.com> | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> `---- 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 <otavio@ossystems.com.br>
Diffstat (limited to 'recipes-bsp/u-boot')
-rw-r--r--recipes-bsp/u-boot/libubootenv_%.bbappend43
1 files changed, 43 insertions, 0 deletions
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 @@
1# Fixup for the libubootenv which rely on uboot-config class for no good reason.
2#
3# This is not intended to be permanent but we need to get the integration
4# working and there is no good solution for now so we are adding this in a
5# non-intrusive way and using the `IMX_DEFAULT_BOOTLOADER` as a guard to do any
6# code execution.
7
8def fixup_uboot_config_dependency(d):
9 ubootmachine = d.getVar("UBOOT_MACHINE")
10 ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split()
11 imx_default_bootloader = d.get('IMX_DEFAULT_BOOTLOADER')
12
13 if not ubootmachine and not ubootconfig and imx_default_bootloader:
14 # FIXME: We need to provide the UBOOT_MACHINE or UBOOT_CONFIG to allow libubootenv to
15 # build. This is caused by the commit below:
16 #
17 # ,----[ libubootenv change ]
18 # | commit 10aa1291979fb90bed1beb49be4d406ed0e1e4d5 ┃
19 # | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━
20 # | Author: Ming Liu <liu.ming50@gmail.com>
21 # | Date: Tue Aug 25 20:08:01 2020 +0200
22 # |
23 # | libubootenv: inherit uboot-config
24 # |
25 # | This mainly aims to involve in the sanity check of UBOOT_CONFIG and
26 # | UBOOT_MACHINE, it will throw a error message at recipe parsing time if
27 # | neither of them is set, and libubootenv would be skipped.
28 # |
29 # | Signed-off-by: Ming Liu <liu.ming50@gmail.com>
30 # | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
31 # `----
32 ubootmachine = d.getVar("UBOOT_MACHINE_pn-%s" % imx_default_bootloader)
33 ubootconfig = (d.getVar("UBOOT_CONFIG_pn-%s" % imx_default_bootloader) or "").split()
34
35 d.setVar("UBOOT_CONFIG", ubootconfig)
36 d.setVar("UBOOT_MACHINE", ubootmachine)
37
38python fixup_uboot_config_dependency_handler() {
39 fixup_uboot_config_dependency(d)
40}
41
42fixup_uboot_config_dependency_handler[eventmask] = "bb.event.RecipePreFinalise"
43addhandler fixup_uboot_config_dependency_handler