package.bbclass: Improve shlibs needed data structure

Improve the shlibs 'needed' data structure to include the file and
any rpath information. This allows various cleanups to the data structure
and moves us closer to being able to resolve shlibs providers issues
based on path in due course.

This commit doesn't change any stored data, just cleans up internal data
structures (for example dropping the needed_from dict).

(From OE-Core rev: d3aa7668a9f001044d0a0f1ba2de425a36056102)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
package.bbclass: Rewrite sonames data structure to include library path

In order to do more advanced processing of the shared libraries, we need
to know where a given library is located on disk so we can know whether
its a system path or a private directory for example.

This patch adds this information into the 'sonames' data structure.

(From OE-Core rev: 5f48d53c5ed94b5c6aad9f73ff177aa35af90397)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
package.bbclass: Improve shlibs pkgdata file format

Instead of having a .list file and a .ver file, place the version
information into the .list file in a ":" delimited string.

Also place the path to the library here, this can then be used to
evaluate RPATHs in the shlib dependency code.

Since the disk format has changed, the easiest way to avoid build
failures in the same TMPDIR is to change the shlibs directory to
shlibs2. sstate dependency code with ensure everything rebuilds.

(From OE-Core rev: 8dd09b3ddc572a338b4a6f1d859b68b2b4482d00)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
package.bbclass: Rewrite shlib_provider handling to include RPATH

Change the do_package shlibs code to account for RPATHS. This means that
for library dependency purposes, only libraries in system paths or in
any declared RPATH will be seen. This is important to resolve problems
people have been having where similarly named libraries in "private"
paths were conflicting, e.g. with gstreamer.

For now this code assumes the default search path is libdir and
base_libdir and places ASSUME_SHLIBS in libdir so they are searched by
default.

(From OE-Core rev: 48b9ecd5335f63fb2bcc47c4b23d067122734fe9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
insane: Split do_package_qa into a separate task (from do_package)

Its possible to run the package QA checks as a separate task rather than
as part of the do_package task. This offers more parallelism but the
fact that made me propose this is that ideally we'd like to access
pkgdata to help add new tests and to do that, we need to run later in
the task list. We also need to add in RDEPENDS to the task which apply
to do_package_write_* but not do_package. See the subsequent patches
for why this is desireable.

If we split into a separate task, we need to add in calls to read
the sub package data, build the cache structure used by do_package and
cover the task with sstate (which is empty and just acts as a stamp
saying it passed package QA). We also need to handle our own
dependencies.

(From OE-Core rev: d31f75a72cb2322f753d945da86d5f3287eef06b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
package.bbclass: Generate runtime-rprovides data

Currently, given a list of rdepends its near impossible to figure out
which ones are potentially invalid and which might be an RPROVIDES of a
package.

This problem is simple to solve, we can write lookup data into the
pkgdata. This patch does that, accounting for the fact that multiple
packages can RPROVIDE the same thing (particularly with locales). Its
done with symlinks so the performance overhead is minimal.

(From OE-Core rev: 30b4bff944c4625696e9be97ce4912a2710d13e9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
gzip: move uncompress bin to avoid cross-fs link

(From OE-Core rev: 16aa94e4543fc6e6540b203bc716e6f275f514c7)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
kernel.bbclass: update KERNEL_IMAGE_MAXSIZE

* Make KERNEL_IMAGE_MAXSIZE and IMAGE_ROOTFS_SIZE have the same algorithm:
  - Use Kbytes as the unit since we use this in other codes.
  - Use "du" rather than "ls" to figure out the size since we use this in
    image.py.

[YOCTO #2610]

(From OE-Core rev: 7384d2831c713ac5999aca83c312154dc15cec56)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
base-passwd: install passwd and group atomically

Fixed the race issue:
util-macros.do_package failed: 'getpwnam(): name not found: root'

The error happens when there is a half etc/passwd, fixed by:
$ install usr/share/base-passwd/passwd.master etc/passwd.master
$ mv etc/passwd.master etc/passwd

The "mv" is atomic which will fix this problem.

[YOCTO #6124]

(From OE-Core rev: cdbe55215e3dd1b82a6c147a31c7c40186a8bf80)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
init-install.sh: Verify /sys based files exist before displaying them

Some mmc cards do not have all the data files in /sys/block
populated.  Check for existence before displaying the files
to avoid erroring out of the install process.

(From OE-Core rev: 1d73e3f9d9977382efdb0c111c556c6048bd60b4)

Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
cogl-1.0: update to 1.18.2

Announcement:
http://lists.freedesktop.org/archives/cogl/2014-July/001689.html

(From OE-Core rev: 2c7882cf1d73f26204685729a495771b75cf4f87)

Signed-off-by: Tim Orling <TicoTimo@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
weston: make webp explicitly configurable

This patch fixes:
    weston/weston/latest lost dependency on  libwebp
    weston/weston-examples/latest lost dependency on  libwebp
from:
http://lists.openembedded.org/pipermail/openembedded-core/2014-June/093704.html

(From OE-Core rev: f688ab0b8c3c1842d60cc2e18ac17af1f901f7b9)

Signed-off-by: Tim Orling <TicoTimo@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
builder: removed setting of BB_NUMBER_THREADS and PARALLEL_MAKE

This values are now adjusted automatically, based on underlying
hardware CPU cores count, so no need to enable manually.

(From OE-Core rev: 548f51122900ba600030005b888053bdf009fa31)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
gcc: Ensure c++ includes are in /usr/include/c++/${BINV}

It was observed that code using STLport 4.6 fails to compile under the
SDK with the following error message:

.../includes/cstddef:38:46: fatal error: ../4.7.2/cstddef: No such file
or directory

STLport 4.6 (screwily) assumes that the C++ system headers live in a
gcc-versioned subdirectory, for gcc>=3.0; cf
http://sourceforge.net/p/stlport/code/ci/STLport-4.6-patch/tree/stlport/config/stl_gcc.h#l269.

This assumption is *almost always* valid, because that matches the
default setting of --with-gxx-include-dir. We can match that behavior by
appending "/${BINV}" to our own --with-gxx-include-dir settings.

Natinst-CAR-ID: 446449
Natinst-Reviewboard-ID: 57209
Acked-by: Ken Sharp <ken.sharp@ni.com>
Acked-by: Ben Shelton <ben.shelton@ni.com>
(From OE-Core rev: 5a2ff3e8f7cd7a47a5ab4e581847ecc4df87fca3)

Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
init-install-efi.sh: fix to handle the boot partition correctly

(This patch was originally done against init-install.sh in
OE-Core rev aa67b1333b4774e1845f562085f7048df65a644f)

Previously, the boot partition was created for the target hard drive
but there was no corresponding entry for it in /etc/fstab. Besides,
even if the boot partition was mounted, it would just result in odd
directory hierarchy like /boot/boot/grub. However, what we really need
is /boot/grub. This patch fixes this problem.

Besides, for future maintance work, this patch also renames some of the
intermediate directories. It uses more descriptive names like /tgt_root
and /src_root. The name of /ssd is dropped.

(From OE-Core rev: 3b1bae7ad8d36930aae840175c6a3433c1469772)

Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
init-install-efi.sh: improve hard drive searching process

(This patch was originally done against init-install.sh in
OE-Core rev 358f0584d779825307eec08c023b5ff14e72cf9e)

Previously, only unremovable hard drives are searched and are treated
as candidates of target disks to intall into.

However, it's possible that we're going to install the live image into
a removable media such as an USB. This patch enables this possibility.

In addition, this patch presents more information about the hard drives
so that user may have more knowledge about which hard drive they are
going to install their image into.

(From OE-Core rev: 7386acf4ab63a5959e4907b29459b767f2bf2fdb)

Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bootimg.bbclass: Add parameter to specify HDDIMG volume ID

Users and children of the bootimg class may need to specify at build
time the volume ID of the HDDIMG vfat partition. An example of this
may be when at runtime the partition is uniquely identified by
the volume ID.

The HDDIMG_ID is expected to be provided externally. If the variable
is not set, mkdosfs will use the default volume-id.

(From OE-Core rev: 869a5c07f0ecc21b8cfbd239e901a9a4501ef087)

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
package.bbclass: add a stub implementation of package_name_hook

do_package() calls package_name_hook so that e.g. debian-style renaming through
debian.bbclass can happen.  If there is no class providing a package_name_hook
then this causes "WARNING: Function package_name_hook doesn't exist" every time
do_package() is executed.

Silence this warning by providing an empty package_name_hook in package.bbclass.

(From OE-Core rev: f6eb8e4e44b66217e4ada9f830a058c5ba120932)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Move boot media to /media/realroot for easy access after boot.

There are cases where software after boot may need to know the
current boot disk.  Under the current system, it is not guaranteed
which disk is the boot.  While /media/sda is a good guess, it
isn't always right, nor is it a good assumption that only one boot
disk is in the system.  This gives a standard path to the original
boot disk mount which can be used to, for instance, update the
syslinux file on the boot media with a newer kernel, or updating
the boot parameters to add user options for future boots.  Knowing
which disk is the boot media keeps from updating the non-boot
disk when for instance multiple syslinux boot medias are plugged in
(ie ensure correct syslinux is updated when the booted system is
updated).

(From OE-Core rev: 2be3b2607fd164d18498299dbfc020ff17dd2ca9)

Signed-off-by: Brian Lloyd <blloyd@familyhonor.net>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
libpcap: fix depends on libnl

Fixed:
* libnl1 -> libnl
* Remove libnl from DEPENDS since we are using PACKAGECONFIG, the
  libnl in the DEPENDS didn't affect libpcap since the --without-libnl
  took effect before this patch, so it is safe to remove it.

(From OE-Core rev: f8abe9fe6e3c371d07711378c0fbfb4fad7eed81)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>