From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp5-g21.free.fr (smtp5-g21.free.fr [212.27.42.5]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 52842E013D6 for ; Mon, 23 Sep 2013 16:04:54 -0700 (PDT) Received: from e6520eb (unknown [82.233.81.124]) (Authenticated sender: eukrea) by smtp5-g21.free.fr (Postfix) with ESMTPSA id E1D4FD480A3; Tue, 24 Sep 2013 01:04:46 +0200 (CEST) Date: Tue, 24 Sep 2013 01:04:45 +0200 From: Eric =?ISO-8859-1?B?QuluYXJk?= To: Otavio Salvador Message-ID: <20130924010445.45f71815@e6520eb> In-Reply-To: <1379966158-18179-2-git-send-email-otavio@ossystems.com.br> References: <1379966158-18179-1-git-send-email-otavio@ossystems.com.br> <1379966158-18179-2-git-send-email-otavio@ossystems.com.br> Organization: =?ISO-8859-1?B?RXVrculh?= Electromatique X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.19; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Cc: meta-freescale Mailing List Subject: Re: [meta-fsl-arm PATCH 01/23] fsl-dynamic-packagearch.bbclass: Dynamically set package architecture X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 23:04:56 -0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable H Otavio, Le Mon, 23 Sep 2013 16:55:36 -0300, Otavio Salvador a =E9crit : > This allow to easy reuse of binary packages among similar SoCs. The > usual use for this is to share SoC specific packages among different > boards. The class can be used to share GPU packages for i.MX53 boards > (as all them share the AMD GPU) and i.MX6 based boards (as all them > share Vivante GPU). >=20 > It inspects the database and identify if the package provides or > depends on one of subarch provided values and if it does, it sets the > PACKAGE_ARCH for MACHINE_SUBARCH value otherwise if it matches in the > machine specific filter, it sets it to MACHINE_ARCH. >=20 > Change-Id: Icb0a8060e862c8eeb166c45d1b39c40de07b01d8 > Signed-off-by: Otavio Salvador > --- > classes/fsl-dynamic-packagearch.bbclass | 37 +++++++++++++++++++++++++++= ++++++ > 1 file changed, 37 insertions(+) > create mode 100644 classes/fsl-dynamic-packagearch.bbclass >=20 > diff --git a/classes/fsl-dynamic-packagearch.bbclass b/classes/fsl-dynami= c-packagearch.bbclass > new file mode 100644 > index 0000000..2778885 > --- /dev/null > +++ b/classes/fsl-dynamic-packagearch.bbclass > @@ -0,0 +1,37 @@ > +# Automatically set PACKAGE_ARCH for MACHINE_SUBARCH > +# > +# This allow to easy reuse of binary packages among similar SoCs. The > +# usual use for this is to share SoC specific packages among different > +# boards. > +# > +# For example, in meta-fsl-arm, this is used to share GPU packages for > +# i.MX53 boards (as all them share the AMD GPU) and i.MX6 based boards > +# (as all them share Vivante GPU). > +# > +# To use the class, specify: > +# > +# SUBARCH_FILTER =3D "foo" > +# MACHINE_ARCH_FILTER =3D "bar" > +# > +# Copyright 2013 (C) O.S. Systems Software LTDA. > + > +python __anonymous () { > + machine_arch_filter =3D set((d.getVar("MACHINE_ARCH_FILTER", True) o= r "").split()) > + subarch_filter =3D set((d.getVar("SUBARCH_FILTER", True) or "").spli= t()) > + if subarch_filter or machine_arch_filter: > + provides =3D set((d.getVar("PROVIDES", True) or "").split()) > + depends =3D set((d.getVar("DEPENDS", True) or "").split()) > + PN =3D d.getVar("PN", True) > + > + package_arch =3D None > + if list(machine_arch_filter & (provides | depends)): > + package_arch =3D d.getVar("MACHINE_ARCH", True) > + elif list(subarch_filter & (provides | depends)): > + package_arch =3D d.getVar("MACHINE_SUBARCH", True) > + if not package_arch: > + bb.parse.SkipPackage("You must set MACHINE_SUBARCH as SU= BARCH_FILTER is set for this SoC.") > + > + if package_arch: > + bb.debug(1, "Use '%s' as package archictecture for '%s'" % (= package_arch, PN)) > + d.setVar("PACKAGE_ARCH", package_arch) > +} what is the time cost of this dynamic setting vs the static one ? Eric