All of lore.kernel.org
 help / color / mirror / Atom feed
* Image introspection
@ 2019-03-29  8:50 Dimitris Tassopoulos
  2019-03-29  8:59 ` Mikko.Rapeli
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Dimitris Tassopoulos @ 2019-03-29  8:50 UTC (permalink / raw)
  To: Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 5188 bytes --]

Hi all,

I was thinking that the mail list shouldn't be only for problems and
questions and that from time to time, it would be nice to see some guides,
tutorials or success stories from people that follow the list.

Anyway, a few days ago someone had an issue with one of the BSPs I'm
maintaining and I wrote him a small guide on how to -try- to resolve future
issues like that. Then I thought that I haven't found a small tutorial
like this. Maybe it already exists, but nevertheless I haven't seen it.
Of course, those things are in the documentation, but they are documented
as individual tools (which is the correct thing to do), but it's not very
clear how to use all those things together to perform more complex tasks.

So, in my case the issue was that ofono was installed in the image and that
needed to be removed. Probably a lot of you already know the answer but for
me that I've never bothered with that I had to track it down how it got in
there.

Everything from now on assumes that you've setup up your bitbake environment
of your build with whatever setup scripts you're using (e.g.
*oe-init-build-env*)

There are several ways to do introspection on an image. For example,
let's say that you found a file in the in rootfs and you want to know which
recipe added that file. Then you can use this command:

oe-pkgdata-util find-path /usr/sbin/ofonod


*oe-pkgdata-util* is a utility in *poky/scripts/oe-pkgdata-util* and
`find-path` is pretty obvious what it does. This will return:

ofono: /usr/sbin/ofonod


So now you know that it's indeed the *ofono* recipe that adds this file.
Next,
you need how this did get in the image (probably some other dependency
because you didn't). Then you can use the `-g` parameter with bitbake like
this:

bitbake -g allwinner-image


This will create a file called `recipe-depends.dot`. This is a dot file that
has all the dependencies in the image. You can use the same command to get
the dependencies for a recipe, but now we care about the image.

Next step is to search in that file, why that key is there. Why is `-w` and
key is `-k`. You can always remember this as "-w-hy that -k-ey is there?"
and you
run this command:

oe-depends-dot -k ofono -w recipe-depends.dot


This will return the recipe that has this as dependency.


> Because: allwinner-image packagegroup-base


That means that the key is there because of allwinner-image (this is the
image
recipe, but it can be any other image) and because the *allwinner-image*
inherits the
*packagegroup-base*. So this packagegroup is the guilty.

Let's find this thing now. Get in the meta layer sources folder and run this

find . | grep packagegroup-base


This will return

> ./poky/meta/recipes-core/packagegroups/packagegroup-base.bb


Great. Open this file to an editor and find where is *ofono*. Gotcha, is in:

RDEPENDS_packagegroup-base-3g


Then it's the *packagegroup-base-3g* that does that. Probably that's a
recipe
or package group file, so you can run:

find . | grep packagegroup-base-3g


But you get nothing... Then probably this is declared somewhere a file with
another name, so let's search inside the files in the poky layer:

grep -nriI ackagegroup-base-3g


And we get:

poky/meta/recipes-core/packagegroups/packagegroup-base.bb:35:
> ${@bb.utils.contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g", "",
> d)} \
> poky/meta/recipes-core/packagegroups/packagegroup-base.bb:73:
> ${@bb.utils.contains('COMBINED_FEATURES', '3g', 'packagegroup-base-3g',
> '',d)} \
> poky/meta/recipes-core/packagegroups/packagegroup-base.bb:122:
> d.setVar("ADD_3G", "packagegroup-base-3g")
> poky/meta/recipes-core/packagegroups/packagegroup-base.bb:316:SUMMARY_packagegroup-base-3g
> = "Cellular data support"
> poky/meta/recipes-core/packagegroups/packagegroup-base.bb:317:RDEPENDS_packagegroup-base-3g
> = "\
> poky/meta/recipes-core/packagegroups/packagegroup-base.bb:320:RRECOMMENDS_packagegroup-base-3g
> = "\



So it's actually in the same file that we already opened. Here you can
facepalm,
but we didn't know that, so this would be the procedure anyways to track it
down.
Now, search for *packagegroup-base-3g* inside the
*poky/meta/recipes-core/packagegroups/packagegroup-base.bb
<http://packagegroup-base.bb>*
and you see this line:

${@bb.utils.contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g", "",
> d)} \


Therefore the *3g* in the *DISTRO_FEATURES* actually added *ofono*. That
means that,
we need to remove the *3g* string from our *DISTRO_FEATURES*.

To do that, add this to your build/conf/local.conf file

DISTRO_FEATURES_remove = " 3g"


Now just to be sure, run this to clean *ofono* from cache and everywhere
else:

bitbake -c cleanall ofono


And then rebuild the image:

bitbake image-name


Now you'll see that *ofono* won't b e downloaded or get built and it won't
be in your image.

I hope the above guide helps a bit.

I would be glad to get better suggestions or other people experience on
how they introspect their images and solve related issues.

Regards,
Dimitris

[-- Attachment #2: Type: text/html, Size: 8771 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Image introspection
  2019-03-29  8:50 Image introspection Dimitris Tassopoulos
@ 2019-03-29  8:59 ` Mikko.Rapeli
  2019-03-29  9:05   ` Dimitris Tassopoulos
  2019-03-29  9:37 ` Alexander Kanavin
  2019-03-29 15:35 ` Scott Rifenbark
  2 siblings, 1 reply; 9+ messages in thread
From: Mikko.Rapeli @ 2019-03-29  8:59 UTC (permalink / raw)
  To: dimtass; +Cc: yocto

On Fri, Mar 29, 2019 at 09:50:20AM +0100, Dimitris Tassopoulos wrote:
> Hi all,
> 
> I was thinking that the mail list shouldn't be only for problems and
> questions and that from time to time, it would be nice to see some guides,
> tutorials or success stories from people that follow the list.
> 
> Anyway, a few days ago someone had an issue with one of the BSPs I'm
> maintaining and I wrote him a small guide on how to -try- to resolve future
> issues like that. Then I thought that I haven't found a small tutorial
> like this. Maybe it already exists, but nevertheless I haven't seen it.
> Of course, those things are in the documentation, but they are documented
> as individual tools (which is the correct thing to do), but it's not very
> clear how to use all those things together to perform more complex tasks.
> 
> So, in my case the issue was that ofono was installed in the image and that
> needed to be removed. Probably a lot of you already know the answer but for
> me that I've never bothered with that I had to track it down how it got in
> there.
> 
> Everything from now on assumes that you've setup up your bitbake environment
> of your build with whatever setup scripts you're using (e.g.
> *oe-init-build-env*)
> 
> There are several ways to do introspection on an image. For example,
> let's say that you found a file in the in rootfs and you want to know which
> recipe added that file. Then you can use this command:
> 
> oe-pkgdata-util find-path /usr/sbin/ofonod
> 
> 
> *oe-pkgdata-util* is a utility in *poky/scripts/oe-pkgdata-util* and
> `find-path` is pretty obvious what it does. This will return:
> 
> ofono: /usr/sbin/ofonod
> 
> 
> So now you know that it's indeed the *ofono* recipe that adds this file.
> Next,
> you need how this did get in the image (probably some other dependency
> because you didn't). Then you can use the `-g` parameter with bitbake like
> this:
> 
> bitbake -g allwinner-image
> 
> 
> This will create a file called `recipe-depends.dot`. This is a dot file that
> has all the dependencies in the image. You can use the same command to get
> the dependencies for a recipe, but now we care about the image.
> 
> Next step is to search in that file, why that key is there. Why is `-w` and
> key is `-k`. You can always remember this as "-w-hy that -k-ey is there?"
> and you
> run this command:
> 
> oe-depends-dot -k ofono -w recipe-depends.dot
> 
> 
> This will return the recipe that has this as dependency.
> 
> 
> > Because: allwinner-image packagegroup-base
> 
> 
> That means that the key is there because of allwinner-image (this is the
> image
> recipe, but it can be any other image) and because the *allwinner-image*
> inherits the
> *packagegroup-base*. So this packagegroup is the guilty.
> 
> Let's find this thing now. Get in the meta layer sources folder and run this
> 
> find . | grep packagegroup-base
> 
> 
> This will return
> 
> > ./poky/meta/recipes-core/packagegroups/packagegroup-base.bb
> 
> 
> Great. Open this file to an editor and find where is *ofono*. Gotcha, is in:
> 
> RDEPENDS_packagegroup-base-3g
> 
> 
> Then it's the *packagegroup-base-3g* that does that. Probably that's a
> recipe
> or package group file, so you can run:
> 
> find . | grep packagegroup-base-3g
> 
> 
> But you get nothing... Then probably this is declared somewhere a file with
> another name, so let's search inside the files in the poky layer:
> 
> grep -nriI ackagegroup-base-3g
> 
> 
> And we get:
> 
> poky/meta/recipes-core/packagegroups/packagegroup-base.bb:35:
> > ${@bb.utils.contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g", "",
> > d)} \
> > poky/meta/recipes-core/packagegroups/packagegroup-base.bb:73:
> > ${@bb.utils.contains('COMBINED_FEATURES', '3g', 'packagegroup-base-3g',
> > '',d)} \
> > poky/meta/recipes-core/packagegroups/packagegroup-base.bb:122:
> > d.setVar("ADD_3G", "packagegroup-base-3g")
> > poky/meta/recipes-core/packagegroups/packagegroup-base.bb:316:SUMMARY_packagegroup-base-3g
> > = "Cellular data support"
> > poky/meta/recipes-core/packagegroups/packagegroup-base.bb:317:RDEPENDS_packagegroup-base-3g
> > = "\
> > poky/meta/recipes-core/packagegroups/packagegroup-base.bb:320:RRECOMMENDS_packagegroup-base-3g
> > = "\
> 
> 
> 
> So it's actually in the same file that we already opened. Here you can
> facepalm,
> but we didn't know that, so this would be the procedure anyways to track it
> down.
> Now, search for *packagegroup-base-3g* inside the
> *poky/meta/recipes-core/packagegroups/packagegroup-base.bb
> <http://packagegroup-base.bb>*
> and you see this line:
> 
> ${@bb.utils.contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g", "",
> > d)} \
> 
> 
> Therefore the *3g* in the *DISTRO_FEATURES* actually added *ofono*. That
> means that,
> we need to remove the *3g* string from our *DISTRO_FEATURES*.
> 
> To do that, add this to your build/conf/local.conf file
> 
> DISTRO_FEATURES_remove = " 3g"
> 
> 
> Now just to be sure, run this to clean *ofono* from cache and everywhere
> else:
> 
> bitbake -c cleanall ofono
> 
> 
> And then rebuild the image:
> 
> bitbake image-name
> 
> 
> Now you'll see that *ofono* won't b e downloaded or get built and it won't
> be in your image.
> 
> I hope the above guide helps a bit.
> 
> I would be glad to get better suggestions or other people experience on
> how they introspect their images and solve related issues.

Thanks for this useful summary of tools.

I use buildhistory a lot. It contains recipe, binary package, image and SDK
metadata. Many of the queries and tools you mentioned can be 'git grep'ed
from buildhistory. I've added some more details to buildhistory like recipe
layer name and SRC_URI which help too. DISTRO_FEATURES and their impact
to packagegroups, image contents etc are currently missing, and they would
be nice to have.

https://www.yoctoproject.org/docs/2.7/dev-manual/dev-manual.html#maintaining-build-output-quality

Hope this helps,

-Mikko

> Regards,
> Dimitris

> -- 
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Image introspection
  2019-03-29  8:59 ` Mikko.Rapeli
@ 2019-03-29  9:05   ` Dimitris Tassopoulos
  0 siblings, 0 replies; 9+ messages in thread
From: Dimitris Tassopoulos @ 2019-03-29  9:05 UTC (permalink / raw)
  To: Mikko.Rapeli; +Cc: Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 6913 bytes --]

Hi Mikko, thanks for pointing out the buildhistory.
I need to have a look at it also as I haven't used it yet.
Also, it's very nice to see it documented so well.

Thanks!

On Fri, Mar 29, 2019 at 9:59 AM <Mikko.Rapeli@bmw.de> wrote:

> On Fri, Mar 29, 2019 at 09:50:20AM +0100, Dimitris Tassopoulos wrote:
> > Hi all,
> >
> > I was thinking that the mail list shouldn't be only for problems and
> > questions and that from time to time, it would be nice to see some
> guides,
> > tutorials or success stories from people that follow the list.
> >
> > Anyway, a few days ago someone had an issue with one of the BSPs I'm
> > maintaining and I wrote him a small guide on how to -try- to resolve
> future
> > issues like that. Then I thought that I haven't found a small tutorial
> > like this. Maybe it already exists, but nevertheless I haven't seen it.
> > Of course, those things are in the documentation, but they are documented
> > as individual tools (which is the correct thing to do), but it's not very
> > clear how to use all those things together to perform more complex tasks.
> >
> > So, in my case the issue was that ofono was installed in the image and
> that
> > needed to be removed. Probably a lot of you already know the answer but
> for
> > me that I've never bothered with that I had to track it down how it got
> in
> > there.
> >
> > Everything from now on assumes that you've setup up your bitbake
> environment
> > of your build with whatever setup scripts you're using (e.g.
> > *oe-init-build-env*)
> >
> > There are several ways to do introspection on an image. For example,
> > let's say that you found a file in the in rootfs and you want to know
> which
> > recipe added that file. Then you can use this command:
> >
> > oe-pkgdata-util find-path /usr/sbin/ofonod
> >
> >
> > *oe-pkgdata-util* is a utility in *poky/scripts/oe-pkgdata-util* and
> > `find-path` is pretty obvious what it does. This will return:
> >
> > ofono: /usr/sbin/ofonod
> >
> >
> > So now you know that it's indeed the *ofono* recipe that adds this file.
> > Next,
> > you need how this did get in the image (probably some other dependency
> > because you didn't). Then you can use the `-g` parameter with bitbake
> like
> > this:
> >
> > bitbake -g allwinner-image
> >
> >
> > This will create a file called `recipe-depends.dot`. This is a dot file
> that
> > has all the dependencies in the image. You can use the same command to
> get
> > the dependencies for a recipe, but now we care about the image.
> >
> > Next step is to search in that file, why that key is there. Why is `-w`
> and
> > key is `-k`. You can always remember this as "-w-hy that -k-ey is there?"
> > and you
> > run this command:
> >
> > oe-depends-dot -k ofono -w recipe-depends.dot
> >
> >
> > This will return the recipe that has this as dependency.
> >
> >
> > > Because: allwinner-image packagegroup-base
> >
> >
> > That means that the key is there because of allwinner-image (this is the
> > image
> > recipe, but it can be any other image) and because the *allwinner-image*
> > inherits the
> > *packagegroup-base*. So this packagegroup is the guilty.
> >
> > Let's find this thing now. Get in the meta layer sources folder and run
> this
> >
> > find . | grep packagegroup-base
> >
> >
> > This will return
> >
> > > ./poky/meta/recipes-core/packagegroups/packagegroup-base.bb
> >
> >
> > Great. Open this file to an editor and find where is *ofono*. Gotcha, is
> in:
> >
> > RDEPENDS_packagegroup-base-3g
> >
> >
> > Then it's the *packagegroup-base-3g* that does that. Probably that's a
> > recipe
> > or package group file, so you can run:
> >
> > find . | grep packagegroup-base-3g
> >
> >
> > But you get nothing... Then probably this is declared somewhere a file
> with
> > another name, so let's search inside the files in the poky layer:
> >
> > grep -nriI ackagegroup-base-3g
> >
> >
> > And we get:
> >
> > poky/meta/recipes-core/packagegroups/packagegroup-base.bb:35:
> > > ${@bb.utils.contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g",
> "",
> > > d)} \
> > > poky/meta/recipes-core/packagegroups/packagegroup-base.bb:73:
> > > ${@bb.utils.contains('COMBINED_FEATURES', '3g', 'packagegroup-base-3g',
> > > '',d)} \
> > > poky/meta/recipes-core/packagegroups/packagegroup-base.bb:122:
> > > d.setVar("ADD_3G", "packagegroup-base-3g")
> > > poky/meta/recipes-core/packagegroups/packagegroup-base.bb:316
> :SUMMARY_packagegroup-base-3g
> > > = "Cellular data support"
> > > poky/meta/recipes-core/packagegroups/packagegroup-base.bb:317
> :RDEPENDS_packagegroup-base-3g
> > > = "\
> > > poky/meta/recipes-core/packagegroups/packagegroup-base.bb:320
> :RRECOMMENDS_packagegroup-base-3g
> > > = "\
> >
> >
> >
> > So it's actually in the same file that we already opened. Here you can
> > facepalm,
> > but we didn't know that, so this would be the procedure anyways to track
> it
> > down.
> > Now, search for *packagegroup-base-3g* inside the
> > *poky/meta/recipes-core/packagegroups/packagegroup-base.bb
> > <http://packagegroup-base.bb>*
> > and you see this line:
> >
> > ${@bb.utils.contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g", "",
> > > d)} \
> >
> >
> > Therefore the *3g* in the *DISTRO_FEATURES* actually added *ofono*. That
> > means that,
> > we need to remove the *3g* string from our *DISTRO_FEATURES*.
> >
> > To do that, add this to your build/conf/local.conf file
> >
> > DISTRO_FEATURES_remove = " 3g"
> >
> >
> > Now just to be sure, run this to clean *ofono* from cache and everywhere
> > else:
> >
> > bitbake -c cleanall ofono
> >
> >
> > And then rebuild the image:
> >
> > bitbake image-name
> >
> >
> > Now you'll see that *ofono* won't b e downloaded or get built and it
> won't
> > be in your image.
> >
> > I hope the above guide helps a bit.
> >
> > I would be glad to get better suggestions or other people experience on
> > how they introspect their images and solve related issues.
>
> Thanks for this useful summary of tools.
>
> I use buildhistory a lot. It contains recipe, binary package, image and SDK
> metadata. Many of the queries and tools you mentioned can be 'git grep'ed
> from buildhistory. I've added some more details to buildhistory like recipe
> layer name and SRC_URI which help too. DISTRO_FEATURES and their impact
> to packagegroups, image contents etc are currently missing, and they would
> be nice to have.
>
>
> https://www.yoctoproject.org/docs/2.7/dev-manual/dev-manual.html#maintaining-build-output-quality
>
> Hope this helps,
>
> -Mikko
>
> > Regards,
> > Dimitris
>
> > --
> > _______________________________________________
> > yocto mailing list
> > yocto@yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/yocto
>

[-- Attachment #2: Type: text/html, Size: 9159 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Image introspection
  2019-03-29  8:50 Image introspection Dimitris Tassopoulos
  2019-03-29  8:59 ` Mikko.Rapeli
@ 2019-03-29  9:37 ` Alexander Kanavin
  2019-03-29  9:38   ` Alexander Kanavin
  2019-03-29 15:35 ` Scott Rifenbark
  2 siblings, 1 reply; 9+ messages in thread
From: Alexander Kanavin @ 2019-03-29  9:37 UTC (permalink / raw)
  To: Dimitris Tassopoulos; +Cc: Yocto discussion list

On Fri, 29 Mar 2019 at 09:51, Dimitris Tassopoulos <dimtass@gmail.com> wrote:

> To do that, add this to your build/conf/local.conf file
>
>> DISTRO_FEATURES_remove = " 3g"

This works around the issue after the fact. It's better to track down
where 3g is added in the first place, and adjust that.

Alex


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Image introspection
  2019-03-29  9:37 ` Alexander Kanavin
@ 2019-03-29  9:38   ` Alexander Kanavin
  2019-03-29  9:50     ` Dimitris Tassopoulos
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Kanavin @ 2019-03-29  9:38 UTC (permalink / raw)
  To: Dimitris Tassopoulos; +Cc: Yocto discussion list

You can do that using

bitbake -e <image> and looking for how DISTRO_FEATURES is formed in
the output of the command.

Alex

On Fri, 29 Mar 2019 at 10:37, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> On Fri, 29 Mar 2019 at 09:51, Dimitris Tassopoulos <dimtass@gmail.com> wrote:
>
> > To do that, add this to your build/conf/local.conf file
> >
> >> DISTRO_FEATURES_remove = " 3g"
>
> This works around the issue after the fact. It's better to track down
> where 3g is added in the first place, and adjust that.
>
> Alex


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Image introspection
  2019-03-29  9:38   ` Alexander Kanavin
@ 2019-03-29  9:50     ` Dimitris Tassopoulos
  2019-03-29  9:59       ` Alexander Kanavin
  2019-03-29 13:46       ` Philip Balister
  0 siblings, 2 replies; 9+ messages in thread
From: Dimitris Tassopoulos @ 2019-03-29  9:50 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 1137 bytes --]

Hi Alexander,

in this case the 3g is added by default from the poky distro in
the DISTRO_FEATURES_DEFAULT var in:
*meta/conf/distro/include/default-distrovars.inc*

And because the poky distro is the base distro for the image
this is inherited. Therefore it needs to be removed with the
DISTRO_FEATURES_remove unless there is another way,
which I'm not aware to easily remove/adjust without having
to create a new distro.

Regards,
Dimitris

On Fri, Mar 29, 2019 at 10:38 AM Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

> You can do that using
>
> bitbake -e <image> and looking for how DISTRO_FEATURES is formed in
> the output of the command.
>
> Alex
>
> On Fri, 29 Mar 2019 at 10:37, Alexander Kanavin <alex.kanavin@gmail.com>
> wrote:
> >
> > On Fri, 29 Mar 2019 at 09:51, Dimitris Tassopoulos <dimtass@gmail.com>
> wrote:
> >
> > > To do that, add this to your build/conf/local.conf file
> > >
> > >> DISTRO_FEATURES_remove = " 3g"
> >
> > This works around the issue after the fact. It's better to track down
> > where 3g is added in the first place, and adjust that.
> >
> > Alex
>

[-- Attachment #2: Type: text/html, Size: 1852 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Image introspection
  2019-03-29  9:50     ` Dimitris Tassopoulos
@ 2019-03-29  9:59       ` Alexander Kanavin
  2019-03-29 13:46       ` Philip Balister
  1 sibling, 0 replies; 9+ messages in thread
From: Alexander Kanavin @ 2019-03-29  9:59 UTC (permalink / raw)
  To: Dimitris Tassopoulos; +Cc: Yocto discussion list

DISTRO_FEATURES_DEFAULT is set using ?= :

DISTRO_FEATURES_DEFAULT ?= "acl alsa argp bluetooth ext2 ipv4 ipv6
irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g
nfc x11"

So you can override it by setting it using =, which is also a chance
to trim other unnecessary features.

Alex

On Fri, 29 Mar 2019 at 10:50, Dimitris Tassopoulos <dimtass@gmail.com> wrote:
>
> Hi Alexander,
>
> in this case the 3g is added by default from the poky distro in
> the DISTRO_FEATURES_DEFAULT var in:
> meta/conf/distro/include/default-distrovars.inc
>
> And because the poky distro is the base distro for the image
> this is inherited. Therefore it needs to be removed with the
> DISTRO_FEATURES_remove unless there is another way,
> which I'm not aware to easily remove/adjust without having
> to create a new distro.
>
> Regards,
> Dimitris
>
> On Fri, Mar 29, 2019 at 10:38 AM Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>>
>> You can do that using
>>
>> bitbake -e <image> and looking for how DISTRO_FEATURES is formed in
>> the output of the command.
>>
>> Alex
>>
>> On Fri, 29 Mar 2019 at 10:37, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>> >
>> > On Fri, 29 Mar 2019 at 09:51, Dimitris Tassopoulos <dimtass@gmail.com> wrote:
>> >
>> > > To do that, add this to your build/conf/local.conf file
>> > >
>> > >> DISTRO_FEATURES_remove = " 3g"
>> >
>> > This works around the issue after the fact. It's better to track down
>> > where 3g is added in the first place, and adjust that.
>> >
>> > Alex


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Image introspection
  2019-03-29  9:50     ` Dimitris Tassopoulos
  2019-03-29  9:59       ` Alexander Kanavin
@ 2019-03-29 13:46       ` Philip Balister
  1 sibling, 0 replies; 9+ messages in thread
From: Philip Balister @ 2019-03-29 13:46 UTC (permalink / raw)
  To: Dimitris Tassopoulos, Alexander Kanavin; +Cc: Yocto discussion list

On 03/29/2019 05:50 AM, Dimitris Tassopoulos wrote:
> Hi Alexander,
> 
> in this case the 3g is added by default from the poky distro in
> the DISTRO_FEATURES_DEFAULT var in:
> *meta/conf/distro/include/default-distrovars.inc*
> 
> And because the poky distro is the base distro for the image
> this is inherited. Therefore it needs to be removed with the
> DISTRO_FEATURES_remove unless there is another way,
> which I'm not aware to easily remove/adjust without having
> to create a new distro.

Tweaking poky distro features makes the end result not poky, so the best
thing to do is create your own distro.

Philip

> 
> Regards,
> Dimitris
> 
> On Fri, Mar 29, 2019 at 10:38 AM Alexander Kanavin <alex.kanavin@gmail.com>
> wrote:
> 
>> You can do that using
>>
>> bitbake -e <image> and looking for how DISTRO_FEATURES is formed in
>> the output of the command.
>>
>> Alex
>>
>> On Fri, 29 Mar 2019 at 10:37, Alexander Kanavin <alex.kanavin@gmail.com>
>> wrote:
>>>
>>> On Fri, 29 Mar 2019 at 09:51, Dimitris Tassopoulos <dimtass@gmail.com>
>> wrote:
>>>
>>>> To do that, add this to your build/conf/local.conf file
>>>>
>>>>> DISTRO_FEATURES_remove = " 3g"
>>>
>>> This works around the issue after the fact. It's better to track down
>>> where 3g is added in the first place, and adjust that.
>>>
>>> Alex
>>
> 
> 
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Image introspection
  2019-03-29  8:50 Image introspection Dimitris Tassopoulos
  2019-03-29  8:59 ` Mikko.Rapeli
  2019-03-29  9:37 ` Alexander Kanavin
@ 2019-03-29 15:35 ` Scott Rifenbark
  2 siblings, 0 replies; 9+ messages in thread
From: Scott Rifenbark @ 2019-03-29 15:35 UTC (permalink / raw)
  To: Dimitris Tassopoulos; +Cc: Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 6264 bytes --]

Hi Dimitris,

Any kind of procedures, flows, information developed that you think are
useful but not in the current YP documentation can be considered to be
added somewhere (manuals, wiki, etc.).  Is your "small tutorial" fully
captured here in your email? Or, do you have a separate document?  Any sort
of targeted task can be considered for the YP Development Tasks manual.  It
is full of various tasks that over the years have been declared important
or common.

Feel free to respond to me with any documentation suggestions/contributions
and so forth.

Scott

On Fri, Mar 29, 2019 at 1:50 AM Dimitris Tassopoulos <dimtass@gmail.com>
wrote:

> Hi all,
>
> I was thinking that the mail list shouldn't be only for problems and
> questions and that from time to time, it would be nice to see some guides,
> tutorials or success stories from people that follow the list.
>
> Anyway, a few days ago someone had an issue with one of the BSPs I'm
> maintaining and I wrote him a small guide on how to -try- to resolve future
> issues like that. Then I thought that I haven't found a small tutorial
> like this. Maybe it already exists, but nevertheless I haven't seen it.
> Of course, those things are in the documentation, but they are documented
> as individual tools (which is the correct thing to do), but it's not very
> clear how to use all those things together to perform more complex tasks.
>
> So, in my case the issue was that ofono was installed in the image and that
> needed to be removed. Probably a lot of you already know the answer but for
> me that I've never bothered with that I had to track it down how it got in
> there.
>
> Everything from now on assumes that you've setup up your bitbake
> environment
> of your build with whatever setup scripts you're using (e.g.
> *oe-init-build-env*)
>
> There are several ways to do introspection on an image. For example,
> let's say that you found a file in the in rootfs and you want to know which
> recipe added that file. Then you can use this command:
>
> oe-pkgdata-util find-path /usr/sbin/ofonod
>
>
> *oe-pkgdata-util* is a utility in *poky/scripts/oe-pkgdata-util* and
> `find-path` is pretty obvious what it does. This will return:
>
> ofono: /usr/sbin/ofonod
>
>
> So now you know that it's indeed the *ofono* recipe that adds this file.
> Next,
> you need how this did get in the image (probably some other dependency
> because you didn't). Then you can use the `-g` parameter with bitbake like
> this:
>
> bitbake -g allwinner-image
>
>
> This will create a file called `recipe-depends.dot`. This is a dot file
> that
> has all the dependencies in the image. You can use the same command to get
> the dependencies for a recipe, but now we care about the image.
>
> Next step is to search in that file, why that key is there. Why is `-w` and
> key is `-k`. You can always remember this as "-w-hy that -k-ey is there?"
> and you
> run this command:
>
> oe-depends-dot -k ofono -w recipe-depends.dot
>
>
> This will return the recipe that has this as dependency.
>
>
>> Because: allwinner-image packagegroup-base
>
>
> That means that the key is there because of allwinner-image (this is the
> image
> recipe, but it can be any other image) and because the *allwinner-image*
> inherits the
> *packagegroup-base*. So this packagegroup is the guilty.
>
> Let's find this thing now. Get in the meta layer sources folder and run
> this
>
> find . | grep packagegroup-base
>
>
> This will return
>
>> ./poky/meta/recipes-core/packagegroups/packagegroup-base.bb
>
>
> Great. Open this file to an editor and find where is *ofono*. Gotcha, is
> in:
>
> RDEPENDS_packagegroup-base-3g
>
>
> Then it's the *packagegroup-base-3g* that does that. Probably that's a
> recipe
> or package group file, so you can run:
>
> find . | grep packagegroup-base-3g
>
>
> But you get nothing... Then probably this is declared somewhere a file with
> another name, so let's search inside the files in the poky layer:
>
> grep -nriI ackagegroup-base-3g
>
>
> And we get:
>
> poky/meta/recipes-core/packagegroups/packagegroup-base.bb:35:
>> ${@bb.utils.contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g", "",
>> d)} \
>> poky/meta/recipes-core/packagegroups/packagegroup-base.bb:73:
>> ${@bb.utils.contains('COMBINED_FEATURES', '3g', 'packagegroup-base-3g',
>> '',d)} \
>> poky/meta/recipes-core/packagegroups/packagegroup-base.bb:122:
>> d.setVar("ADD_3G", "packagegroup-base-3g")
>> poky/meta/recipes-core/packagegroups/packagegroup-base.bb:316:SUMMARY_packagegroup-base-3g
>> = "Cellular data support"
>> poky/meta/recipes-core/packagegroups/packagegroup-base.bb:317:RDEPENDS_packagegroup-base-3g
>> = "\
>> poky/meta/recipes-core/packagegroups/packagegroup-base.bb:320:RRECOMMENDS_packagegroup-base-3g
>> = "\
>
>
>
> So it's actually in the same file that we already opened. Here you can
> facepalm,
> but we didn't know that, so this would be the procedure anyways to track
> it down.
> Now, search for *packagegroup-base-3g* inside the *poky/meta/recipes-core/packagegroups/packagegroup-base.bb
> <http://packagegroup-base.bb>*
> and you see this line:
>
> ${@bb.utils.contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g", "",
>> d)} \
>
>
> Therefore the *3g* in the *DISTRO_FEATURES* actually added *ofono*. That
> means that,
> we need to remove the *3g* string from our *DISTRO_FEATURES*.
>
> To do that, add this to your build/conf/local.conf file
>
> DISTRO_FEATURES_remove = " 3g"
>
>
> Now just to be sure, run this to clean *ofono* from cache and everywhere
> else:
>
> bitbake -c cleanall ofono
>
>
> And then rebuild the image:
>
> bitbake image-name
>
>
> Now you'll see that *ofono* won't b e downloaded or get built and it
> won't be in your image.
>
> I hope the above guide helps a bit.
>
> I would be glad to get better suggestions or other people experience on
> how they introspect their images and solve related issues.
>
> Regards,
> Dimitris
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>

[-- Attachment #2: Type: text/html, Size: 10201 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-03-29 15:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-29  8:50 Image introspection Dimitris Tassopoulos
2019-03-29  8:59 ` Mikko.Rapeli
2019-03-29  9:05   ` Dimitris Tassopoulos
2019-03-29  9:37 ` Alexander Kanavin
2019-03-29  9:38   ` Alexander Kanavin
2019-03-29  9:50     ` Dimitris Tassopoulos
2019-03-29  9:59       ` Alexander Kanavin
2019-03-29 13:46       ` Philip Balister
2019-03-29 15:35 ` Scott Rifenbark

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.