Bug 9320

Summary: [meta-swupd] Inconsistency in bundles when bundles add alternatives with a higher priority
Product: [Build System, Metadata & Runtime] Other YP Layers Reporter: Joshua Lock <joshuagloe>
Component: layersAssignee: Joshua Lock <joshuagloe>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium+ CC: poky.bs.watcher, poky.watcher
Version: 2.1   
Target Milestone: 2.1 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Joshua Lock 2016-03-22 12:14:14 UTC
If a bundle adds a package which pulls in an alternative with a higher priority than the one in the base image (i.e. coreutils takes precedence over busybox) we end up with a situation where the base image contains the symlink to the higher priority binary, but not the binaries themselves.

We must at least warn the user when this situation arises and ideally take steps to prevent it.
Comment 1 Joshua Lock 2016-04-01 15:56:35 UTC
For a bit more detail on why this is important I'm copying in some text from an ostro-devel thread[1]:

"a key concept of Clear Linux and swupd that the "os-core" is immutable. I picked "passwd" as example because Arjan made it clear earlier that all system users that any bundle may expect to have on the system must already be define in the os-core, whether the bundle that needs the user is installed or not.

That's a feature, not a bug, because software can rely on os-core not changing under it.

Concepts like "update-alternatives" where key components of the os-core like the /bin/sh link change depending on which software is installed are not currently supported by swupd. Such a concept could be introduced, but that would weaken the concept of the "immutable os-core"."

1. https://lists.ostroproject.org/pipermail/ostro-dev/2016-March/000260.html
Comment 2 Joshua Lock 2016-04-13 21:08:28 UTC
We've implemented an image-level QA check to help detect this issue which can be enabled by adding swupd_check_dangling_symlinks to SWUPD_IMAGE_SANITY_CHECKS:

SWUPD_IMAGE_SANITY_CHECKS += " \
     swupd_check_dangling_symlinks \
"

http://git.yoctoproject.org/cgit/cgit.cgi/meta-swupd/commit/?id=9ffc69b4954f9fb21b9572a0599f685242a941d9

We hope that the core mechanism for implementing image-level QA checks will be provided by OE-Core in the 2.2 cycle, see: https://bugzilla.yoctoproject.org/show_bug.cgi?id=9448