From: Mike Looijmans <mike.looijmans@topic.nl>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: Weird ALTERNATIVES and staging conflict.
Date: Mon, 3 Nov 2014 15:11:42 +0100 [thread overview]
Message-ID: <54578D1E.2060206@topic.nl> (raw)
In-Reply-To: <1415016563.5111.8.camel@ted>
On 11/03/2014 01:09 PM, Richard Purdie wrote:
> On Mon, 2014-11-03 at 12:35 +0100, Mike Looijmans wrote:
>> On 11/03/2014 11:49 AM, Mike Looijmans wrote:
>>> On 11/03/2014 11:04 AM, Richard Purdie wrote:
>>>> On Mon, 2014-11-03 at 10:53 +0100, Mike Looijmans wrote:
>>>>> On 10/30/2014 06:47 PM, Richard Purdie wrote:
>>>>>> On Thu, 2014-10-30 at 15:17 +0100, Mike Looijmans wrote:
>>>>>>> I have this base script that builds FPGA bitstreams:
>>>>>>>
>>>>>>> https://github.com/topic-embedded-products/meta-topic/blob/master/recipes-bsp/fpga/fpga-image.inc
>>>>>>>
>>>>>>>
>>>>>>> Now you can have multiple recipes using it, and as such, it seemed a good
>>>>>>> idea
>>>>>>> to add these lines to that recipe:
>>>>>>>
>>>>>>> +ALTERNATIVE_${PN} = "fpga.bin bitstreams"
>>>>>>> +ALTERNATIVE_LINK_NAME[fpga.bin] = "${datadir}/fpga.bin"
>>>>>>> +ALTERNATIVE_TARGET[fpga.bin] = "${datadir}/fpga.bin"
>>>>>>> +ALTERNATIVE_LINK_NAME[bitstreams] = "${datadir}/bitstreams"
>>>>>>> +ALTERNATIVE_TARGET[bitstreams] = "${datadir}/bitstreams"
>>>>>>>
>>>>>>>
>>>>>>> This still resulted in staging conflicts.
>>>>>>
>>>>>> This isn't surprising since update-alternatives only works for target
>>>>>> systems. It is not designed for operating on the sysroot.
>>>>>
>>>>> I don't want these files in sysroot, I want them on target only.
>>>>
>>>> Ok, that makes things much easier.
>>>>
>>>>>>> But looking at the contents of the fake packages, the fpga.bin has been
>>>>>>> renamed by alternatives (as expected), and the symlink will be created after
>>>>>>> installing, so how come I still get this?
>>>>>>
>>>>>> The "staging" code uses the output of do_install directly and does
>>>>>> different things to the packaging code path. We've never had someone
>>>>>> with this problem before. Binaries in *bindir only get installed into
>>>>>> the sysroot in the -native case.
>>>>>>
>>>>>> I appreciate that tells you why it doesn't work and not how to fix it
>>>>>> but hopefully that helps a bit.
>>>>>
>>>>> If I understand you correctly, the problem is that the recipe is trying to
>>>>> install things in sysroot?
>>>>
>>>> Correct, by default ${datadir} is staged. The easiest way to handle this
>>>> may be to define your own sysroot_stage_all function (or
>>>> sysroot_stage_dirs) which just stages what you need, if anything.
>>>
>>> In other words, make sysroot_stage_all into a no-op?
>>>
>>> I've been looking at the staging.bbclass, but that's basically the best I can
>>> come up with.
>>
>> Ah, slightly better:
>>
>> # Prevent bitstreams ending up in sysroot.
>> sysroot_stage_dirs_append() {
>> rm -rf $to${datadir}/fpga.bin $to${datadir}/bitstreams
>> }
>>
>> This wastes a bit (installing multimegabyte bitstreams only to remove them)
>> but it won't interfere with recipes that do wish to install things in sysroot.
>>
>> I've tested with this now, and this appears to do exactly as I wanted.
>
> That is fine and perfectly acceptable. Just to be clear, you can also
> do:
>
> sysroot_stage_all() {
> :
> }
>
> in your recipe and it will only affect that recipe, not all recipes.
It's slowly growing into a more of a class. This particular file gets included
by all FPGA image recipes (which is why I needed the alternatives mechanism),
so in my particular case, any change here affects a dozen actual packages.
Met vriendelijke groet / kind regards,
Mike Looijmans
System Expert
TOPIC Embedded Systems
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: (+31) (0) 499 33 69 79
Telefax: (+31) (0) 499 33 69 70
E-mail: mike.looijmans@topic.nl
Website: www.topic.nl
Please consider the environment before printing this e-mail
Topic zoekt gedreven (embedded) software specialisten!
http://topic.nl/vacatures/topic-zoekt-software-engineers/
next prev parent reply other threads:[~2014-11-03 14:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-30 14:17 Weird ALTERNATIVES and staging conflict Mike Looijmans
2014-10-30 17:47 ` Richard Purdie
2014-11-03 9:53 ` Mike Looijmans
2014-11-03 10:04 ` Richard Purdie
2014-11-03 10:49 ` Mike Looijmans
2014-11-03 11:35 ` Mike Looijmans
2014-11-03 12:09 ` Richard Purdie
2014-11-03 14:11 ` Mike Looijmans [this message]
2014-11-03 11:35 ` 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=54578D1E.2060206@topic.nl \
--to=mike.looijmans@topic.nl \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.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