Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0145.outbound.protection.outlook.com [157.56.110.145]) by mail.openembedded.org (Postfix) with ESMTP id 1531465D3A for ; Thu, 11 Dec 2014 03:32:47 +0000 (UTC) Received: from DM2PR03CA0049.namprd03.prod.outlook.com (10.141.96.48) by BY2PR03MB441.namprd03.prod.outlook.com (10.141.141.142) with Microsoft SMTP Server (TLS) id 15.1.31.17; Thu, 11 Dec 2014 03:32:45 +0000 Received: from BN1BFFO11FD003.protection.gbl (2a01:111:f400:7c10::1:137) by DM2PR03CA0049.outlook.office365.com (2a01:111:e400:2428::48) with Microsoft SMTP Server (TLS) id 15.1.31.17 via Frontend Transport; Thu, 11 Dec 2014 03:32:45 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD003.mail.protection.outlook.com (10.58.144.66) with Microsoft SMTP Server (TLS) id 15.1.26.17 via Frontend Transport; Thu, 11 Dec 2014 03:32:44 +0000 Received: from sun.ap.freescale.net (sun.ap.freescale.net [10.192.208.75]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id sBB3Wfst006024; Wed, 10 Dec 2014 20:32:42 -0700 From: Chunrong Guo To: Date: Thu, 11 Dec 2014 11:32:35 +0800 Message-ID: <1418268755-19969-1-git-send-email-B40290@freescale.com> X-Mailer: git-send-email 1.9.2 X-EOPAttributedMessage: 0 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=B40290@freescale.com; X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(199003)(189002)(105606002)(104016003)(36756003)(21056001)(107046002)(2351001)(84676001)(106466001)(110136001)(229853001)(92566001)(64706001)(86362001)(50986999)(89996001)(47776003)(20776003)(19580405001)(6806004)(19580395003)(85426001)(62966003)(77156002)(450100001)(87936001)(120916001)(48376002)(46102003)(99396003)(68736005)(77096005)(50226001)(50466002)(4396001)(97736003)(31966008); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR03MB441; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB441; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601003); SRVR:BY2PR03MB441; X-Forefront-PRVS: 0422860ED4 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB441; X-OriginatorOrg: freescale.com Subject: [PATCH v4 1/2] uboot-config.bbclass: Allow multiple U-Boot config for machine X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2014 03:32:51 -0000 Content-Type: text/plain 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). Signed-off-by: Chunrong Guo --- meta/classes/uboot-config.bbclass | 37 ++++++++++++++----------------------- 1 file 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.') } -- 1.9.2