Discussion:
[yocto] Building multiple U-Boot binaries (with different patch sets)
Andrei Faur
2018-11-13 09:10:17 UTC
Permalink
Hello,

My scenario is the following: I have two sets of U-Boot patches and I want to
create two separate images, each one containing a U-Boot built with one of the
patch sets. Everything else in the two images (kernel, rootfs) is the same. I am
using Yocto Rocko.


Searching this list and various other forums I found several ways of doing this:

1. Use two machine files and then in u-boot-imx_%.bbappend:
SRC_URI_machine1 += "file://patch1.patch \
file://patch2.patch"
SRC_URI_machine2 += "file://patch3.patch \
file://patch4.patch"

2. Try to do something like this
https://www.yoctoproject.org/docs/2.4.2/mega-manual/mega-manual.html#platdev-building-targets-with-multiple-configurations
https://lists.yoctoproject.org/pipermail/yocto/2017-October/038460.html

3. Find a way to expand on this approach, where separate U-Boot images are built
based on UBOOT_CONFIG:
https://lists.yoctoproject.org/pipermail/meta-freescale/2016-January/017257.html


My issue with 1. is that it is abusing the "machine" concept a bit since I am
not really building for separate targets.

The problem with 2. is that it feels like a very heavyweight approach to solve
an issue which is (in theory at least) very light: one recipe (U-Boot in this
case) needs to be built differently depending on which image it ends up in. Yes,
I know that is not how the system works:
https://lists.yoctoproject.org/pipermail/yocto/2014-June/020083.html
But still, that is my use case.

I find 3. to be the most straightforward approach but my problem is that I don't
know how to modify the SRC_URI variable depending on UBOOT_CONFIG. I am not even
sure if this is possible to do, can compilation be triggered twice based on
UBOOT_CONFIG at all?


Is there a recommended way of doing this? Are there any other approaches?

--
Andrei Faur
--

Loading...