Weird ALTERNATIVES and staging conflict.
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. So I made two simple recipes to demonstrate the problem:
SUMMARY = "FPGA bitstream"XILINX_VIVADO_VERSION = "2014.1"
require recipes-bsp/fpga/fpga-image.inc
LICENSE = "internal"LIC_FILES_CHKSUM = "file://${METATOPIC_BASE}/LICENSE;md5=cf85de037de7ae12cc2d0059741fdbae" SRC_URI = ""
S = "${WORKDIR}"
do_compile() {
echo "${PN}" > fpga.bit
}do_convert_bitstreams() {
ln -f fpga.bit fpga.bin
}
I save this as "fpga-image-fake-one.bb" and "fpga-image-fake-two.bb"
I then create an image that installs them both, and bitbake that image. This (still) results in the following error:
ERROR: The recipe fpga-image-fake-two is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
/home/mike/zynq_platform/build/tmp-glibc/sysroots/topic-miami-7015/usr/share/fpga.bin
Matched in manifest-topic-miami-7015-fpga-image-fake-one.populate_sysroot
Please verify which recipe should provide the above files.
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?
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: [email protected]
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/
Quoted 14 lines · Mike Looijmans
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:
(quoted diff) +5
-0+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"
Quoted 1 line
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.
Quoted 3 lines
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.
Cheers,
Richard
Quoted 15 lines · Richard Purdie
Quoted 14 lines · Mike Looijmans
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:
(quoted diff) +5
-0+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"
Quoted 4 lines
Quoted 1 line
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.
Quoted 11 lines
Quoted 3 lines
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_installdirectly 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?
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: [email protected]
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/
Quoted 16 lines · Mike Looijmans
Quoted 15 lines · Richard Purdie
Quoted 14 lines · Mike Looijmans
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:
(quoted diff) +5
-0+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"
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
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.
Quoted 9 lines
Quoted 9 lines
Quoted 3 lines
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_installdirectly 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.
Quoted 5 lines
Quoted 2 lines
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.
Cheers,
Richard
Quoted 38 lines · Richard Purdie
Quoted 16 lines · Mike Looijmans
Quoted 15 lines · Richard Purdie
Quoted 14 lines · Mike Looijmans
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:
(quoted diff) +5
-0+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"Quoted 6 lines
Quoted 4 lines
Quoted 1 line
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.
Quoted 12 lines
Quoted 11 lines
Quoted 3 lines
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_installdirectly 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.
Quoted 6 lines
Quoted 2 lines
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_allfunction (orsysroot_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.
M.
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: [email protected]
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/
Quoted 44 lines · Mike Looijmans
Quoted 43 lines · Richard Purdie
Quoted 18 lines · Mike Looijmans
Quoted 17 lines · Richard Purdie
Quoted 16 lines · Mike Looijmans
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:(quoted diff) +5
-0+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"Quoted 6 lines
Quoted 4 lines
Quoted 1 line
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.
Quoted 14 lines
Quoted 11 lines
Quoted 3 lines
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_installdirectly 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?
Quoted 8 lines
Quoted 3 lines
Correct, by default ${datadir} is staged. The easiest way to handle this may be to define your own
sysroot_stage_allfunction (orsysroot_stage_dirs) which just stages what you need, if anything.In other words, make
sysroot_stage_allinto 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.
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: [email protected]
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/
Quoted 57 lines · Mike Looijmans
Quoted 44 lines · Mike Looijmans
Quoted 43 lines · Richard Purdie
Quoted 18 lines · Mike Looijmans
Quoted 17 lines · Richard Purdie
Quoted 16 lines · Mike Looijmans
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:(quoted diff) +5
-0+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"Quoted 6 lines
Quoted 4 lines
Quoted 1 line
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.
Quoted 14 lines
Quoted 11 lines
Quoted 3 lines
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_installdirectly 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?
Quoted 8 lines
Quoted 3 lines
Correct, by default ${datadir} is staged. The easiest way to handle this may be to define your own
sysroot_stage_allfunction (orsysroot_stage_dirs) which just stages what you need, if anything.In other words, make
sysroot_stage_allinto 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.
Quoted 8 lines
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.
Cheers,
Richard
Quoted 67 lines · Richard Purdie
Quoted 57 lines · Mike Looijmans
Quoted 44 lines · Mike Looijmans
Quoted 43 lines · Richard Purdie
Quoted 18 lines · Mike Looijmans
Quoted 17 lines · Richard Purdie
Quoted 16 lines · Mike Looijmans
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:(quoted diff) +5
-0+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"Quoted 6 lines
Quoted 4 lines
Quoted 1 line
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.
Quoted 14 lines
Quoted 11 lines
Quoted 3 lines
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_installdirectly 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?
Quoted 8 lines
Quoted 3 lines
Correct, by default ${datadir} is staged. The easiest way to handle this may be to define your own
sysroot_stage_allfunction (orsysroot_stage_dirs) which just stages what you need, if anything.In other words, make
sysroot_stage_allinto 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.
Quoted 8 lines
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.
Quoted 8 lines
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: [email protected]
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/
Quoted 42 lines · Mike Looijmans
Quoted 41 lines · Richard Purdie
Quoted 16 lines · Mike Looijmans
Quoted 15 lines · Richard Purdie
Quoted 14 lines · Mike Looijmans
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:
(quoted diff) +5
-0+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"Quoted 6 lines
Quoted 4 lines
Quoted 1 line
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.
Quoted 14 lines
Quoted 11 lines
Quoted 3 lines
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_installdirectly 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?
Quoted 8 lines
Quoted 3 lines
Correct, by default ${datadir} is staged. The easiest way to handle this may be to define your own
sysroot_stage_allfunction (orsysroot_stage_dirs) which just stages what you need, if anything.In other words, make
sysroot_stage_allinto a no-op?I've been looking at the staging.bbclass, but that's basically the best I can come up with.
I don't know what else your recipe may need. If you don't need to stage anything into the sysroots, make it a no-op, yes.
Cheers,
Richard