Yocto Project Discussions
 help / color / mirror / Atom feed
From: Mike Looijmans <mike.looijmans@topic.nl>
To: an010@live.com, yocto@lists.yoctoproject.org
Subject: Re: [yocto] Multiple images on the same hardware
Date: Thu, 1 Feb 2024 14:55:34 +0100	[thread overview]
Message-ID: <1139818a-0492-4feb-9d72-caee7217fea2@topic.nl> (raw)
In-Reply-To: <13858.1706738850246565515@lists.yoctoproject.org>


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@topic.nl
W: www.topic.nl

Please consider the environment before printing this e-mail
On 31-01-2024 23:07, Aleksandar Nikolic via Lists.Yoctoproject.Org wrote:
>     Instead of a distro or machine for each combination, it's also possible to
>     use a configuration file in the build directory. Your application recipe
>     just says "require my-app-config.inc" and then you can provide the
>     contents of that file when preparing the build. Makes things easy to
>     produce but harder to reproduce...
> 
> An interesting approach, didn't occur to me, thanks for the hint.
> 
>     The penalty for building things with unneeded features usually isn't that
>     big, so it might be worth it if you have systems with and without screen
>     to build them all with "x11" or "wayland" in their distro features. Trick
>     is to adjust the image recipe so that the headless machine doesn't install
>     all the graphic stuff (usually you'll have to take a look at how some
>     packagegroups get included and change that).
> 
> In this particular case I can use DISTRO_FEATURES in my recipe and nicely use 
> one image recipe to produce multiple images, this is however not possible with 
> e.g. kernel modues, as such variable does not exist.

DISTRO_FEATURES is rather inconvenient as it requires separate builds.

Why don't you just have multiple image recipes? I usually have something like

project-name-image (for released product)
project-name-image-dev (same, but with development options like a writable 
root and gdbserver)
project-name-production-test (...)

> 
>     Wifi and bluetooth can be compiled as kernel modules and loaded on demand.
> 
> Yes, this would work as well. Though some would argue that out of security 
> reasons it's better to reduce the attack surface and not even have kernel 
> modules to be loaded in the first place if they are not needed at all.

Safer even is to not have the modules on the filesystem at all, then the 
kernel cannot load them...

Normally the kernel only loads modules that it needs (systemd, udev, and even 
busybox' mdev feature on-demand module loading so you never have to forcibly 
"modprobe" anything)

Many images bluntly install "kernel-modules" which throws in everything that 
got built by the kernel recipe. Omit that and you can install kernel modules 
based on exact system requirements.



  reply	other threads:[~2024-02-01 13:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25  9:38 Multiple images on the same hardware Aleksandar Nikolic
2024-01-25  9:55 ` [yocto] " Alexander Kanavin
2024-01-25 12:18   ` Aleksandar Nikolic
2024-01-25 14:54     ` Alexander Kanavin
2024-01-25 15:05       ` Aleksandar Nikolic
2024-01-31  7:23       ` Mike Looijmans
2024-01-31 22:07         ` Aleksandar Nikolic
2024-02-01 13:55           ` Mike Looijmans [this message]
2024-02-01 14:11             ` Aleksandar Nikolic

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=1139818a-0492-4feb-9d72-caee7217fea2@topic.nl \
    --to=mike.looijmans@topic.nl \
    --cc=an010@live.com \
    --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