<div dir="ltr"><div><div>I have taken a look at the code, and there two places that I have found so far that contain the RPROVIDES_* for each package. One is the taskdata at the bitbake level, and the other is the pkgdata directory within the sysroot for the machine&#39;s build. The taskdata seems more readily accessible in memory. However, I&#39;ve neither figured out a way to access it from the image recipe namespace, nor do I know if it&#39;s intended to be accessed at the recipe level. On the other hand, the pkgdata directory holds information about all built packages, and I&#39;ve written some code derived from packageinfo.bbclass (used in hob) that loads all the package information into memory.<br><br>For the case provided in bug 6149, the code could access the PREFERRED_PROVIDER for the missing sshd package, search the pkgdata, and then replace &#39;sshd&#39; within PACKAGE_INSTALL with &#39;dropbear&#39; as specified within RPROVIDES_dropbear = &quot;ssh sshd&quot;.<br><br></div>A problem is the inefficiency of parsing through the pkgdata files. Maybe a rewrite of IMAGE_INSTALL be done during the calculations taskdata.py instead, or maybe the name of the package rproviding the item needs to be saved and referred to during the image generation.<br><br></div><br>- Jate<br><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 14, 2015 at 5:46 AM, Richard Purdie <span dir="ltr">&lt;<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, 2015-05-13 at 18:47 -0400, Jate Sujjavanich wrote:<br>
&gt; +python rootfs_process_preferred_rproviders() {<br>
&gt; +    inst_pkgs = d.getVar(&quot;PACKAGE_INSTALL&quot;, True).split()<br>
&gt; +    pref_pkgs = list()<br>
&gt; +    for pkg in inst_pkgs:<br>
&gt; +        prefervar = d.getVar(&quot;PREFERRED_RPROVIDER_%s&quot; % pkg, True)<br>
&gt; +        if prefervar:<br>
&gt; +            inst_pkgs.remove(pkg)<br>
&gt; +            pref_pkgs.append(prefervar)<br>
&gt; +            bb.note(&quot;Selecting %s to provide %s due to<br>
&gt; PREFERRED_RPROVIDER&quot; % (prefervar, pkg))<br>
&gt; +    inst_pkgs.extend(pref_pkgs)<br>
&gt; +    d.setVar(&quot;PACKAGE_INSTALL&quot;, &#39; &#39;.join(inst_pkgs))<br>
&gt; +}<br>
&gt; +do_rootfs[prefuncs] += &quot;rootfs_process_preferred_rproviders&quot;<br>
&gt; +<br>
&gt;  # We have to delay the runtime_mapping_rename until just before<br>
&gt; rootfs runs<br>
&gt;  # otherwise, the multilib renaming could step in and squash any<br>
&gt; fixups that<br>
&gt;  # may have occurred.<br>
<br>
</span>This kind of approach to the problem basically doesn&#39;t scale. Yes, it<br>
will rewrite things in PACKAGE_INSTALL however if package A depends on<br>
package B using one of these names, the mechanism will simply not work.<br>
This will in turn generate a whole new world of bug reports with no way<br>
to really fix the problems.<br>
<br>
This is why we have other mechanisms for handling the runtime provider<br>
names, usually through parametrisation with variables so that when you<br>
rewrite an entry, *all* entries get rewritten and what the package<br>
manager sees is consistent.<br>
<br>
I would also note that in the past, bitbake once did have<br>
PREFERRED_RPROVIDER support. We dropped it as it caused problems. I<br>
suspect I would have written up some rationale for that when we did it<br>
which would be in the list archives.<br>
<br>
Cheers,<br>
<br>
Richard<br>
<br>
<br>
</blockquote></div><br></div>