jojo
jojo

Reputation: 23

Yocto: question on adding bluez-alsa in Yocto build

I am new to Yocto, I built core-image-sato for default machine (x86-qemu). I have below questions with adding recipe:

  1. I want to add bluez-alsa in the build. I checked http://layers.openembedded.org/layerindex/branch/master/recipes/ and got the bb file (bluez-alsa_git.bb). For adding it, i created a directory (bluez-alsa) and created a bluez-alsa_git.bb file in it. Is this right method to add a new package?
  2. Now after adding the bluez-alsa (as specified in step-1 above), I am building core-image-sato which is failing, because of dependency in systemd module (I see from bb file dependency in systemd module). Below is the error:

ERROR: Nothing PROVIDES 'systemd' (but /home/srawat/tree/yocto/yocto_x86/poky/meta/recipes-connectivity/bluez-alsa/bluez-alsa.bb DEPENDS on or otherwise requires it)

systemd was skipped: missing required distro feature 'systemd' (not in DISTRO_FEATURES)

ERROR: Required build target 'bluez-alsa' has no buildable providers. Missing or unbuildable dependency chain was: ['bluez-alsa', 'systemd']

#

What is the method to include "systemd" module now? Or

IOW in general, how to include dependent packages (talking about existing packages of layers.openembedded.org, no new packages) in image?

Further i have more existing packages to add, will use the suggested method to add them.

advance thanks

Upvotes: 1

Views: 1725

Answers (1)

Khem
Khem

Reputation: 1257

Its best to include the layer which provides the recipe, this might help in bringing in needed direct and indirect dependencies as well as you also saw the missing dependency problem, however there is another side of the story, where the source layer might have further dependencies on other layers which might be too much of an ask for what one needs for adding a single recipe.

so in your case cherry-picking recipe seems to be a better approach since the source layer has quite a few deps plus this given recipe only has dependencies on core layer.

however the problem you have is that your distro policies do not use systemd but this recipe assumes systemd is enabled. so you have two ways

  1. Enable systemd distro-wide by adding something like below to local.conf
DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""
  1. Remove need for systemd from the recipe

change

DEPENDS += "alsa-lib bluez5 systemd glib-2.0 sbc"

to

DEPENDS += "alsa-lib bluez5 glib-2.0 sbc"

but this means you wont have stubs to enable/distable/start/stop launching services from this package. Which is provided for systemd by the recipe file from the layer which you will get out of box when using systemd for init system see

you might have to write your own init script to launch it if that is needed for your project

Upvotes: 1

Related Questions