How to resolve conflicts between bluez5 & pybluez - linux

I have a Yocto-based Linux image for a Gumstix board. The image includes the Bluez5 Bluetooth stack.
local.conf:
... DISTRO_FEATURES_append = " bluetooth bluez5" ...
This successfully builds an image where I can use the Bluetooth module from the CLI.
I want to use the Bluetooth module in Python, so I add pybluez support -
myimage.bb:
... PYTHON_INSTALL_append = "python-pybluez \" ...
python_pybluez.bb:
DESCRIPTION = "Python bindings for the Linux Bluetooth stack"
SECTION = "devel/python"
DEPENDS = "bluez5"
LICENSE = "GPL"
SRC_URI = "https://github.com/karulis/pybluez/archive/master.zip"
SRC_URI[md5sum] = "37733f35ad5a0522b86fe39467481fd1"
SRC_URI[sha256sum] = "8e7e5e4e343da7e0ec2cd37b6dc12ee77da8e4c0863dd8a2d03ab06f9b657238"
S = "${WORKDIR}/PyBluez-${PV}"
inherit distutils
This causes a huge number of conflicts when bitbaked and the build fails:
NOTE: Preparing RunQueue
ERROR: Multiple .bb files are due to be built which each provide bluez-hcidump (/home/parallels/yocto/poky/meta/recipes-connectivity/bluez5/bluez5_5.28.bb /home/parallels/yocto/poky/meta/recipes-connectivity/bluez/bluez-hcidump_2.5.bb).
This usually means one provides something the other doesn't and should.
NOTE: Executing SetScene Tasks
ERROR: The recipe bluez5 is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
/media/parallels/build/tmp/sysroots/overo/pkgdata/runtime-reverse/libasound-module-bluez
Matched in manifest-overo-bluez4.packagedata
/media/parallels/build/tmp/sysroots/overo/pkgdata/runtime/libasound-module-bluez.packaged
Matched in manifest-overo-bluez4.packagedata
/media/parallels/build/tmp/sysroots/overo/pkgdata/runtime/libasound-module-bluez
Matched in manifest-overo-bluez4.packagedata
Please verify which recipe should provide the above files.
The build has stopped as continuing in this scenario WILL break things, if not now, possibly in the future (we've seen builds fail several months later). If the system knew how to recover from this automatically it would however there are several different scenarios which can result in this and we don't know which one this is. It may be you have switched providers of something like virtual/kernel (e.g. from linux-yocto to linux-yocto-dev), in that case you need to execute the clean task for both recipes and it will resolve this error. It may be you changed DISTRO_FEATURES from systemd to udev or vice versa. Cleaning those recipes should again resolve this error however switching DISTRO_FEATURES on an existing build directory is not supported, you should really clean out tmp and rebuild (reusing sstate should be safe). It could be the overlapping files detected are harmless in which case adding them to SSTATE_DUPWHITELIST may be the correct solution. It could also be your build is including two different conflicting versions of things (e.g. bluez 4 and bluez 5 and the correct solution for that would be to resolve the conflict. If in doubt, please ask on the mailing list, sharing the error and filelist above.
ERROR: If the above message is too much, the simpler version is you're advised to wipe out tmp and rebuild (reusing sstate is fine). That will likely fix things in most (but not all) cases.
WARNING: Logfile for failed setscene task is /media/parallels/build/tmp/work/cortexa8hf-vfp-neon-poky-linux-gnueabi/bluez5/5.28-r0/temp/log.do_packagedata_setscene.16687
WARNING: Setscene task 803 (/home/parallels/yocto/poky/meta/recipes-connectivity/bluez5/bluez5_5.28.bb, do_packagedata_setscene) failed with exit code '1' - real task will be run instead
ERROR: The recipe bluez5 is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
/media/parallels/build/tmp/sysroots/overo/usr/lib/libbluetooth.so
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/lib/libbluetooth.la
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/lib/libbluetooth.so.3
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/lib/pkgconfig/bluez.pc
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/sdp.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/bnep.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/cmtp.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/hci.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/rfcomm.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/bluetooth.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/hci_lib.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/l2cap.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/sco.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/hidp.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/usr/include/bluetooth/sdp_lib.h
Matched in manifest-overo-bluez4.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/sysroot-providers/bluez-hcidump
Matched in manifest-overo-bluez-hcidump.populate_sysroot
/media/parallels/build/tmp/sysroots/overo/lib/udev/hid2hci
Matched in manifest-overo-bluez4.populate_sysroot
Please verify which recipe should provide the above files.
The build has stopped as continuing in this scenario WILL break things, if not now, possibly in the future (we've seen builds fail several months later). If the system knew how to recover from this automatically it would however there are several different scenarios which can result in this and we don't know which one this is. It may be you have switched providers of something like virtual/kernel (e.g. from linux-yocto to linux-yocto-dev), in that case you need to execute the clean task for both recipes and it will resolve this error. It may be you changed DISTRO_FEATURES from systemd to udev or vice versa. Cleaning those recipes should again resolve this error however switching DISTRO_FEATURES on an existing build directory is not supported, you should really clean out tmp and rebuild (reusing sstate should be safe). It could be the overlapping files detected are harmless in which case adding them to SSTATE_DUPWHITELIST may be the correct solution. It could also be your build is including two different conflicting versions of things (e.g. bluez 4 and bluez 5 and the correct solution for that would be to resolve the conflict. If in doubt, please ask on the mailing list, sharing the error and filelist above.
ERROR: If the above message is too much, the simpler version is you're advised to wipe out tmp and rebuild (reusing sstate is fine). That will likely fix things in most (but not all) cases.
It looks like pybluez is depending on a whole heap of Bluez4 recipes & libraries, which conflict with their Bluez5 counterparts. Would it be correct to resolve this by forcing pybluez to use the Bluez5 versions - if so, how and where should this be specified to Bitbake - if not, is it even possible to use pybluez with Bluez5 in a Yocto Linux system?

It looks like pybluez is depending on a whole heap of Bluez4 recipes & libraries
This is incorrect based on what you've shown. Your python-pybluez recipe only depends on bluez5 (and the python things distutils brings in). Yocto may magically add runtime dependencies to your packages based on linkage, but in that case you would get a warning about possibly missing build-time DEPENDS.
I think it's much more likely that the image you use contains bluez4 package already (maybe it's old or maybe they just haven't updated) and python-pybluez dragging in bluez5 breaks things.
Oh, forgot the beef: Did you notice the end of the message: you're advised to wipe out tmp and rebuild (reusing sstate is fine) -- building python-pybluez recipe alone should proceed if you just wipe your TMPDIR and build again. You'll still need to deal with the conflicts before image creation if your image does really contain bluez4

Related

Getting meta-azure-device-update to work with yocto kirkstone release

I'm pretty new to the yocto project so bear with me if these are trivial problems.
I followed this(https://hub.mender.io/t/preparing-the-yocto-project-environment-from-scratch/801) tutorial and was able to compile a minimal yocto image, flash that image to a SD card and run it on a raspberrypi3.
My next goal is to add the azure device update layer(https://github.com/hiroyha1/meta-azure-device-update)
I cloned the repository to the sources directory and tried to add this layer via bitbake. Since LAYERSERIES_COMPAT was set to "warrior" this failed. I changed that variable to "kirkstone" and updated the syntax in all bb files, basically changing _append/_prepend to :append/:prepend.
Now when I try to run bitbake adu-image-base I get this error:
ERROR: No recipes in default available for:
$MYWORKDIR/sources/meta-azure-device-update/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend
I searched for this error and found out that sometimes there are "dangling appends". As I found out a fix for that could be to set "BB_DANGLINGAPPENDS_WARNONLY ?= "true"" in the layer.conf.
After running bitbake adu-base-image again the next error is:
ERROR: adu-base-image-1.0-r0 do_rootfs: Could not invoke dnf. [...]
No match for argument: adu-agent-service Error: Unable to find a
match: adu-agent
So I'm pretty stuck here. I think that the dangling appends are the reason for that error - the adu-agent-service isnt build so cannot be packed in the image, for me this makes sense since the root_fs is part of the OTA functionality. My approach would be to revert the "BB_DANGLINGAPPENDS_WARNONLY" change and get this layer to build properly, but I'm struggling to debug this further.
So how can I get this layer to work with the kirkstone release?
P.S if the proposed layer is utterly broken and there is no easy way to get this to work with the kirkstone release a hint would be great.

Nothing provides error - adding new Yocto layer and new machine

I had a question about adding a new machine in Yocto.
I am trying to add both a new layer in Yocto, and a new machine. The machine is based on Atmels SAMA5D27-SOM1-EK-SD evaluation board. I want to enable another UART for this board.
I cloned the kernel source for this board (linux-at91) and added another DTS file based off of at91sama5d27-som1-ek-sd.dts file. I made the changes to enable UART0. I then added this new DTS file to the Makefile in linux-at91/arch/arm/boot/dts . I made a patch to save these changes.
I'm using meta-atmel layer and was following instructions outlined here to build the image for this board.
I have defined another layer that will act as the new Yocto layer that defines my custom machine. I have added some .bbappend files in recipes-kernel to add a patch (which adds a new dts file to the linux at91 kernel source) and to add our custom machine as a compatible machine. My understanding was that we could continue to use the definitions in the meta-atmel layer, but add .bbappend files in the meta-axon layer in the same path, and that would apply the changes that we want.
I have done the same for the recipes-bsp directory. In the meta-axon layer, all the .bbappend files in recipes-bsp only add our custom machine to the list of compatible machines.
However, when I go ahead and build, I get this error:
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing PROVIDES 'at91bootstrap-sam-ba'
at91bootstrap-sam-ba was skipped: incompatible with machine axon-ft3-sp-machine (not in COMPATIBLE_MACHINE)
I'm confused because the recipe file that defines at91bootstrap-sam-ba in meta-atmel does not mention any compatible machines, so I would want to use it from the meta-atmel layer without changing it at all. (edited)
It actually does mention compatible machines.
In at91bootstrap-sam-ba recipe[1], you can find the following line:
require at91bootstrap_${PV}.bb
Let's check out in this recipe then[2]:
COMPATIBLE_MACHINE = '(sama5d3xek|sama5d3-xplained|sama5d3-xplained-sd|at91sam9x5ek|at91sam9rlek|at91sam9m10g45ek|sama5d4ek|sama5d4-xplained|sama5d4-xplained-sd|sama5d2-xplained|sama5d2-xplained-sd|sama5d2-xplained-emmc|sama5d2-ptc-ek|sama5d2-ptc-ek-sd|sama5d27-som1-ek|sama5d27-som1-ek-sd|sama5d2-icp-sd|sam9x60ek|sam9x60ek-sd|sama5d27-wlsom1-ek-sd)'
Using bitbake at91bootstrap-sam-ba -e would show you that, indeed, COMPATIBLE_MACHINE is set and would even tell you where it was set.
P.S.: In some cases, it might actually be a good idea for your custom machine to require the original machine on which it is based (e.g. sama5d27-som1-ek-sd) and make the name of the original machine part of MACHINE_OVERRIDES so that you don't have to add a bbappend for each recipe with a COMPATIBLE_MACHINE. Be careful with the order in MACHINE_OVERRIDES, it is evaluated from right to left with rightmost OVERRIDES being of the highest priority. (Use bitbake -e <recipe> to be sure it's correctly set).
[1] https://github.com/linux4sam/meta-atmel/blob/master/recipes-bsp/at91bootstrap/at91bootstrap-sam-ba_3.9.2.bb#L1
[2] https://github.com/linux4sam/meta-atmel/blob/master/recipes-bsp/at91bootstrap/at91bootstrap_3.9.2.bb#L5

Error of "encountered a second time" by find.pm

everyone,
when I deploy my package to a linux environment, I met this error:
.../Linux-2.6c2.5-i686/Ncurses/Ncurses-15766.0-0/lib/libncurses.so.5 is encountered a second time at /apollo/_env/FBAMerchantAutoRemovalDaemon-swit1na.1755067.237551097.1107633519/perl/lib/perl5.8-dist/File/Find.pm line 542.
though I read the perl script, I have no idea what is wrong. I suspect my environment is tainted. Does anyone have idea what is wrong and how can I debug this problem? Thanks a lot in advance!
Zhe
From perldoc File::Find
follow
Causes symbolic links to be followed. Since directory trees with symbolic links (followed) may contain files more than once and may even have cycles, a hash has to be built up with an entry for each file. This might be expensive both in space and time for a large directory tree. See "follow_fast" and "follow_skip" below. If either follow or follow_fast is in effect:
It is guaranteed that an lstat has been called before the user's wanted() function is called. This enables fast file checks involving _. Note that this guarantee no longer holds if follow or follow_fast are not set.
There is a variable $File::Find::fullname which holds the absolute pathname of the file with all symbolic links resolved. If the link is a dangling symbolic link, then fullname will be set to undef.
So, if, for the purposes of your application, if it is OK to follow symlinks, invoke find with the follow option set:
find({ wanted => \&process, follow => 1 }, $dir);
Or, consider if one of the other follow_skip behaviors is more appropriate for your application:
follow_skip
follow_skip==1, which is the default, causes all files which are neither directories nor symbolic links to be ignored if they are about to be processed a second time. If a directory or a symbolic link are about to be processed a second time, File::Find dies.
follow_skip==0 causes File::Find to die if any file is about to be processed a second time.
follow_skip==2 causes File::Find to ignore any duplicate files and directories but to proceed normally otherwise.
It may be that follow_skip => 2 is more appropriate for your application. Only you can make that decision.

RPM verification error what is mean by P

I have created an RPM and that installs successfully. After installing, when I tried to verify the RPM with --verify command I am getting an error on executable file X it returns as
...P /location/to/file/X
I don't know what is mean P. The file has a special capability to listen the ports set by setcap. Can you please tell me what is mean by P? I have searched through Google but did't get any luck. Thanks in advance
As explained (albeit briefly) in the rpm man page:
rpm {-V|--verify} [select-options] [verify-options]
Verifying a package compares information about the installed files in the package with information about the files taken from the package metadata stored in the rpm database. Among other things, verifying compares the size, digest, permissions, type, owner and group of each file. Any discrepancies are displayed. Files that were not installed from the package, for example, documentation files excluded on installation using the "--excludedocs" option, will be silently ignored.
The format of the output is a string of 8 characters, a possible attribute marker:
....
from the package header, followed by the file name. Each of the 8 characters denotes the result of a comparison of attribute(s) of the file to the value of those attribute(s) recorded in the database. A single "." (period) means the test passed, while a single "?" (question mark) indicates the test could not be performed (e.g. file permissions prevent reading). Otherwise, the (mnemonically emBoldened) character denotes failure of the corresponding --verify test:
....
P caPabilities differ
So the capability of the file in question differs on disk from the capabilities of the file as listed in the rpm files section. How it differs is up to you to find out (and possibly fix).

Artefact folder structure does not contain empty directories

I'm trying to store whole the output of my build, this includes some empty folders. These aren't included by the artefact mechanism in teamcity:
What doesn't work:
OAR\=> OAR.zip
OAR->OAR.zip
OAR
Inside of OAR i have a folder structure that needs to be stored. I know i could put a placeholder file in each but that is not the answer i'm after. Otherwise ill have to zip it myself?
Unfortunately TeamCity, by design, searches for files and uploads them as artifacts which means that empty folders are never included. Given the open and very old issue in the TeamCity tracker I doubt they are going to fix it any time soon.
I would recommend zipping the folder yourself, that is the approach we have taken. How you implement that depends on the build technology you are using. For example, if you are building using Nant you could add the zip task to your build, there are similar options for MSBuild and Ant.
If you don't want to rely on the build performing the zip I would recommend installing 7zip on your build agents and using the command line to perform the zip. Just remember if you want 7zip to include empty directories use * as the wildcard rather than *. * like so:
7z a -r OAR.zip *
Technically you could use powershell to do the zipping, which would be better than having to install something on your agents. I haven't tried this option myself.
Apologies for not linking all my references above. Apparently, and understandably so, I need at least 10 reputation to post more than 2 links.

Resources