<?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>1086</bug_id>
          
          <creation_ts>2011-05-18 18:31:00 +0000</creation_ts>
          <short_desc>&quot;dpkg --list&quot; shows &quot;/var/lib/dpkg/status: No such file or directory&quot;</short_desc>
          <delta_ts>2011-09-21 22:45:23 +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>OE-Core</product>
          <component>core</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>The patch is already in poky master(Sep 22, 2011)</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.1</target_milestone>
          <dependson>1070</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dexuan Cui">dexuan.cui</reporter>
          <assigned_to name="Dexuan Cui">dexuan.cui</assigned_to>
          <cc>dexuan.cui</cc>
    
    <cc>dvhart</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>sgw</cc>
    
    <cc>shane.wang</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>13890</commentid>
    <comment_count>0</comment_count>
    <who name="Dexuan Cui">dexuan.cui</who>
    <bug_when>2011-05-18 18:31:00 +0000</bug_when>
    <thetext>In target,  &quot;dpkg --list&quot; shows &quot;dpkg-query: failed to open package info file `/var/lib/dpkg/status&apos; for reading: No such file or directory&quot;

Actually the files(status and available) does exist, but not in /var/lib/dpkg/ -- they&apos;re in /var/dpkg/. &quot;ln -s /var/dpkg/{status, available} /var/lib/dpkg&quot; can resolve the issue.

grepping &apos;/var/dpkg&apos; shows there are many files(package_deb.bbclass, rootfs_deb.bbclass, populate_sdk_deb.bbclas, apt.conf,... ) in which &apos;/var/dpkg&apos; is used and /var/lib/dpkg is not used at all.

However, looks dpkg&apos;s default admindir is /var/lib/dpkg -- e.g., Ubuntu uses this.


Pasted Mark&apos;s reply in oe-core mailing list:
------------------------------------------------
I would say that /var/lib/dpkg is the &quot;correct&quot; directory to use.  This matches
the behavior on other deb bases systems.  (It also mimics other pkg managers who
place their data into /var/lib/...)

--Mark
------------------------------------------------

So looks we should fix the recipes which use /var/dpkg/.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13958</commentid>
    <comment_count>1</comment_count>
    <who name="Dexuan Cui">dexuan.cui</who>
    <bug_when>2011-05-24 00:20:44 +0000</bug_when>
    <thetext>Porting the commits of OE should fix this bug:

ommit 41e0fbf792037f249d1b8d283b3de81718887c9f
Author: Filip Zyzniewski &lt;filip.zyzniewski@gmail.com&gt;
Date:   Sun Feb 13 03:26:58 2011 +0000

    deb packages support: switch from /var/dpkg to /var/lib/dpkg

    OE generally tries to use /var/dpkg, but the change is missing
    in some places, so it is needed to move completely to one of the
    options. Keeping the dpkg&apos;s default /var/lib/dpkg causes less
    maintenance overhead for OE.

    Signed-off-by: Filip Zyzniewski &lt;filip.zyzniewski@gmail.com&gt;
    Signed-off-by: Tom Rini &lt;tom_rini@mentor.com&gt;


commit 3b801ad400951fbc722587a7cf83d40a957e5022
Author: Filip Zyzniewski &lt;filip.zyzniewski@gmail.com&gt;
Date:   Mon Feb 7 02:00:35 2011 +0000

    dpkg-native: Fix the admindir location.

    Until now the admindir was specified as $STAGING_DIR_NATIVE/var/dpkg,
    which caused update-alternatives to put alternative definitions there.
    This patch causes the definitions to be put into the host&apos;s rootfs
    during rootfs_deb_do_rootfs (when running busybox postinst for
    example).

    resulting line in Dpkg.pm: our $admindir=&quot;$ENV{D}/var/dpkg&quot;

    Signed-off-by: Filip Zyzniewski &lt;filip.zyzniewski@gmail.com&gt;
    Signed-off-by: Tom Rini &lt;tom_rini@mentor.com&gt;


ps, this commit is not related to this bug, but we should also port it to poky since I believe poky does have the same isse by my test:

commit 1659da8e9279a6e2293a69c69ee26f27f694b089
Author: Filip Zyzniewski &lt;filip.zyzniewski@gmail.com&gt;
Date:   Sun Feb 20 18:27:00 2011 +0000

    package_deb.bbclass/apt: armel architecture name for eabi systems.

    For dpkg EABI system architecture is called armel, not arm.
    Reference: http://wiki.debian.org/ArmEabiPort

    Signed-off-by: Filip Zyzniewski &lt;filip.zyzniewski@gmail.com&gt;
    Signed-off-by: Tom Rini &lt;tom_rini@mentor.com&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14144</commentid>
    <comment_count>2</comment_count>
    <who name="Dexuan Cui">dexuan.cui</who>
    <bug_when>2011-06-02 16:41:54 +0000</bug_when>
    <thetext>I&apos;ve backported the patches and testing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14855</commentid>
    <comment_count>3</comment_count>
    <who name="Dexuan Cui">dexuan.cui</who>
    <bug_when>2011-07-21 16:02:33 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; I&apos;ve backported the patches and testing.

There are 2 patches:
http://git.pokylinux.org/cgit/cgit.cgi/poky-contrib/commit/?h=dcui/stage&amp;id=93a6bbc31feecbcc0bc84d53b676b15fd17907d7

http://git.pokylinux.org/cgit/cgit.cgi/poky-contrib/commit/?h=dcui/stage&amp;id=7971e2553c89a825c3cbd954f12b719ae52bb1ef

but I can&apos;t test them due to bug 1070.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16355</commentid>
    <comment_count>4</comment_count>
    <who name="Dexuan Cui">dexuan.cui</who>
    <bug_when>2011-09-21 07:07:04 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; I&apos;ve backported the patches and testing.
&gt; There are 2 patches:
&gt; http://git.pokylinux.org/cgit/cgit.cgi/poky-contrib/commit/?h=dcui/stage&amp;id=93a6bbc31feecbcc0bc84d53b676b15fd17907d7
&gt; http://git.pokylinux.org/cgit/cgit.cgi/poky-contrib/commit/?h=dcui/stage&amp;id=7971e2553c89a825c3cbd954f12b719ae52bb1ef
&gt; but I can&apos;t test them due to bug 1070.

Fixed by 
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=23773a899be5dcb0e08762b408791c01c48d22cf</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>