summaryrefslogtreecommitdiffstats
path: root/meta/classes/uboot-config.bbclass
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denys@ti.com>2017-06-12 14:47:49 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-14 10:18:30 +0100
commiteee3227bad8159899d309443734e55a6c289012a (patch)
treedfa7eb4ea570ec79be63cc77ce08e513eda2ae00 /meta/classes/uboot-config.bbclass
parent608df535d4f655de12041dfdb6f6424c68658d24 (diff)
downloadpoky-eee3227bad8159899d309443734e55a6c289012a.tar.gz
uboot-config: check UBOOT_CONFIG variable, not flags, for error conditions
Sometimes there's a need to change existing UBOOT_CONFIG setting from a recipe, distro or local config, such as an override or even switch back to UBOOT_MACHINE. Unfortunately, there's no easy way to override or unset flags, so using them as an error condition is rather heavy-handed. Change those conditions to check the UBOOT_CONFIG variable itself, not its flags. (From OE-Core rev: b51383e5268ff33e43a39862814e065afbbd10ca) Signed-off-by: Denys Dmytriyenko <denys@ti.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/uboot-config.bbclass')
-rw-r--r--meta/classes/uboot-config.bbclass11
1 files changed, 3 insertions, 8 deletions
diff --git a/meta/classes/uboot-config.bbclass b/meta/classes/uboot-config.bbclass
index 10013b7d49..533e175a3c 100644
--- a/meta/classes/uboot-config.bbclass
+++ b/meta/classes/uboot-config.bbclass
@@ -20,24 +20,21 @@ python () {
20 ubootbinaries = d.getVar('UBOOT_BINARIES') 20 ubootbinaries = d.getVar('UBOOT_BINARIES')
21 # The "doc" varflag is special, we don't want to see it here 21 # The "doc" varflag is special, we don't want to see it here
22 ubootconfigflags.pop('doc', None) 22 ubootconfigflags.pop('doc', None)
23 ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split()
23 24
24 if not ubootmachine and not ubootconfigflags: 25 if not ubootmachine and not ubootconfig:
25 PN = d.getVar("PN") 26 PN = d.getVar("PN")
26 FILE = os.path.basename(d.getVar("FILE")) 27 FILE = os.path.basename(d.getVar("FILE"))
27 bb.debug(1, "To build %s, see %s for instructions on \ 28 bb.debug(1, "To build %s, see %s for instructions on \
28 setting up your machine config" % (PN, FILE)) 29 setting up your machine config" % (PN, FILE))
29 raise bb.parse.SkipPackage("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE")) 30 raise bb.parse.SkipPackage("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE"))
30 31
31 if ubootmachine and ubootconfigflags: 32 if ubootmachine and ubootconfig:
32 raise bb.parse.SkipPackage("You cannot use UBOOT_MACHINE and UBOOT_CONFIG at the same time.") 33 raise bb.parse.SkipPackage("You cannot use UBOOT_MACHINE and UBOOT_CONFIG at the same time.")
33 34
34 if ubootconfigflags and ubootbinaries: 35 if ubootconfigflags and ubootbinaries:
35 raise bb.parse.SkipPackage("You cannot use UBOOT_BINARIES as it is internal to uboot_config.bbclass.") 36 raise bb.parse.SkipPackage("You cannot use UBOOT_BINARIES as it is internal to uboot_config.bbclass.")
36 37
37 if not ubootconfigflags:
38 return
39
40 ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split()
41 if len(ubootconfig) > 0: 38 if len(ubootconfig) > 0:
42 for config in ubootconfig: 39 for config in ubootconfig:
43 for f, v in ubootconfigflags.items(): 40 for f, v in ubootconfigflags.items():
@@ -57,6 +54,4 @@ python () {
57 bb.debug(1, "Appending '%s' to UBOOT_BINARIES." % ubootbinary) 54 bb.debug(1, "Appending '%s' to UBOOT_BINARIES." % ubootbinary)
58 d.appendVar('UBOOT_BINARIES', ' ' + ubootbinary) 55 d.appendVar('UBOOT_BINARIES', ' ' + ubootbinary)
59 break 56 break
60 elif len(ubootconfig) == 0:
61 raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')
62} 57}