summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorChunrong Guo <B40290@freescale.com>2015-01-22 14:27:49 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-08 08:00:24 +0000
commit1e4ee4bc22467bc4dfc52ec610c067bb6c337cd3 (patch)
treedf19f969abe7339083c4e6748354ee0498909948 /meta/classes
parent02a1e01c00f1fca678c4596cd80ec747ffc1dd6b (diff)
downloadast2050-yocto-poky-1e4ee4bc22467bc4dfc52ec610c067bb6c337cd3.zip
ast2050-yocto-poky-1e4ee4bc22467bc4dfc52ec610c067bb6c337cd3.tar.gz
uboot-config.bbclass: Allow multiple U-Boot config for machine
This adds support to build multiple U-Boot configs for a machine; this is useful when we have support for different media boots which require different U-Boot configuration (e.g: eMMC and NAND). Below there's an usage example: ,----[ i.MX6Q SABRE AUTO based example ] | UBOOT_CONFIG ??= "sd eimnor nand spinor" | UBOOT_CONFIG[sd] = "mx6qsabreauto_config,sdcard" | UBOOT_CONFIG[eimnor] = "mx6qsabreauto_eimnor_config" | UBOOT_CONFIG[nand] = "mx6qsabreauto_nand_config,ubifs" | UBOOT_CONFIG[spinor] = "mx6qsabreauto_spinor_config" `---- (From OE-Core rev: be997c70e4dec101786978b3ab5e49a1be87a85d) Signed-off-by: Chunrong Guo <B40290@freescale.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/uboot-config.bbclass37
1 files changed, 14 insertions, 23 deletions
diff --git a/meta/classes/uboot-config.bbclass b/meta/classes/uboot-config.bbclass
index b467659..cb061af 100644
--- a/meta/classes/uboot-config.bbclass
+++ b/meta/classes/uboot-config.bbclass
@@ -31,28 +31,19 @@ python () {
return
ubootconfig = (d.getVar('UBOOT_CONFIG', True) or "").split()
- if len(ubootconfig) > 1:
- raise bb.parse.SkipPackage('You can only have a single default for UBOOT_CONFIG.')
+ 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) > 2:
+ raise bb.parse.SkipPackage('Only config,images 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])
+ break
elif len(ubootconfig) == 0:
- raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')
- ubootconfig = ubootconfig[0]
-
- for f, v in ubootconfigflags.items():
- items = v.split(',')
- if items[0] and len(items) > 2:
- raise bb.parse.SkipPackage('Only config,images can be specified!')
-
- if ubootconfig == f:
- bb.debug(1, "Setting UBOOT_MACHINE to %s." % items[0])
- d.setVar('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])
-
- # Go out as we found a match!
- break
- else:
- raise bb.parse.SkipPackage("UBOOT_CONFIG %s is not supported" % ubootconfig)
+ raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')
}
OpenPOWER on IntegriCloud