<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>2638</bug_id>
          
          <creation_ts>2012-06-20 18:17:03 +0000</creation_ts>
          <short_desc>errors while running license_create_manifest - searching for files in ${TMPDIR}/pkgdata/*/runtime</short_desc>
          <delta_ts>2012-07-31 08:58:53 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>(autobuilder)</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.3 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andrei Gherzan">andrei</reporter>
          <assigned_to name="Andrei Gherzan">andrei</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>elizabeth.flanagan</cc>
    
    <cc>florin.sarbu</cc>
    
    <cc>laurentiu.serban</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>ross.burton</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>22437</commentid>
    <comment_count>0</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-06-20 18:17:03 +0000</bug_when>
    <thetext>While creating an image the do_rootfs log contains a lot of errors like warnings like these:

[...]
ls: cannot access /media/HDD-WRS/Projects/Yocto/2012-06-19-14-46-vea9-excalibur/tmp-eglibc-eglibc/pkgdata/*/runtime/libasound2: No such file or directory                                                                                    
ls: cannot access /media/HDD-WRS/Projects/Yocto/2012-06-19-14-46-vea9-excalibur/tmp-eglibc-eglibc/pkgdata/*/runtime/libattr1: No such file or directory                                                                                      
ls: cannot access /media/HDD-WRS/Projects/Yocto/2012-06-19-14-46-vea9-excalibur/tmp-eglibc-eglibc/pkgdata/*/runtime/libblkid1: No such file or directory                                                                                     
ls: cannot access /media/HDD-WRS/Projects/Yocto/2012-06-19-14-46-vea9-excalibur/tmp-eglibc-eglibc/pkgdata/*/runtime/libc6: No such file or directory                                                                                         
ls: cannot access /media/HDD-WRS/Projects/Yocto/2012-06-19-14-46-vea9-excalibur/tmp-eglibc-eglibc/pkgdata/*/runtime/libcap2: No such file or directory                                                                                       
[...]

This is generated by the fact that while generating license.manifest package information is searched in:
filename=`ls ${TMPDIR}/pkgdata/*/runtime/${pkg}| head -1`

Well, this is ok as long as package name is the same as the package name after packaging - for example dbus is transformed in dbus-1. So, searching ls ${TMPDIR}/pkgdata/*/runtime/dbus-1 will fail because the searched values is the PKG_dbus value. 

I have two fixes for this.

1. One which won&apos;t impact the build time:
Patch package.bbclass to create symlinks for all packages which are packaged differently as provided in PACKAGES. For example dbus-1 will be a symlink to dbus. In this way the above line will find the correct file for every INSTALLED_PKGS.

2. One which will impact a little the do_rootfs time:
Patch license.bbclass - don&apos;t search for a specific file in license_create_manifest but search for the file name which contains the PKG_* value as iterated in INSTALLED_PACKAGES.

I have patches for both scenarios. Just need an advice.

One more thing. This issue was introduced by this commit:

commit 885e1f7e6886c783ae481afc7c08bac04843cae9
Author: Elizabeth Flanagan &lt;elizabeth.flanagan@intel.com&gt;
Date:   Wed May 30 12:01:15 2012 -0700
    license.bbclass: optimize pkg runtime data
    This fixes an ugly way I was trying to find pkg runtime
    data for package and license manifest creation.

At that time packages similar to the one exampled above were just excluded form license manifest.

I can submit patch anytime.

@g</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22438</commentid>
    <comment_count>1</comment_count>
    <who name="Beth Flanagan">elizabeth.flanagan</who>
    <bug_when>2012-06-20 18:31:04 +0000</bug_when>
    <thetext>Can you link me to the patches?

I&apos;m planning on rewriting license_create_manifest to be event driven and to just utilize the datastore values it has during do_install which will remove the need to search for the package name. ETA on this is by the end of M2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22439</commentid>
    <comment_count>2</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-06-20 18:36:24 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Can you link me to the patches?
&gt; 
&gt; I&apos;m planning on rewriting license_create_manifest to be event driven and to
&gt; just utilize the datastore values it has during do_install which will remove
&gt; the need to search for the package name. ETA on this is by the end of M2.

Patches are as simple as this:

1 solution:
Add in emit_pkgdata from packages.bbappend while generation pkgdata:
pkgval = d.getVar(&apos;PKG_%s&apos; % (pkg), True)                                                                                                                                                                                    
&lt;------&gt;&lt;------&gt;if pkgval != pkg:                                                                                                                                                                                                            
&lt;------&gt;&lt;------&gt;&lt;------&gt;subdata_sym = pkgdatadir + &quot;/runtime/%s&quot; % pkgval                                                                                                                                                                    
&lt;------&gt;&lt;------&gt;&lt;------&gt;os.symlink(pkg,subdata_sym)

2 solution:
Replace
filename=`ls ${TMPDIR}/pkgdata/*/runtime/${pkg}| head -1`
with
filename=`grep -lr &quot;^PKG_.*${pkg}$&quot; ${TMPDIR}/pkgdata/*/runtime/*`

This could be a good idea until your work is finished.

@g</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22440</commentid>
    <comment_count>3</comment_count>
    <who name="Beth Flanagan">elizabeth.flanagan</who>
    <bug_when>2012-06-20 18:47:53 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; (In reply to comment #1)
&gt; &gt; Can you link me to the patches?
&gt; &gt; 
&gt; &gt; I&apos;m planning on rewriting license_create_manifest to be event driven and to
&gt; &gt; just utilize the datastore values it has during do_install which will remove
&gt; &gt; the need to search for the package name. ETA on this is by the end of M2.
&gt; 
&gt; Patches are as simple as this:
&gt; 
&gt; 1 solution:
&gt; Add in emit_pkgdata from packages.bbappend while generation pkgdata:
&gt; pkgval = d.getVar(&apos;PKG_%s&apos; % (pkg), True)                                   
&gt; 
&gt; &lt;------&gt;&lt;------&gt;if pkgval != pkg:                                           
&gt; 
&gt; &lt;------&gt;&lt;------&gt;&lt;------&gt;subdata_sym = pkgdatadir + &quot;/runtime/%s&quot; % pkgval   
&gt; 
&gt; &lt;------&gt;&lt;------&gt;&lt;------&gt;os.symlink(pkg,subdata_sym)
&gt; 
&gt; 2 solution:
&gt; Replace
&gt; filename=`ls ${TMPDIR}/pkgdata/*/runtime/${pkg}| head -1`
&gt; with
&gt; filename=`grep -lr &quot;^PKG_.*${pkg}$&quot; ${TMPDIR}/pkgdata/*/runtime/*`
&gt; 
&gt; This could be a good idea until your work is finished.
&gt; 
&gt; @g

Yeah, I can see the utility here for 1. Number 2 I&apos;m less enthusiastic about as I&apos;d like this to effect do_rootfs time as little as possible. Let me test out 1 later this week so I can see what the implications are. It should be ok, but I like treading lightly around package.bbclass.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22441</commentid>
    <comment_count>4</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-06-20 18:49:58 +0000</bug_when>
    <thetext>Ok. Waiting for feedback and i will submit patch.

@g</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22543</commentid>
    <comment_count>5</comment_count>
    <who name="Beth Flanagan">elizabeth.flanagan</who>
    <bug_when>2012-06-25 15:27:39 +0000</bug_when>
    <thetext>Ok, I looked at this a bit and the more I think about it, the more I think #1 is the right answer here. So, yes, ACK.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22655</commentid>
    <comment_count>6</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-06-28 08:20:56 +0000</bug_when>
    <thetext>Patch submitted.
http://lists.linuxtogo.org/pipermail/openembedded-core/2012-June/024551.html

@g</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22865</commentid>
    <comment_count>7</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-07-06 10:05:11 +0000</bug_when>
    <thetext>@Saul Ping on this. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23264</commentid>
    <comment_count>8</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2012-07-19 14:37:45 +0000</bug_when>
    <thetext>*** Bug 2784 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23406</commentid>
    <comment_count>9</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-07-23 21:47:47 +0000</bug_when>
    <thetext>I&apos;ve posted a new version of Andrei&apos;s patch with the feedback addressed as part of the rootfs rework patchset. Sorry to rush on this but I needed the fix so I could do my own reverse pkgdata lookups.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23460</commentid>
    <comment_count>10</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-07-24 20:39:48 +0000</bug_when>
    <thetext>Sorry for my late reply on this but i was on a mini-vacation.

No worries Paul. I will try to find your fix in my 400 emails... Could you pass me a copy please?

ag</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23461</commentid>
    <comment_count>11</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-07-24 20:42:58 +0000</bug_when>
    <thetext>Sure, here it is:

http://patchwork.openembedded.org/patch/32871/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23500</commentid>
    <comment_count>12</comment_count>
    <who name="Andrei Gherzan">andrei</who>
    <bug_when>2012-07-25 18:12:06 +0000</bug_when>
    <thetext>Acked.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23529</commentid>
    <comment_count>13</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2012-07-26 15:09:01 +0000</bug_when>
    <thetext>Merged to master in revision 5334a93d261598757ccce48a78b8ba2b7e5806f3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23635</commentid>
    <comment_count>14</comment_count>
    <who name="Laurentiu Serban">laurentiu.serban</who>
    <bug_when>2012-07-31 08:58:53 +0000</bug_when>
    <thetext>I could not reproduce this issue with commit fb53d69d9c726e6a663ea276cc440676e20f8326 so setting to Verified</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>