Bug 10916 - lib/oe/rootfs: alternative symlinks not reliably removed
Summary: lib/oe/rootfs: alternative symlinks not reliably removed
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: deployment (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: High normal
Target Milestone: 2.3 M2
Assignee: André Draszik
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-01-12 10:31 UTC by André Draszik
Modified: 2017-01-18 16:11 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description André Draszik 2017-01-12 10:31:46 UTC
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's database by means of $OPKG_OFFLINE_ROOT,
i.e. the rootfs we'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'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.
Comment 2 André Draszik 2017-01-18 10:46:23 UTC
I'm not sure why I'm the assignee here, but my suggested patch has been merged into master http://git.openembedded.org/openembedded-core/commit/?id=5263dd3eac9d9fbdb7ef654d0cd532c192baed16

I'm not sure about the bugzilla process you use, so reassigning
Comment 3 Ross Burton 2017-01-18 11:28:31 UTC
You were the assignee as you wrote the patch. :)
Comment 4 André Draszik 2017-01-18 12:27:01 UTC
OK, thanks Ross. What about the (origin) 'in review' status. I shouldn't be reviewing my own patches, I think?
Comment 5 Ross Burton 2017-01-18 12:30:36 UTC
It was assigned to you as you submitted the patch.  In review status means the patch is on the list being reviewed.