diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 20:05:37 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-23 04:26:31 +0300 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /poky/meta/classes/uboot-config.bbclass | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/classes/uboot-config.bbclass')
-rw-r--r-- | poky/meta/classes/uboot-config.bbclass | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/poky/meta/classes/uboot-config.bbclass b/poky/meta/classes/uboot-config.bbclass new file mode 100644 index 0000000000..89ff970fcc --- /dev/null +++ b/poky/meta/classes/uboot-config.bbclass @@ -0,0 +1,57 @@ +# Handle U-Boot config for a machine +# +# The format to specify it, in the machine, is: +# +# UBOOT_CONFIG ??= <default> +# UBOOT_CONFIG[foo] = "config,images,binary" +# +# or +# +# UBOOT_MACHINE = "config" +# +# Copyright 2013, 2014 (C) O.S. Systems Software LTDA. + +UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}" + +python () { + ubootmachine = d.getVar("UBOOT_MACHINE") + ubootconfigflags = d.getVarFlags('UBOOT_CONFIG') + ubootbinary = d.getVar('UBOOT_BINARY') + ubootbinaries = d.getVar('UBOOT_BINARIES') + # The "doc" varflag is special, we don't want to see it here + ubootconfigflags.pop('doc', None) + ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split() + + if not ubootmachine and not ubootconfig: + PN = d.getVar("PN") + FILE = os.path.basename(d.getVar("FILE")) + bb.debug(1, "To build %s, see %s for instructions on \ + setting up your machine config" % (PN, FILE)) + raise bb.parse.SkipRecipe("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE")) + + if ubootmachine and ubootconfig: + raise bb.parse.SkipRecipe("You cannot use UBOOT_MACHINE and UBOOT_CONFIG at the same time.") + + if ubootconfigflags and ubootbinaries: + raise bb.parse.SkipRecipe("You cannot use UBOOT_BINARIES as it is internal to uboot_config.bbclass.") + + if len(ubootconfig) > 0: + for config in ubootconfig: + for f, v in ubootconfigflags.items(): + if config == f: + items = v.split(',') + if items[0] and len(items) > 3: + raise bb.parse.SkipRecipe('Only config,images,binary can be specified!') + d.appendVar('UBOOT_MACHINE', ' ' + items[0]) + # IMAGE_FSTYPES appending + if len(items) > 1 and items[1]: + bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1]) + d.appendVar('IMAGE_FSTYPES', ' ' + items[1]) + if len(items) > 2 and items[2]: + bb.debug(1, "Appending '%s' to UBOOT_BINARIES." % items[2]) + d.appendVar('UBOOT_BINARIES', ' ' + items[2]) + else: + bb.debug(1, "Appending '%s' to UBOOT_BINARIES." % ubootbinary) + d.appendVar('UBOOT_BINARIES', ' ' + ubootbinary) + break +} |