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