Yocto Project Discussions
 help / color / mirror / Atom feed
From: Mike Looijmans <mike.looijmans@topic.nl>
To: yocto@lists.yoctoproject.org
Subject: Re: [yocto] Switching between multiple DISTROs without "contamination"
Date: Tue, 12 Jul 2022 17:05:22 +0200	[thread overview]
Message-ID: <8f0726b6-c7ed-83a1-6069-41bf8370b3bb@topic.nl> (raw)
In-Reply-To: <6b3d2b0146aeaf2c25e0440e7dd6aa0c17cb4a36.camel@delisys.ch>

Quick answer: Don't build multiple distros in one build directory.

You might get away with setting TMPDIR = "tmp-${DISTRO}" to give each 
its own.

But I'd rather advice to set up two separate builds and just point the 
downloads and sstate-cache to the same location. It'll be faster than 
the TMPDIR option.

Or figure out how to put the difference in the IMAGE only. Then you can 
just build both images (in parallel, woot), which is faster, more 
convenient and saves on diskspace.

What I often do is have my-application.bb generate a 
my-application-utils package that only gets installed in the "dev" image 
but not in the production one, which only installs "my-application".

You could also create a "my-application-dev.bb" recipe that includes 
my-application.bb and just changes what it needs to be different.




Met vriendelijke groet / kind regards,

Mike Looijmans
System Expert


TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: mike.looijmans@topicproducts.com
W: www.topic.nl

Please consider the environment before printing this e-mail
On 12-07-2022 15:37, Nicolas Jeker via lists.yoctoproject.org wrote:
> Hi all,
>
> I'm currently using an additional layer and image to differentiate
> between a release and development build (enabling NFS, SSH, root login,
> etc.). To create a development build, I manually add the layer to
> bblayers.conf. This works quite well, but feels a bit clumsy to
> integrate into a CI/CD pipeline.
>
> Per these past discussions here [1][2], I'm now trying to migrate to
> multiple DISTROs, something like "mydistro" and "mydistro-dev".
>
> While migrating some of the changes, I discovered that I run into
> caching(?) issues. I have a recipe for an internal application and want
> to include additional systemd service files in the development image.
>
> What I did was this:
>
> Added "application-dbg.service" to recipes-internal/application/files
>
> Adapted application.bb recipe:
>
> SRC_URI:append:mydistro-dev = " file://application-dbg.service"
>
> do_install {
>      # ...snip...
>      # systemd service
>      install -d ${D}${systemd_system_unitdir}
>      install -m 0644 ${WORKDIR}/application.service
> ${D}${systemd_system_unitdir}
> }
>
> do_install:append:mydistro-dev() {
>      # debug systemd services
>      install -d ${D}${systemd_system_unitdir}
>      install -m 0644 ${WORKDIR}/application-dbg.service
> ${D}${systemd_system_unitdir}
> }
>
>
> When I run "DISTRO=mydistro-dev bitbake application" followed by
> "DISTRO=mydistro bitbake application", the debug service file is still
> present in the package. This seems to be caused by the "image"
> directory in the recipe WORKDIR not being cleaned between subsequent
> do_install runs. Is this expected behaviour? What's the best solution?
>
> Kind regards,
> Nicolas
>
> [1]:
> https://lore.kernel.org/yocto/CAH9dsRiArf_9GgQS4hCg5=J_Jk6cd3eiGaOiQd788+iSLTuU+g@mail.gmail.com/
> [2]:
> https://lore.kernel.org/yocto/VI1PR0602MB3549F83AC93A53785DE48677D3FD9@VI1PR0602MB3549.eurprd06.prod.outlook.com/
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#57508): https://lists.yoctoproject.org/g/yocto/message/57508
> Mute This Topic: https://lists.yoctoproject.org/mt/92332946/3618446
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [mike.looijmans@topic.nl]
> -=-=-=-=-=-=-=-=-=-=-=-
>

-- 
Mike Looijmans



  parent reply	other threads:[~2022-07-12 15:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.0579b8aa-d2a5-42d7-9e61-2548c06e61ef@emailsignatures365.codetwo.com>
     [not found] ` <1b153bce-a66a-45ee-a5c6-963ea6fb1c82.0d2bd5fa-15cc-4b27-b94e-83614f9e5b38.2d9bc8b4-92c7-47b2-b9e8-ac8d32e87ee0@emailsignatures365.codetwo.com>
2022-07-12 13:37   ` Switching between multiple DISTROs without "contamination" Nicolas Jeker
2022-07-12 14:49     ` AW: [yocto] " Martin Weber
2022-07-12 15:05     ` Mike Looijmans [this message]
2022-07-12 16:15       ` Khoi Dinh Trinh
2022-07-13 13:32         ` Nicolas Jeker
2022-07-20 14:42           ` Mike Looijmans
2022-07-20 16:22           ` Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8f0726b6-c7ed-83a1-6069-41bf8370b3bb@topic.nl \
    --to=mike.looijmans@topic.nl \
    --cc=yocto@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox