All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dimitris Tassopoulos <dimtass@gmail.com>
To: Sergio Torres Soldado <torres.soldado@gmail.com>
Cc: Yocto discussion list <yocto@yoctoproject.org>
Subject: Re: customising a bsp
Date: Mon, 1 Apr 2019 09:27:09 +0200	[thread overview]
Message-ID: <CACKFPN02mVEou-e9A5SQs+WiQB-_Xm1yGkhrbnHiOACZjzUHjg@mail.gmail.com> (raw)
In-Reply-To: <CAFuHCCBnm9uGqeiyFrpzuGtahYQUUK=ap1gp3NOuy_eA1TooCA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2907 bytes --]

Hi Serj,

I'm using the -r / -R options in bitbake in order to customize the image
via global
variables and be able to build different configurations for the same
machine and
distro. You you use the same option to create e.g. different versions. Have
a look
in the documentation

https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html

search for these lines:
-r PREFILE, --read=PREFILE
-R POSTFILE, --postread=POSTFILE

What those do is that you can add an extra configuration file wich either
prepends
or appends the local.conf file. I'm using it both ways, but for your case I
think you
need to add your default versions with ?= in the local.conf and then
override them
with an external conf file and use --read option.

So, let's say that you have the minimal-image then you can have a number or
versioned configuration files (e.g. version-1.0.conf, version-1.2.conf,
e.t.c.) then
you setup your environment as usual using your environment setup scripts or
just calling oe-init-build-env for your machine and then you'll be able to
build
different versions like this:

bitbake -R version-1.0.conf minimal-image


You can also build a single recipe using the version file

bitbake -R version-1.2.conf virtual/kernel


Then, if you like, you can create a wrapper script that actually simplifies
the call
and just pass the version. For example, you can create an executable bash
script
and these

#!/bin/bash
> CONF_VERSION="1.0"
> while getopts v:h" OPTION
> do
>     case $OPTION in
>     v) CONF_VERSION=${OPTARG} ;;
>     h) echo "Print some help" ;;
>     *) echo "Print some help" ;;
> esac
> done
> bitbake --postread=${CONF_VERSION} ${1}


And then call the script using -v to pass the version. Of course, that
assumes
that all version files are in the same folder with the local.conf. I
usually make
such scripts but they are doing much more stuff, for example use variables
from the extra conf file to run other tasks.

Hope that helps.

Cheers,
Dimitris

Sergio Torres Soldado <torres.soldado@gmail.com> schrieb am Sa., 30. März
2019, 18:34:

> Hi,
>
>  What is the best alternative to setting variables in local.conf? The
> specific use-case is customising a meta-raspberrypi build, which has a
> bunch of variables that are picked up by the MACHINE code to influence
> build configurations. I want to version these customisations hence removing
> them from local.conf.
>
>  I have tried adding a machine definition in a separate layer that
> includes the same files as those from the machines in meta-raspberry pi but
> there is logic that depends on the machine name and building an image fails.
>
> Many thanks,
> Serj.
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto

[-- Attachment #2: Type: text/html, Size: 4597 bytes --]

  reply	other threads:[~2019-04-01  7:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-30 17:33 customising a bsp Sergio Torres Soldado
2019-04-01  7:27 ` Dimitris Tassopoulos [this message]
2019-04-01  7:48   ` Sergio Torres Soldado
2019-04-01 14:45     ` Paul Barker

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=CACKFPN02mVEou-e9A5SQs+WiQB-_Xm1yGkhrbnHiOACZjzUHjg@mail.gmail.com \
    --to=dimtass@gmail.com \
    --cc=torres.soldado@gmail.com \
    --cc=yocto@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.