summaryrefslogtreecommitdiff
path: root/meta/classes/uboot-config.bbclass
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2013-09-19 17:48:37 -0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-20 12:27:56 +0100
commit87d9b585b2784bec04e9e244dc52c6e929484fd0 (patch)
tree12c5ad19b0f01f27158679c9782c6865182d142b /meta/classes/uboot-config.bbclass
parentd0bc7a53b1e61283fb155b4dcb67bc2ab3b1d7f0 (diff)
downloadopenembedded-core-87d9b585b2784bec04e9e244dc52c6e929484fd0.tar.gz
openembedded-core-87d9b585b2784bec04e9e244dc52c6e929484fd0.tar.bz2
openembedded-core-87d9b585b2784bec04e9e244dc52c6e929484fd0.zip
uboot-config.bbclass: Handle UBOOT_MACHINE setting
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>
Diffstat (limited to 'meta/classes/uboot-config.bbclass')
-rw-r--r--meta/classes/uboot-config.bbclass18
1 files changed, 17 insertions, 1 deletions
diff --git a/meta/classes/uboot-config.bbclass b/meta/classes/uboot-config.bbclass
index 44b46ffa0b..09a0c0f7b5 100644
--- a/meta/classes/uboot-config.bbclass
+++ b/meta/classes/uboot-config.bbclass
@@ -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