]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
uboot-config.bbclass: Handle UBOOT_MACHINE setting
authorOtavio Salvador <otavio@ossystems.com.br>
Thu, 19 Sep 2013 20:48:37 +0000 (17:48 -0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 20 Sep 2013 11:27:56 +0000 (12:27 +0100)
The class now consolidate the handle of UBOOT_MACHINE and UBOOT_CONFIG
variables and handle possible mistakes done by user when using these
variables.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/uboot-config.bbclass

index 44b46ffa0bc1accc9b3151bda73c68cada21c3ac..09a0c0f7b581cab46053a2700290cf06fa54d00c 100644 (file)
@@ -1,14 +1,30 @@
-# Allow easy override of U-Boot config for a machine
+# Handle U-Boot config for a machine
 #
 # The format to specify it, in the machine, is:
 #
 # UBOOT_CONFIG ??= <default>
 # UBOOT_CONFIG[foo] = "config,images"
 #
+# or
+#
+# UBOOT_MACHINE = "config"
+#
 # Copyright 2013 (C) O.S. Systems Software LTDA.
 
 python () {
+    ubootmachine = d.getVar("UBOOT_MACHINE", True)
     ubootconfigflags = d.getVarFlags('UBOOT_CONFIG')
+
+    if not ubootmachine and not ubootconfigflags:
+        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("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE", True))
+
+    if ubootmachine and ubootconfigflags:
+        raise bb.parse.SkipPackage("You cannot use UBOOT_MACHINE and UBOOT_CONFIG at the same time.")
+
     if not ubootconfigflags:
         return