Package names in IMAGE_MANIFEST and PACKAGES


Mikko Murto
 

Hello,

I'm developing a meta layer to save details about an image created by Yocto to an SPDX document (https://github.com/doubleopen-project/meta-doubleopen).

I've encountered two issues regarding package names in IMAGE_MANIFEST and PACKAGES variables, https://github.com/doubleopen-project/meta-doubleopen/issues/2 and https://github.com/doubleopen-project/meta-doubleopen/issues/3.

The crux of the matter is that I need to find packages created by recipes and to link the packages listed in image's manifest files to these packages.

First, the PACKAGES variable of all recipes doesn't seem to include all packages created. For example util-linux's PACKAGES doesn't include util-linux-sulogin, but util-linux-sulogin may be included in an image's manifest and it has a directory in the packages-split directory of util-linux. What would be the correct way to get information about all packages?

Second, the package names in the image manifest may differ from those in the PACKAGES variable or in packages-split directory. As an example, a manifest file may include libkmod2, but recipe for kmod creates package named libkmod. How to make the link from libkmod2 to libkmod?

Best regards,

Mikko Murto
Associate

HH Partners, Attorneys-at-law Ltd
Eteläesplanadi 22 a, 00130 Helsinki, Finland
P.O. Box 232, 00101 Helsinki, Finland
Tel: +358 9 177 613, Fax: +358 9 653 873
mikko.murto@hhpartners.fi
www.hhpartners.fi

HH Partners shines in international rankings. See details at hhpartners.fi.

Privileged and confidential information may be contained in this message. If you are not the addressee indicated in this message (or responsible for the delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, kindly notify us by reply e-mail and delete this message immediately. Thank you.


Jérôme Carretero
 

Hi Mikko,


On Fri, 26 Feb 2021 14:18:59 +0000
"Mikko Murto" <mikko.murto@hhpartners.fi> wrote:

The crux of the matter is that I need to find packages created by recipes and to link the packages listed in image's manifest files to these packages.
The way I've been doing it, which is probably not optimal and specific
to one package format, is to lookup .ipk packages from the image
manifest, then use the .ipk control info "OE" key to find the
originating recipe.

Here's a link of this method in use in order to try and identify
license-related obligations from an image:
https://gitlab.com/exmakhina/xm_oe/-/blob/47183b74/licenses.py#L24


Hoping to help,

--
Jérôme


Richard Purdie
 

On Fri, 2021-02-26 at 14:18 +0000, Mikko Murto wrote:
Hello,

I'm developing a meta layer to save details about an image created by Yocto to an 
SPDX document ( https://github.com/doubleopen-project/meta-doubleopen).

I've encountered two issues regarding package names in IMAGE_MANIFEST 
and PACKAGES variables,  

https://github.com/doubleopen-project/meta-doubleopen/issues/2 and
https://github.com/doubleopen-project/meta-doubleopen/issues/3.

The crux of the matter is that I need to find packages created by recipes 
and to link the packages listed in image's manifest files to these packages.

First, the PACKAGES variable of all recipes doesn't seem to include all 
packages created. For example util-linux's PACKAGES doesn't include 
util-linux-sulogin, but util-linux-sulogin may be included in an image's 
manifest and it has a directory in the packages-split directory of util-linux. 
What would be the correct way to get information about all packages?

Second, the package names in the image manifest may differ from those in 
the PACKAGES variable or in packages-split directory. As an example, a
manifest file may include libkmod2, but recipe for kmod creates package 
named libkmod. How to make the link from libkmod2 to libkmod?
I'd suggesting looking at packagedata which is how do_package and friends 
internally looks up things like which recipe provides which package and 
what the final package name is.

An example of this in action is scripts/oe-pkgdata-util.

There is also meta/lib/oe/packagedata.py. Sadly the API is horrible, it
was never really designed for "public" use but I would love to see a better
API around that (maybe one oe-pkgdata-util could use too).

Cheers,

Richard