populate_sdk_base: Include do_rootfs depends for do_populate_sdk

"bitbake core-image-minimal -c populate_sdk; rm tmp -rf; bitbake core-image-minimal -c populate_sdk"
breaks due to missing dependencies on things like update-rc.d. Since
we're effecitvely building a rootfs, we need all the same depends
as do_rootfs has.

The easiest was to achieve this is to simply load them. This resolves
the failure when targeting the task from sstate.

(From OE-Core rev: cdb0bcef28493edd4cad2a882fb8ba402485a2f1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
apt-native: Add missing DEPENDS on db-native and curl-native

The target recipe has these DEPENDS but the native version does not
and this can lead to none deterministic builds. Fix this.

(From OE-Core rev: 9a3240acd0ac64a257bcfd48f743fc85b6c8f449)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
populate_sdk_deb: Fix non x86_64 SDK builds

If building with SDKMACHINE=i686 and using the deb backend, populate_sdk
would fail. Its clear when looking at the options that the 32 bit values
were overwritten.

Replace this code with code similar to that used in package_deb itself.

[YOCTO #6458]

(From OE-Core rev: 2a7c6f6d3e9d1eedffb79f2347400509feed5dd7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
directfb-examples: Fix building with new autoconf

This fixes the following build error:

,----
| .../configure: line 4229: syntax error near unexpected token `DIRECTFB,'
| .../configure: line 4229: `PKG_CHECK_MODULES(DIRECTFB, directfb >= $DIRECTFB_REQUIRED_VERSION, WATER=`$PKG_CONFIG --variable=water directfb` ,'
`----

(From OE-Core rev: 3f7fcbc167c13bdaa6c12a81c7851530d72f02e0)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/oe/rootfs: Improve error message whitespace

[YOCTO #6493]

(From OE-Core rev: 91ca6b1b2e009381d8e813906654c0958eee7efc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
autoconf: remove automake patch enforcing --foreign

Since 2004 we've been carrying a patch[1] make autoreconf pass --foreign to
automake.  Presumably at the time this was due to many upstreams using
hand-coded bootstrap scripts that passed --foreign manually, but we were using
autoreconf.  These days many projects have added foreign to AM_INIT_AUTOMAKE and
use autoreconf directly, so this patch isn't as critical as it used to be.

(From OE-Core rev: 74b05bba64589da0e4439a4293559ad9670104bd)

Signed-off-by: Ross Burton <ross.burton@intel.com>

[1] oe-classic 2ab2a92eadaf2f80410d8746099f8a9b1b81ff91
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
libav: fix PACKAGECONFIG for theora and libvorbis

Switches must not be in EXTRA_OECONF anymore.

(From OE-Core rev: 251a5cc8c940f54f058588977734fd0ede664c3c)

Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
base-files: actually install 2775 dirs as 2775, not 2755

Nothing interesting to see in the git history ; appears to have
been this way since its creation.

(From OE-Core rev: f178f56f389e9640a7e80f82250129586edff20c)

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
base-files: remove strange 2775 perms from dirs like /home

Mark Hatle did the historical research into why this was so,
and found that it originally was via debian import, and then
it morphed over time:

<fray> +#   chown -R root:root ${D}
<fray> +#   cd ${D} && chown root:src     usr/src
<fray> +#   cd ${D} && chown root:staff   var/local
<fray> +#   cd ${D} && chown root:staff   home
<fray> +    cd ${D} && chmod 755  `find . -type d`
<fray> +    cd ${D} && chmod 1777 `cat ${S}/debian/1777-dirs`
<fray> +    cd ${D} && chmod 2775 `cat ${S}/debian/2775-dirs`
<fray> that was the original code
<fray> so THAT is why they're 2775..
<fray> they were original 'src' and 'staff'.. which has gotten lost
      sometime in the last 10 years

<fray> AND the origin:
<fray> commit b45c9ed40bb4f893f99127a21776aef3ae888ad7
<fray> Author: Chris Larson <clarson@kergoth.com>
<fray> Date:   Tue Sep 30 16:30:41 2003 +0000
<fray>     Add base-files 3.0.10 (from debian).
<fray> thats where the brain damage started ... Debian in 2003..

Here we simply convert them to being normal 755 dirs.

[YOCTO #6579]

(From OE-Core rev: 77e4defa57f02b7f7ad23b07f169ec280228585b)

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
base-files: fix up misleading dir grouping names for lsb dirs

In commit b0df35f47fb79dc149504bd66d1186b3276f9510
("base-files: Add to make some directories needed by LSB.") there
were new groupings of dirs made.  But rather than keep the grouping
names permissions based as they clearly were, it seems that it was
unfortunately misinterpreted as a counter, simply incrementing as
a new group was added.

This leads to dir3755 getting chmod'd to 0755 and dir4775 being
chmod'd to 2775 which to any new reader of the code is terribly
confusing.

Choose names that clearly reflect the permissions, and add a lsb
suffix to indicate the role.

Also note that the settings for /var/mail seem incorrect, and so
they have been aligned with what is seen in most common distros.

(From OE-Core rev: 5cba414e3fd7dbe761a6f628c6a368a412c0cba3)

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
pulseaudio: fix CVE-2014-3970

The pa_rtp_recv function in modules/rtp/rtp.c in the module-rtp-recv module
in PulseAudio 5.0 and earlier allows remote attackers to cause a denial of
service (assertion failure and abort) via an empty UDP packet.

Fix it by picking a patch from pulseaudio upstream code.

(From OE-Core rev: f9d7407e54f1fa3d3a316a5bbb8b80665e6f03fd)

Signed-off-by: Shan Hai <shan.hai@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
nss: CVE-2013-5606

the patch comes from:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-5606
https://bugzilla.mozilla.org/show_bug.cgi?id=910438
http://hg.mozilla.org/projects/nss/rev/d29898e0981c

The CERT_VerifyCert function in lib/certhigh/certvfy.c in
Mozilla Network Security Services (NSS) 3.15 before 3.15.3 provides
an unexpected return value for an incompatible key-usage certificate
when the CERTVerifyLog argument is valid, which might allow remote
attackers to bypass intended access restrictions via a crafted certificate.

(From OE-Core rev: 1e153b1b21276d56144add464d592cd7b96a4ede)

Signed-off-by: Li Wang <li.wang@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
cml1: correct diffconfig output format

If used with some packages using kconfig mechanism, the diffconfig
command generates wrong output format. Diff provides all options to
format the output correctly. This method formats as intended, is more
robust and works with the merge_config.h script from yocto-kernel-tools.

(From OE-Core rev: 1d9d035f07be1cef2764949d84cecbff7dd428dd)

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
libx11: Add missing NULL check

Add a check for NULL on dereferencing the xim pointer.
Using mplayer with the x11 backend will trigger this and result
in a segfault.

(From OE-Core rev: f7d8947744d7dd1d08721ef0e707912304722d2b)

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>
selftest/buildoptions.py: fix QA_WARN test and add more output when failing

The -ccleansstate should be done before building the package for the second time.
Also printing the command output when failing.

(From OE-Core rev: 15e5661d6341004ebc4d3492acb48f73dd86b96e)

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
populate_sdk_base: Fix grep command usage on old hosts

"man grep" on centos:

       -R, -r, --recursive
              Read all files under each directory, recursively; this is equivalent to the -d recurse option.

"man grep" on a more recent ubuntu system:

       -r, --recursive
              Read all files under each directory, recursively, following symbolic links only if they are on the command line.  This
              is equivalent to the -d recurse option.

So we have an issue when the SDK installer (even with
buildtools-tarball) is used on old hosts since it may try and
dereference paths which it should not. This is caused by differences in
the behaviour of grep -r on older systems.

The fix is to wrap this in find so that only real files are found (as
elsewhere in the script.

[YOCTO #6577]

(From OE-Core rev: 7986adeac16550b33f65fded39a55f668e0e543f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
gcc-4.9.inc: fix parallel building failure

The gcc-ar.o, gcc-nm.o, gcc-ranlib.o and errors.o included
config.h which was a generated file. But no explicity rule
to clarify the dependency. There was potential building
failure while parallel make.

For gcc-ar.o, gcc-nm.o and gcc-ranlib.o, they were compiled from one C
source file gcc-ar.c, we add them to ALL_HOST_BACKEND_OBJS, so the
'$(ALL_HOST_OBJS) : | $(generated_files)' rule could work for these
objects.

For errors.o, it is part of gengtype, and the gengtype generator program
is special: Two versions are built. One is for the build machine, and one
is for the host. We refered what gengtype-parse.o did (which also is part
of gengtype).

[YOCTO #6568]

(From OE-Core rev: aea4b2d58856226c471922dfa40650cba2f5a36a)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
image-vmdk.bbclass: use sda rather than hda

The modern kernels may not support IDE (CONFIG_IDE=y), but it should
support SCSI in most of the cases. The boot-directdisk.bbclass uses
sda, too.

Remove an extra space from image-live.bbclass and image-vmdk.bbclass to
not confuse the user.

(From OE-Core rev: 842a797460cd07b779ab588a4ece7e5d4d97417b)

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>
wic: Fix plugin help text

Fix various typoes and grammar problems noticed while transcribing for
the dev manual.

(From OE-Core rev: 79fb7d9b5a28810e3adfaf5cba0c2298810253e9)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wic: Add documentation for --fsoptions

--fsoptions support was recently added to wic, so document it.

(From OE-Core rev: e2d87ad57f8aa74e748ba95f6a801a2ca665ecc4)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>