summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>2020-04-03 20:07:09 +0000
committerOtavio Salvador <otavio@ossystems.com.br>2020-04-03 17:41:08 -0300
commit6ca16f44b8a2d148e74cf9c1a2eb8790e0bb0d51 (patch)
treebf2d5a09ec91f17e250f5861ddd92cf7cde87279
parent424f553214593d09ccd7a31cc9d0dcce6170afb1 (diff)
downloadmeta-freescale-6ca16f44b8a2d148e74cf9c1a2eb8790e0bb0d51.tar.gz
u-boot-imx: resolve build issue with missing target
Since the replacement of u-boot-fw-utils with libubootenv in OE-Core, U-Boot recipe requires an additional target to be built, which contains the default environment. This target has been introduced in U-Boot with version 2019.07 and is missing in NXP fork of U-Boot source tree, therefore one patch from the U-Boot source tree is backported in order to introduce a missing build target. Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
-rw-r--r--recipes-bsp/u-boot/u-boot-imx-mfgtool_2019.04.bb2
-rw-r--r--recipes-bsp/u-boot/u-boot-imx/0001-Add-target-to-generate-initial-environment.patch49
-rw-r--r--recipes-bsp/u-boot/u-boot-imx_2019.04.bb2
3 files changed, 53 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/u-boot-imx-mfgtool_2019.04.bb b/recipes-bsp/u-boot/u-boot-imx-mfgtool_2019.04.bb
index ec1de27d..2b296c19 100644
--- a/recipes-bsp/u-boot/u-boot-imx-mfgtool_2019.04.bb
+++ b/recipes-bsp/u-boot/u-boot-imx-mfgtool_2019.04.bb
@@ -2,5 +2,7 @@
2# Copyright (C) 2014-2016 Freescale Semiconductor 2# Copyright (C) 2014-2016 Freescale Semiconductor
3# Copyright 2017-2019 NXP 3# Copyright 2017-2019 NXP
4 4
5FILESEXTRAPATHS_prepend := "${THISDIR}/u-boot-imx:"
6
5require u-boot-imx_${PV}.bb 7require u-boot-imx_${PV}.bb
6require u-boot-mfgtool.inc 8require u-boot-mfgtool.inc
diff --git a/recipes-bsp/u-boot/u-boot-imx/0001-Add-target-to-generate-initial-environment.patch b/recipes-bsp/u-boot/u-boot-imx/0001-Add-target-to-generate-initial-environment.patch
new file mode 100644
index 00000000..c717e029
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-imx/0001-Add-target-to-generate-initial-environment.patch
@@ -0,0 +1,49 @@
1From bdaa73a5b3923257add182b4ab8058dbfa33421b Mon Sep 17 00:00:00 2001
2From: Stefano Babic <sbabic@denx.de>
3Date: Wed, 13 Mar 2019 09:46:45 +0100
4Subject: [PATCH] Add target to generate initial environment
5
6The initial environment is linked to the u-boot binary. Modifying the
7environment from User Space with the env tools requires that the tools
8are always built together with the bootloader to be sure that they
9contain the initial environment in case no environment is stored into
10persistent storage or when a board boots with just the default
11environment. This makes difficult for distros to provide a general
12package to access the environment. A simpler way is if the tools are
13generic for all boards and a configuration file is given to provide the
14initial environment.
15
16The patch just generates the initial environment by extracting it from
17the compiled object. This file can then be used for tools in user space
18to initialize the environment.
19
20Signed-off-by: Stefano Babic <sbabic@denx.de>
21
22Upstream-Status: Backport [https://github.com/u-boot/u-boot/commit/bdaa73a5b3923257add182b4ab8058dbfa33421b]
23
24Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
25---
26 Makefile | 7 +++++++
27 1 file changed, 7 insertions(+)
28
29diff --git a/Makefile b/Makefile
30index 66a09ac900..f2c7bb6041 100644
31--- a/Makefile
32+++ b/Makefile
33@@ -1977,6 +1977,13 @@ endif
34 $(build)=$(build-dir) $(@:.ko=.o)
35 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
36
37+quiet_cmd_genenv = GENENV $@
38+cmd_genenv = $(OBJCOPY) --dump-section .rodata.default_environment=$@ env/common.o; \
39+ sed --in-place -e 's/\x00/\x0A/g' $@
40+
41+u-boot-initial-env: u-boot.bin
42+ $(call if_changed,genenv)
43+
44 # Consistency checks
45 # ---------------------------------------------------------------------------
46
47--
482.17.1
49
diff --git a/recipes-bsp/u-boot/u-boot-imx_2019.04.bb b/recipes-bsp/u-boot/u-boot-imx_2019.04.bb
index 4cfcb471..d37ede83 100644
--- a/recipes-bsp/u-boot/u-boot-imx_2019.04.bb
+++ b/recipes-bsp/u-boot/u-boot-imx_2019.04.bb
@@ -5,6 +5,8 @@
5require recipes-bsp/u-boot/u-boot.inc 5require recipes-bsp/u-boot/u-boot.inc
6require u-boot-imx-common.inc 6require u-boot-imx-common.inc
7 7
8SRC_URI += "file://0001-Add-target-to-generate-initial-environment.patch"
9
8PROVIDES += "u-boot" 10PROVIDES += "u-boot"
9 11
10do_deploy_append_mx8m() { 12do_deploy_append_mx8m() {