<div dir="ltr">I've sent another patch that attempts to fix the same bug in a different way ('rpm: change arch scoring items'). Please review it.<div><br></div><div>Thanks,</div><div>Bogdan</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Apr 23, 2013 at 1:11 PM, Marinescu, Bogdan A <span dir="ltr"><<a href="mailto:bogdan.a.marinescu@intel.com" target="_blank">bogdan.a.marinescu@intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I've investigated this issue further. /etc/rpm/platform is parsed in rpmrc.c/rpmPlatform. It is true that the first line of /etc/rpm/platform does not get added directly to the platform list, being passed to parseCVOG instead, but after parserCVOG ends, it is added to the platform list anyway, although indirectly (mireAppend with the result of rpmExpand). After that, it stays in the platform list and it matched on subsequent calls to rpmPlatformScore, so it definitely has an impact on the way smart chooses the platform for a package. So, with all this in mind, where is the bug here? Is it in the RPM library or we really should not add that first line to the /etc/rpm/platform file?<div>
<br></div><div>Thanks,</div><div>Bogdan</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 22, 2013 at 5:34 PM, Marinescu, Bogdan A <span dir="ltr"><<a href="mailto:bogdan.a.marinescu@intel.com" target="_blank">bogdan.a.marinescu@intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Further investigation reveals the fact that the problem is connected to the value returned by "rpm.archscore", which changes with the value of the first line of /etc/rpm/platform. I'm testing under qemux86 and editing /etc/rpm/platform by hand. I've traced the code to backends/rpm/base.py which contains the function getArchScore (which basically calls rpm.archscore). With this /etc/rpm/platform:<div>
<br></div><div>i586-poky-linux</div><div>core2-.*-linux</div><div>qemux86-.*-linux</div><div>i586-.*-linux</div><div>.......</div><div><br></div><div>I get a score of 2 for arch core2 and 1 for i586. If I remove the first line (i586-poky-linux) and rerun smart without chaning anything else, I get a score of 1 for arch core2 and a score of 3 for i586. So that line definiteley matters, which should be a bug, if I understood Mark's e-mails correctly.</div>
<div><br></div><div>Thanks,</div><div>Bogdan<br><div><br></div></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 22, 2013 at 3:00 PM, Marinescu, Bogdan A <span dir="ltr"><<a href="mailto:bogdan.a.marinescu@intel.com" target="_blank">bogdan.a.marinescu@intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>On Thu, Apr 18, 2013 at 5:46 PM, Mark Hatle <span dir="ltr"><<a href="mailto:mark.hatle@windriver.com" target="_blank">mark.hatle@windriver.com</a>></span> wrote:<br>
</div></div><div class="gmail_extra"><div class="gmail_quote"><div><div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>On 4/18/13 9:27 AM, Bogdan Marinescu wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
For some platforms (for example emenlow) the RPM installer prefers<br>
an invalid package architecture (for example i586 over core2) because<br>
/etc/rpm/platform is not properly generated (for example, i586 is<br>
listed before core2 in /etc/rpm/platform).<br>
<br>
[YOCTO #3864]<br>
<br>
Signed-off-by: Bogdan Marinescu <<a href="mailto:bogdan.a.marinescu@intel.com" target="_blank">bogdan.a.marinescu@intel.com</a>><br>
---<br>
meta/classes/package_rpm.<u></u>bbclass | 1 -<br>
1 file changed, 1 deletion(-)<br>
<br>
diff --git a/meta/classes/package_rpm.<u></u>bbclass b/meta/classes/package_rpm.<u></u>bbclass<br>
index 3a29976..1bee4b1 100644<br>
--- a/meta/classes/package_rpm.<u></u>bbclass<br>
+++ b/meta/classes/package_rpm.<u></u>bbclass<br>
@@ -276,7 +276,6 @@ package_install_internal_rpm () {<br>
# Setup base system configuration<br>
echo "Note: configuring RPM platform settings"<br>
mkdir -p ${target_rootfs}/etc/rpm/<br>
- echo "$INSTALL_PLATFORM_RPM" > ${target_rootfs}/etc/rpm/<u></u>platform<br>
</blockquote>
<br></div>
I think this is wrong. The /etc/rpm/platform file's first line is supposed to be the equivalent of: [uname -m]-vendor-os. While uname -m doesn't match our tune namings, the concept is the same. The first line simply defines the "tune" of the platform, subsequent lines define alternative names that will run on this system.<br>
<br>
The INSTALL_PLATFORM_RPM value should be the expected value for the platform as a whole, as it's the default tune value. (Default tune value is expected to be the most accurate value.<br>
<br>
Looking at the defect:<br>
<br>
i586-poky-linux<br>
emenlow-.*-linux<br>
core2-.*-linux<br>
i686-.*-linux<br>
i586-.*-linux<br>
i486-.*-linux<br>
i386-.*-linux<br>
x86-.*-linux<br>
noarch-.*-linux.*<br>
any-.*-linux.*<br>
all-.*-linux.*<br>
<br>
The default tune value for that machine was set to i586 by "something".<br>
<br>
INSTALL_PLATFORM_RPM="$(echo ${TARGET_ARCH} | tr - _)${TARGET_VENDOR}-${TARGET_<u></u>OS}"<br>
<br>
${TARGET_ARCH} is similar to the output of uname -m. The error is that this particular BSP should have returned 'core2' as the TARGET_ARCH from what I can tell.<br>
<br>
Default for TARGET_ARCH is: TARGET_ARCH = "${TUNE_ARCH}"<br>
<br>
So the TUNE_ARCH is being set to i586. So the end result is.. Is 'TUNE_ARCH' set to i586 appropriate? It probably is, because the majority of the system seems to have a limited set of expected values for TARGET_ARCH.<br>
<br>
So, perhaps the right fix is instead of using 'TARGET_ARCH' in INSTALL_PLATFORM_RPM, 'TUNE_PKGARCH_${DEFAULTTUNE}' may be more appropriate.<br>
<br>
I'd suggest trying that. (But the first line is the system architecture, following lines are alternative packages that are considered compatible.)<div><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
if [ ! -z "$INSTALL_PLATFORM_EXTRA_RPM" ]; then<br>
for pt in $INSTALL_PLATFORM_EXTRA_RPM ; do<br>
<br>
</blockquote>
<br></div></blockquote><div><br></div></div></div><div>On my qemux86 image, /etc/rpm/platform looks like this:</div><div><br></div><div><div>qemux86-.*-linux</div><div><div>i586-.*-linux</div><div>i486-.*-linux</div>
<div>
i386-.*-linux</div><div>x86-.*-linux</div><div>noarch-.*-linux.*</div><div>any-.*-linux.*</div><div>all-.*-linux.*</div><div><br></div></div><div>The first line is not fully expanded and smart seems to make the correct choice of packages in this case.</div>
<div><br></div><div>Thanks,</div><div>Bogdan</div></div><div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>
<br></div>
______________________________<u></u>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.<u></u>openembedded.org</a><br>
<a href="http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core" target="_blank">http://lists.linuxtogo.org/<u></u>cgi-bin/mailman/listinfo/<u></u>openembedded-core</a><br>
</blockquote></div></div><br></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>