22

In Yocto-based Embedded Linux distributions, I am really interested in finding the complete list of packages/recipes/kernel modules from each dependent layers that will be built and installed to an image file before executing the image building recipe such as:

bitbake my-image-minimal

Is there a way to achieve this? Any guidance in this regard is appreciated.

Thanks in advance.

mozcelikors
  • 2,582
  • 8
  • 43
  • 77

5 Answers5

25

Yes, like this on old Bitbake versions:

bitbake -g <image> && cat pn-depends.dot | grep -v -e '-native' \
    | grep -v digraph | grep -v -e '-image' | awk '{print $1}' | sort | uniq

Taken from the NXP Community website

On newer:

bitbake -g <image> && cat pn-buildlist | grep -ve "native" | sort | uniq
Guy Avraham
  • 3,482
  • 3
  • 38
  • 50
David Bensoussan
  • 2,887
  • 2
  • 38
  • 55
  • 1
    Hi, for some reason pn-depends.dot is not created. Only task-depends.dot, pn-buildlist, and recipe-depends.dot is created. – mozcelikors Oct 22 '17 at 22:20
  • 1
    I actually discovered that pn-buildlist has what I need. But still I would like to show what this command is capable of, however the pn-depends.dot is somehow still missing – mozcelikors Oct 22 '17 at 22:38
  • It seems they did a refactor and it's not working on newer versions. It now can be simplified – David Bensoussan Oct 23 '17 at 19:50
  • 2
    The second method doesn't seem to show all packages that are in the image. I have a package that is in RDEPENDS of one of the listed packages, and it's not shown in the list – Johannes Schaub - litb Aug 27 '19 at 15:41
  • I can't remember with version I use to write this answer. It maybe changed. Could you find a way working for you? – David Bensoussan Aug 27 '19 at 20:58
  • 1
    As from the manual: "pn-buildlist: Shows a simple list of targets that are to be built." If you find a name in pn-buildlist, this does not necessarily mean that the package is included in the image. One example is if you have RDEPENDS_${PN}-ptest, which adds run-time dependencies for a package test suite. – MikeBergmann Mar 04 '20 at 10:24
  • 1
    I believe `-cross` should also be filtered out; that's the cross-compilation toolchain that won't be installed either. – Jan Hudec Oct 19 '20 at 16:34
25

Yes,

Yocto maintains packages information in a form of manifest file located in

<"your_build_folder">/tmp/deploy/images/<"machine_image">/<"image_name">.manifest.

Guy Avraham
  • 3,482
  • 3
  • 38
  • 50
Krupal Tharwala
  • 1,036
  • 9
  • 16
8

You can find the list in the generated .manifest file. See IMAGE_MANIFEST

dafnahaktana
  • 837
  • 7
  • 21
0

We've talked about this in the past and for various reasons, it is hard to know what packages would end up in the image, without going through the complete build process.

One of the best tools for seeing what is an an image is the buildhistory class. Add it to your user classes in local.conf. The output ends up in the build directory within the buildhistory sub-directory.

Guy Avraham
  • 3,482
  • 3
  • 38
  • 50
balister
  • 341
  • 2
  • 4
0

Add INHERIT += "buildhistory" in your conf/local.conf and rebuild.

Guy Avraham
  • 3,482
  • 3
  • 38
  • 50
  • Could you please give some hint on what it might do? That would be superhelpful. Thankyou – avimehenwal Mar 13 '20 at 15:43
  • 1
    Hi, it's passed some time from when i was into this, but, probably the usage may be better checked here: https://stackoverflow.com/questions/27531898/how-to-use-buildhistory-in-yocto-build-system – Angelo Dureghello Mar 14 '20 at 16:04