From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 2947EE00CD5; Thu, 14 Feb 2019 10:06:40 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HTML_MESSAGE, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [209.85.222.170 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id A625CE00CAF for ; Thu, 14 Feb 2019 10:06:36 -0800 (PST) Received: by mail-qk1-f170.google.com with SMTP id m9so4142913qkl.4 for ; Thu, 14 Feb 2019 10:06:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=archsys-io.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=f/kqJEnPxgb4LlxBTQ0t0V3oLk+zFcOiPxwkHBMtVWM=; b=D/JeCJ+ZiRXcH9MkvU2/srbf0qVViICZzH5ikwdJWwt8pc5Htv5ZWhaXtvGASIk1Yl tPORYjrL1zMp+X3gBUnN+eQ7TClysVfiOu/3md+CuiU3wkRNtLrEG3VsBhm+CBDjkidC sW4kPHUBDaBX/mLeDV2WO0KhBegySsASghYmVwjBD/mRco0q2MxzyIzIZhSg42Sy8mb7 KRd1GOBsy1cAsXrBp8f06Oug3igmuB/ndo+9fvZHN3b15v/7L/IuZmXYK2a51Fw82p8j 3UTgWpU7aofRVuK61ouyG7pBbVVDLu1rvmIZ4YPuxsdqViuVzwpZV/7pVHZzfK/LCmNj fqBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=f/kqJEnPxgb4LlxBTQ0t0V3oLk+zFcOiPxwkHBMtVWM=; b=G0echyaoPmjWuoBmq/x4z7pqXemFxAuguMG27gho55LwjK3lZ6XygL5EflOQtN8TMl UiffhG2jzjfgGjJs0DaoQem+vhhPcSRNedSszq69kAV8HKrm2CkCKmFwV7GuJH5ohW7a 2WY6HrmXK3SVeRSybxiJlHEAe0wheSxG/DbnpjnmE33tUEH7NRahhAbW8DEMlo0DP8d6 hrLFFaHnfKMlP/ilILu45M44b2fwD34KSm2JGw/mtUJbfgMmcABHNUvwsSg5yxifHFyi +zo6FY+c5QSdLNLPR5Zh/uoVLHUSKyOBK6CCn8s8zF+ZhQQwczvXp6v5PZiDMpBHT3B/ LbZQ== X-Gm-Message-State: AHQUAubevGyGciOndtkLt1Oop4X2KtAHwoK5M1ZWd7Jm3PfhTsIC9Wlr sdwpIPezZcC2XnRReT0WMyaJuXZPd3dBKWvflJZY+hQi X-Google-Smtp-Source: AHgI3IZHlx2TX2tW+qkoMwXFcBHG/Zw8nvkMrtpM6mAl21eaL7VBhXJrfmqeQHnC3PeWhnSOBw/9I3jPxI2ZPL+sR/I= X-Received: by 2002:a37:a84:: with SMTP id 126mr3866720qkk.275.1550167596149; Thu, 14 Feb 2019 10:06:36 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Timothy Froehlich Date: Thu, 14 Feb 2019 10:06:25 -0800 Message-ID: To: Ulf Samuelsson Cc: Yocto discussion list Subject: Re: Managing multiple builds X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Feb 2019 18:06:40 -0000 Content-Type: multipart/alternative; boundary="000000000000e945ba0581de848a" --000000000000e945ba0581de848a Content-Type: text/plain; charset="UTF-8" Thank you, that looks like a very good idea. On Thu, Feb 14, 2019 at 8:28 AM Ulf Samuelsson wrote: > Den 2019-02-14 kl. 10:00, skrev Alexander Kanavin: > > On Thu, 14 Feb 2019 at 01:35, Timothy Froehlich > wrote: > >> Hi, I've been struggling a bit with this question. I want to use Yocto > to build two+ products with separate dev/prod images for each (dev > including debug-tweaks, etc.). I've ruled out separate image recipes > because my dev builds need ENABLE_UART on my RaspberryPi and that needs to > be set at the conf level (I've got it set conditionally in my base dist > conf). Multiconfig looked promising, but I'm not happy about how long the > parsing takes to start a build. "--postread" looked nice, but I've barely > seen it mentioned so I'm worried that it's not well supported. > >> > > > > Which recipes use the ENABLE_UART setting? You might want to write two > > variants of those, and include them into images accordingly. > > > > Alex > > > > Some guys I know solved the problem a little bit differently, and they > did not mind to share. > I created a meta-layer with that and some other ideas. > > * https://github.com/emagii/meta-map-sheriffco > > An example recipe is: > ================================== > SUMMARY = "" > DESCRIPTION = "" > > inherit license-mit > > SRC_URI = " \ > file://class/class-recipe.c \ > file://class/Makefile \ > " > > EXTRA_OEMAKE_class-development = 'CFLAGS="${CFLAGS} -DDEVELOPMENT"' > EXTRA_OEMAKE_class-production = 'CFLAGS="${CFLAGS} -DPRODUCTION"' > EXTRA_OEMAKE_class-release = 'CFLAGS="${CFLAGS} -DRELEASE"' > > do_install-class-development () { > install -d ${D}${bindir} > install -m 0755 class ${D}${bindir}/development > } > > do_install-class-production () { > install -d ${D}${bindir} > install -m 0755 class ${D}${bindir}/production > } > > do_install-class-release () { > install -d ${D}${bindir} > install -m 0755 class ${D}${bindir}/release > } > > BBCLASSEXTEND = "development production release" > ================================== > You now have the same recipe which builds four package variants. > > , > -development, > -production, > -release, > > The base package is not included in any image. > In the development image, you install the -development and so on. > ================================== > Three bbclasses are used, one for each special package. > > Here is the development.bbclass > ================================== > # Class for use in BBCLASSEXTEND to make it easier to have a single > recipe that > # build and generate packages separately for development and normal images. > # > # Usage: > # BBCLASSEXTEND = "development" > > CLASSOVERRIDE .= ":class-development" > > python development_virtclass_handler () { > # Do nothing if this is inherited, as it's for BBCLASSEXTEND > if "development" not in (d.getVar('BBCLASSEXTEND') or ""): > bb.error("Don't inherit development, use BBCLASSEXTEND") > return > > # Restore BPN > bpn = d.getVar('BPN') > newbpn = bpn.replace('-development', '') > d.setVar('BPN', newbpn) > > # Use default FILESPATH searching for patches and files > filespath = d.getVar('FILESPATH') > newfilespath = filespath.replace('-development', '') > d.setVar('FILESPATH', newfilespath) > } > > addhandler development_virtclass_handler > development_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise" > > ================================== > > -- > Best Regards > Ulf Samuelsson > -- > _______________________________________________ > yocto mailing list > yocto@yoctoproject.org > https://lists.yoctoproject.org/listinfo/yocto > -- Tim Froehlich Embedded Linux Engineer tfroehlich@archsys.io 215-218-8955 --000000000000e945ba0581de848a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you, that looks like a very good idea.

On Thu, Feb 14= , 2019 at 8:28 AM Ulf Samuelsson <yo= cto@emagii.com> wrote:
Den 2019-02-14 kl. 10:00, skrev Alexander Kanavin:
> On Thu, 14 Feb 2019 at 01:35, Timothy Froehlich <tfroehlich@archsys.io> wrot= e:
>> Hi, I've been struggling a bit with this question. I want to u= se Yocto to build two+ products with separate dev/prod images for each (dev= including debug-tweaks, etc.). I've ruled out separate image recipes b= ecause my dev builds need ENABLE_UART on my RaspberryPi and that needs to b= e set at the conf level (I've got it set conditionally in my base dist = conf). Multiconfig looked promising, but I'm not happy about how long t= he parsing takes to start a build. "--postread" looked nice, but = I've barely seen it mentioned so I'm worried that it's not well= supported.
>>
>
> Which recipes use the ENABLE_UART setting? You might want to write two=
> variants of those, and include them into images accordingly.
>
> Alex
>

Some guys I know solved the problem a little bit differently, and they
did not mind to share.
I created a meta-layer with that and some other ideas.

* https://github.com/emagii/meta-map-sheriffco

An example recipe is:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D
SUMMARY =3D ""
DESCRIPTION =3D ""

inherit license-mit

SRC_URI =3D " \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 file://class/class-recipe.c \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 file://class/Makefile \
"

EXTRA_OEMAKE_class-development =3D 'CFLAGS=3D"${CFLAGS} -DDEVELOPM= ENT"'
EXTRA_OEMAKE_class-production=C2=A0 =3D 'CFLAGS=3D"${CFLAGS} -DPRO= DUCTION"'
EXTRA_OEMAKE_class-release=C2=A0 =C2=A0 =C2=A0=3D 'CFLAGS=3D"${CFL= AGS} -DRELEASE"'

do_install-class-development () {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 install -d=C2=A0 =C2=A0 =C2=A0 ${D}${bindir} =C2=A0 =C2=A0 =C2=A0 =C2=A0 install -m 0755 class=C2=A0 =C2=A0${D}${bindir}= /development
}

do_install-class-production () {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 install -d=C2=A0 =C2=A0 =C2=A0 ${D}${bindir} =C2=A0 =C2=A0 =C2=A0 =C2=A0 install -m 0755 class=C2=A0 =C2=A0${D}${bindir}= /production
}

do_install-class-release () {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 install -d=C2=A0 =C2=A0 =C2=A0 ${D}${bindir} =C2=A0 =C2=A0 =C2=A0 =C2=A0 install -m 0755 class=C2=A0 =C2=A0${D}${bindir}= /release
}

BBCLASSEXTEND =3D "development production release"
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D
You now have the same recipe which builds four package variants.

<package>,
<package>-development,
<package>-production,
<package>-release,

The base package is not included in any image.
In the development image, you install the <package>-development and s= o on.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D
Three bbclasses are used, one for each special package.

Here is the development.bbclass
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D
# Class for use in BBCLASSEXTEND to make it easier to have a single
recipe that
# build and generate packages separately for development and normal images.=
#
# Usage:
# BBCLASSEXTEND =3D "development"

CLASSOVERRIDE .=3D ":class-development"

python development_virtclass_handler () {
=C2=A0 =C2=A0 =C2=A0# Do nothing if this is inherited, as it's for BBCL= ASSEXTEND
=C2=A0 =C2=A0 =C2=A0if "development" not in (d.getVar('BBCLAS= SEXTEND') or ""):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bb.error("Don't inherit developm= ent, use BBCLASSEXTEND")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return

=C2=A0 =C2=A0 =C2=A0# Restore BPN
=C2=A0 =C2=A0 =C2=A0bpn =3D d.getVar('BPN')
=C2=A0 =C2=A0 =C2=A0newbpn =3D bpn.replace('-development', '= 9;)
=C2=A0 =C2=A0 =C2=A0d.setVar('BPN', newbpn)

=C2=A0 =C2=A0 =C2=A0# Use default FILESPATH searching for patches and files=
=C2=A0 =C2=A0 =C2=A0filespath =3D d.getVar('FILESPATH')
=C2=A0 =C2=A0 =C2=A0newfilespath =3D filespath.replace('-development= 9;, '')
=C2=A0 =C2=A0 =C2=A0d.setVar('FILESPATH', newfilespath)
}

addhandler development_virtclass_handler
development_virtclass_handler[eventmask] =3D "bb.event.RecipePreFinali= se"

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D

--
Best Regards
Ulf Samuelsson
--
_______________________________________________
yocto mailing list
yocto@yoctoproj= ect.org
https://lists.yoctoproject.org/listinfo/yocto


--
Tim Froehlich
Embedded Linu= x Engineer
215-218-8955
--000000000000e945ba0581de848a--