From: "Duy" <duy.dang.yw@renesas.com>
To: bitbake-devel@lists.openembedded.org
Subject: Re: Custom variable value: (OVERRIDES?)
Date: Fri, 03 Apr 2020 04:37:36 -0700 [thread overview]
Message-ID: <8546.1585913856048757685@lists.openembedded.org> (raw)
In-Reply-To: <6bce089d-050d-7c57-15ac-a182b548f694@faresoftware.it>
[-- Attachment #1: Type: text/plain, Size: 793 bytes --]
Hi Mauro,
I assume that you are working with poky/meta layer.
You can use conditional function from oe.utils library like this:
YOUR_VAR = "${@oe.utils.conditional("VAR_NAME", "compare_value", "value_if_true", "value_if_false", d)}"
myrecipe.bbappend:
FILE_NAME = "${@oe.utils.conditional("MY_VAR", "white", "white.txt", "default.txt", d)}"
do_install_append() {
install -m 0644 ${FILE_NAME} ${D}/etc/value
}
local.conf:
MY_VAR = "white"
Another way is using in-line python conditional statement:
FILE_NAME = "${@'white.txt' if 'white' in d.getVar('MY_VAR') else 'default.txt'}"
If you want more than two values, consider using variable flag:
https://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-manual.html#variable-flag-syntax
Regards,
DD
[-- Attachment #2: Type: text/html, Size: 1062 bytes --]
next prev parent reply other threads:[~2020-04-03 11:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-02 15:34 Custom variable value: (OVERRIDES?) Mauro Ziliani
2020-04-03 11:37 ` Duy [this message]
2020-04-05 7:16 ` [bitbake-devel] " 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=8546.1585913856048757685@lists.openembedded.org \
--to=duy.dang.yw@renesas.com \
--cc=bitbake-devel@lists.openembedded.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.