RE: [yocto] defining standard build targets in layer metadata

"Bird, Tim" <[email protected]>
Newsgroups org.yoctoproject.lists.yocto
Message-ID <MW5PR13MB563252C3D31F984C8F8FC578FD32A@MW5PR13MB5632.namprd13.prod.outlook.com>

> -----Original Message-----
> From: [email protected] <[email protected]> On Behalf Of Alexander Kanavin via lists.yoctoproject.org
> Hello all,
> 
> working on bitbake-setup made me consider that a true end-to-end
> configuration tool should also know what to build, not only what to
> set up.
> 
> Earlier bitbake-setup prototypes allowed defining "oe-targets":[...]
> in its configuration files, but I later on realized this doesn't scale
> and isn't flexible enough, and isn't in the right place to begin with.
> So I took it out in the latest patchset.
> 
> So here's a quick, not-well-thought-out idea:
> 
> BB_TARGETS = "build:'core-image-minimal' test:'-c testmage core-image-minimal' "
> 
> defined somewhere in a layer (e.g. conf/distro/poky.conf or in a fragment).
> 
> And then one would be able to run
> 
> bitbake build
> bitbake test
> bitbake flash
> bitbake deploy
> etc.
> 
> which would standardize not only setting up a build but also running
> it. The particular set of generic target names and their values could
> be defined differently, but the basic idea would be similar.
> 
> Thoughts?

I don't have deep thoughts on implementation details, but I have
experience with optimizing command lines for tools.

I think it's important to have discoverability, and the ability to shorten
argument lists when working with a command line tool.

With my own 'ttc' (target control) tool (similar to labgrid), I support
a 'ttc list' command to show which targets are currently configured in
my lab.  I also have the capability to specify a default target (ie board)
using one of: a setting in a config file, an environment variable (TTC_TARGET),
or a command line option.  So can do stuff like:
export TTC_TARGET=rpi4
ttc kbuild
ttc kinstall
ttc cp some_test target:/usr/local/bin
ttc run /usr/local/bin/some_test

Note that I don't have to specify the target on every command.
ttc also supports a 'ttc setenv <target>' command, that is similar to
oe-init-build-env.  It just creates a new shell with appropriate
environment variables for operating on that target.

I have found these very handy in my own lab.

Separately, I think it would be great if people could use bitbake for deploy
operations.  I'm sure it's possible now with appropriate recipe files, but
I suspect it's not standardized for the Yocto ecosystem.  Maybe it's already
there and I just don't know about it.

Just my 2 cents.
 -- Tim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.