From: Patrick Ohly <patrick.ohly@intel.com>
To: Mircea Gliga <mircea.gliga@vitheia.com>
Cc: yocto@yoctoproject.org
Subject: Re: machine specific task
Date: Wed, 12 Oct 2016 13:08:29 +0200 [thread overview]
Message-ID: <1476270509.2992.65.camel@intel.com> (raw)
In-Reply-To: <eadb5311-bebc-97fa-1bdd-e85465a6e19e@vitheia.com>
On Wed, 2016-10-12 at 12:58 +0300, Mircea Gliga wrote:
> According to the docs here
> http://www.yoctoproject.org/docs/2.1.1/mega-manual/mega-manual.html#structure-your-layers
> one can specify variables that are machine specific, eg
> KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb". I can't find a reference
> on how to create a task specific only for a certain machine.
> Is there some mechanism to add and execute a custom task just for a
> specific machine, using *addtask* ?
>
> As an alternative, I could check the machine name right in the beginning
> of the do_mycustomtask function, and execute code accordingly, something
> like (pseudo-code):
>
> do_mycustomtask {
> if {MACHINE} != 'myMachineName'
> return;
> # code executing for all other machines
> [...]
> }
> addtask mycustomtask after do_configure before do_compile
It is possible to add the task conditionally in an anonymous Python
method:
python () {
if '${MACHINE}' == 'myMachineName':
bb.build.addtask('do_mycustomtask', 'do_compile', 'do_configure', d)
}
I personally find that nicer than the if check in the function itself,
because the tasks will only show up in build logs when it actually does
something.
--
Best Regards, Patrick Ohly
The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
next prev parent reply other threads:[~2016-10-12 11:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-12 9:58 machine specific task Mircea Gliga
2016-10-12 11:08 ` Patrick Ohly [this message]
2016-10-12 15:36 ` Christopher Larson
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=1476270509.2992.65.camel@intel.com \
--to=patrick.ohly@intel.com \
--cc=mircea.gliga@vitheia.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.