Patchwork u-boot-fw-utils: Skip package if UBOOT_MACHINE is unset

login
register
mail settings
Submitter Otavio Salvador
Date Sept. 18, 2013, 3:34 a.m.
Message ID <1379475258-21205-1-git-send-email-otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/58295/
State Accepted
Commit 63cd03b80c3eb5b4b88774e44a4ed2cf0905f094
Headers show

Comments

Otavio Salvador - Sept. 18, 2013, 3:34 a.m.
The UBOOT_MACHINE variable needs to be set so the firmware utils can
know about some configuration settings which are board dependent. This
patch ensures the package is skipped in case UBOOT_MACHINE is unset
thus avoid its build in 'bitbake world' builds for incompatible
machines.

Fixes [YOCTO: #5223]

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/recipes-bsp/u-boot/u-boot-fw-utils_2013.07.bb | 9 +++++++++
 1 file changed, 9 insertions(+)
Anders Darander - Sept. 18, 2013, 5:07 a.m.
On 18 September 2013 05:34, Otavio Salvador <otavio@ossystems.com.br> wrote:

> The UBOOT_MACHINE variable needs to be set so the firmware utils can
> know about some configuration settings which are board dependent. This
> patch ensures the package is skipped in case UBOOT_MACHINE is unset
> thus avoid its build in 'bitbake world' builds for incompatible
> machines.
>
> Fixes [YOCTO: #5223]
>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>

Thanks for the quick fix!

Acked-by: Anders Darander <anders@chargestorm.se>

/Anders

Patch

diff --git a/meta/recipes-bsp/u-boot/u-boot-fw-utils_2013.07.bb b/meta/recipes-bsp/u-boot/u-boot-fw-utils_2013.07.bb
index f97df71..e711951 100644
--- a/meta/recipes-bsp/u-boot/u-boot-fw-utils_2013.07.bb
+++ b/meta/recipes-bsp/u-boot/u-boot-fw-utils_2013.07.bb
@@ -17,6 +17,15 @@  S = "${WORKDIR}/git"
 
 EXTRA_OEMAKE = 'HOSTCC="${CC}" HOSTSTRIP="true"'
 
+python () {
+	if not d.getVar("UBOOT_MACHINE", True):
+		PN = d.getVar("PN", True)
+		FILE = os.path.basename(d.getVar("FILE", True))
+		bb.debug(1, "To build %s, see %s for instructions on \
+			     setting up your machine config" % (PN, FILE))
+		raise bb.parse.SkipPackage("UBOOT_MACHINE is not set in the %s machine configuration." % d.getVar("MACHINE", True))
+}
+
 do_compile () {
   oe_runmake ${UBOOT_MACHINE}
   oe_runmake env