Bitbake list of targets
Asked Answered
M

6

33

thx for reading, I am working in a project where we create a secimage (linux yocto image).

I am not familiar with all the tools used there and neither am I familiar with the technical terms to use. So this question may be just really really stupid, but I cannot figure it out by the life of mine.

We have a YOCTO ...something... with all those recipes (debian packages) we need on our (resulting) Operating-System, we use (don't know if this is obvious) bitbake to build our Image.

I know that we have some ...targets... for the bitbake command (e.g. a target for building the image for production and a target for building the image for development purposes, they obviously differ in the packages installed, just to mention one: gdb-server).

Since I came into this project later on, I have no idea how they named those targets... so I just want to know:

How can I get a list of targets?

(I tried searching but since I am not even familiar with all the technical terms to use, cause I am not a developer for YOCTO, I may just did not search for the right terms)

I do not want to list the tasks, I just want to make a development image, which I know there is a target configured for it, I just don't know its name (and none of my colleges are here, nor will they be any time soon).

EDIT

Davids answer seems to be the closest, but there are some other ways in the comments ;-). THX all for your help, appreciated.

Musky answered 10/6, 2016 at 7:21 Comment(4)
Nevermind, I just did a grep -rnw #theOneTargetNameIKnew# and got a (lot of) result(s) pointing me to /#YOCTO#/#OurDistroMetaDirectory#/recipes-core/images/#target#.bb. Those seem to be the targets. If anyone has a bitbake command to get a list of these though, that would be nice. THXMusky
Check out the Yocto Mega Manual - Chapter 27. Images section to understand what an output target is. Generally each image should be placed in meta layer within image directory in corresponding image_name.bb recipe. As pointed in linked chapter, instead of grepping through whole workspace, you can examine your meta layers by calling: ` $ ls meta*/recipes*/images/*.bb`. Have fun using yocto!Bergius
So there is defenitly no command in the bitbake binaries!?... shakes his head out of disappointment... Yeah that command works, thx... a little tweak ;-) : ls meta*/recipes*/images/*.bb | sed -e 's/^.*\///g' | sed -e 's/\.bb$//g'--- Just seeing, it's in @h0ch5tr4355 caommand too...Musky
Oh, and a big thx for the mega-manual... didn't find that yet (sure am glad I dont need to work on the YOCTO images)Musky
C
34

You can easily list all the targets/recipes (.bb files) in your workspace doing:

bitbake-layers show-recipes

If you want only the recipes for your image, do:

bitbake-layers show-recipes "<image_name>"
Caecum answered 10/6, 2016 at 10:26 Comment(3)
This is a list of recipes only though, not a list of images per se. So it's not really what I want, but if it is known that the images one is looking for have a specific prefix/infix/postfix, the second command given can be useful. (If anyone is having troubles with the above, remember to set up the environment source oe-init-build-env. ) THX DavidMusky
I'd like you to include the limitation of this answer in your post (prefix/infix/postfix) but as h0ch5tr4355 I too think this is the closest answer (as long as there really ain't a way to find images only with one command, but it doesn't look like it). I will accept this. THXMusky
You can two ways as bitbake doesn't make differences for recipes: Either the assumption that image-recipes are always in imagesfolders or te assumption that imageis in the name of the recipe. second would also give this command: bitbake-layers show-recipes "*-image-*"Cabinet
A
9

To list the pre-defined Yocto images, run the following command from your poky directory

ls meta*/recipes*/images/*.bb
Anguilliform answered 11/9, 2018 at 10:2 Comment(1)
This is the correct answer according to the yocto manual: yoctoproject.org/docs/1.8/ref-manual/ref-manual.html#ref-imagesBuoyant
C
4

Other SDKs often use a custom script for setting up the build environment for yocto (mostly refers on oe-init-build-env from yocto anyway).

I took an excerpt of the setup script from the Freescale SDK 1.9 (fsl-setup-env) and created a script to display the images. It can be similar to this:

get-images.sh:

# top level directory of your yocto project
POKYROOTDIR=/home/poky

echo "Images:"
for i in `ls $POKYROOTDIR/meta*/recipes-*/images/*.bb 2>/dev/null`;do
    i=`basename $i`;i=`echo $i |sed -e 's,^\(.*\)\.bb,\1,'`
    echo "    $i";
done

This is based on the assumption that every recipe is placed in a images directory, what is supposed to be a convention.

Cabinet answered 10/6, 2016 at 8:10 Comment(4)
Also look at iksajotien's solution in the comments which is the short version of thisCabinet
I always forget that i have to escape the braces in sed, this is nice, but not a bitbake command, i see that i didnt explicitly asked for a bitbale command, but i am gonn await out to see if someone knows a bitbake command for this. thxMusky
deleted my comment and overworked it in David Bensoussan's solution.Cabinet
Better to make the POKYROOTDIR var generic and get the path using pwd, like so POKYROOTDIR=pwd;Obelia
R
4

To list the pre-defined Yocto images in all meta files, run the following command from your poky directory

find . -type f -path '*images/*' -name '*.bb'
Rockoon answered 10/1, 2020 at 8:41 Comment(0)
S
3

A similar command as the one provided on the NXP website here

bitbake-layers show-recipes "*image*"
Safranine answered 23/11, 2020 at 4:31 Comment(0)
S
0

I like this solution:

ziga@ziga--hypervisor:~/yocto$ ag -g .bb poky/meta | grep image

poky/meta/recipes-sato/images/core-image-sato.bb
poky/meta/recipes-sato/images/core-image-sato-dev.bb
poky/meta/recipes-sato/images/core-image-sato-sdk.bb
poky/meta/recipes-sato/images/core-image-sato-ptest-fast.bb
poky/meta/recipes-sato/images/core-image-sato-sdk-ptest.bb
poky/meta/recipes-graphics/xorg-lib/xcb-util-image_0.4.0.bb
poky/meta/recipes-graphics/images/core-image-clutter.bb
poky/meta/recipes-graphics/images/core-image-x11.bb
poky/meta/recipes-graphics/images/core-image-weston.bb
poky/meta/recipes-rt/images/core-image-rt-sdk.bb
poky/meta/recipes-rt/images/core-image-rt.bb
poky/meta/classes/image-live.bbclass
poky/meta/classes/kernel-uimage.bbclass
poky/meta/classes/image-combined-dbg.bbclass
poky/meta/classes/testimage.bbclass
poky/meta/classes/license_image.bbclass
poky/meta/classes/image-postinst-intercepts.bbclass
poky/meta/classes/core-image.bbclass
poky/meta/classes/image-mklibs.bbclass
poky/meta/classes/image-prelink.bbclass
poky/meta/classes/image_types_wic.bbclass
poky/meta/classes/image-buildinfo.bbclass
poky/meta/classes/image_types.bbclass
poky/meta/classes/kernel-fitimage.bbclass
poky/meta/classes/image.bbclass
poky/meta/classes/image-container.bbclass
poky/meta/recipes-extended/images/core-image-testmaster.bb
poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb
poky/meta/recipes-extended/images/core-image-kernel-dev.bb
poky/meta/recipes-extended/images/core-image-full-cmdline.bb
poky/meta/recipes-core/ovmf/ovmf-shell-image.bb
poky/meta/recipes-core/images/core-image-minimal-mtdutils.bb
poky/meta/recipes-core/images/core-image-minimal.bb
poky/meta/recipes-core/images/core-image-base.bb
poky/meta/recipes-core/images/core-image-minimal-initramfs.bb
poky/meta/recipes-core/images/core-image-minimal-dev.bb
poky/meta/recipes-core/images/core-image-tiny-initramfs.bb
poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb
Sapheaded answered 26/10, 2021 at 18:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.