<?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>10916</bug_id>
          
          <creation_ts>2017-01-12 10:31:46 +0000</creation_ts>
          <short_desc>lib/oe/rootfs: alternative symlinks not reliably removed</short_desc>
          <delta_ts>2017-01-18 16:11:46 +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>deployment</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></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="André Draszik">byo</reporter>
          <assigned_to name="André Draszik">byo</assigned_to>
          <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69744</commentid>
    <comment_count>0</comment_count>
    <who name="André Draszik">byo</who>
    <bug_when>2017-01-12 10:31:46 +0000</bug_when>
    <thetext>When removing unneeded packages from a (read-only) rootfs
during rootfs creation, alternative symlinks from those
packages may or may not be removed.

The reason is as follows:

update-alternatives(-native) is used during package
installation as part of the image creation. It uses
a database which contains entries for all the
alternative symlinks possible, and the -native version
uses the target&apos;s database by means of $OPKG_OFFLINE_ROOT,
i.e. the rootfs we&apos;re in the process of creating.

Once the rootfs has been created, OE removes certain
packages because we have a read-only rootfs - in
particular ROOTFS_RO_UNNEEDED which includes
VIRTUAL-RUNTIME_update-alternatives, i.e. the
update-alternatives. Recently, a change was made in
OE, where uninstallation of update-alternatives from the
rootfs causes removal of its database, too, to save space
(700KiB (uncompressed) in a busybox system)
  b24a63d71b517af701dfedbc7f7b541d25af708f
  http://git.openembedded.org/openembedded-core/commit/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb?id=b24a63d71b517af701dfedbc7f7b541d25af708f

Following from that, if update-alternatives is removed
from the target file system, update-alternatives-native
has no database anymore, meaning it can&apos;t manage any of
the alternative symlinks anymore.

Because the order of packages to uninstall is
non-deterministic, and update-alternatives could well
be removed before any packages that use the mechanism
provided, sometimes the extra symlinks are removed,
sometimes not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69746</commentid>
    <comment_count>1</comment_count>
    <who name="André Draszik">byo</who>
    <bug_when>2017-01-12 10:37:55 +0000</bug_when>
    <thetext>patch submitted http://lists.openembedded.org/pipermail/openembedded-core/2017-January/131021.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69880</commentid>
    <comment_count>2</comment_count>
    <who name="André Draszik">byo</who>
    <bug_when>2017-01-18 10:46:23 +0000</bug_when>
    <thetext>I&apos;m not sure why I&apos;m the assignee here, but my suggested patch has been merged into master http://git.openembedded.org/openembedded-core/commit/?id=5263dd3eac9d9fbdb7ef654d0cd532c192baed16

I&apos;m not sure about the bugzilla process you use, so reassigning</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69883</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-01-18 11:28:31 +0000</bug_when>
    <thetext>You were the assignee as you wrote the patch. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69886</commentid>
    <comment_count>4</comment_count>
    <who name="André Draszik">byo</who>
    <bug_when>2017-01-18 12:27:01 +0000</bug_when>
    <thetext>OK, thanks Ross. What about the (origin) &apos;in review&apos; status. I shouldn&apos;t be reviewing my own patches, I think?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69887</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-01-18 12:30:36 +0000</bug_when>
    <thetext>It was assigned to you as you submitted the patch.  In review status means the patch is on the list being reviewed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>