tcl-native: Depend on zlib-native

tcl can use its internal zlib. If it detects zlib during configure, then it
gets removed from the sysroot during the build (since its no in DEPENDS),
it causes build failures.

Worse, if the configure test fails to find zlib, it still appents -lz to
the other autoconf tests meaning several fail when they shouldn't. This results
in conflicts with system macros and other bizarre issues.

The easiest fix is to depend on zlib-native and make things determinstic.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
oeqa/runtime/systemd: remove race in settle()

The settle() function had a race where services could still be activating at two
minutes but then when the final log is output, they've activated.

Remove this race and generally clean up the code.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
binutils: Package additional file when using ld-is-gold

Fixes QA warnings like

WARNING: QA Issue: binutils: Files/directories were installed but not
shipped
  /usr/bin/ld.bfd
  /usr/bin/dwp

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wic: Move some common items to oe.misc

Move a couple items into a more common location since they're going to
need to be accessible from source plugins.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wic: Create and use new functions for getting bitbake variables

Add get_bitbake_var() and bitbake_env_lines() functions for use by
plugins, which will need access to them for customization.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wic: Add wic-specific bootloader subclass

Add a new wic-specific bootloader subclass so we can add a --source
param to hang non-partition plugin off of.

By default, the bootloader gets the /boot partition source plugin, but
this can be overridden by the --source bootloader param if needed.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wic: Add SourcePlugin class

Define the SourcePlugin class, which is the class that should be
subclassed to create a 'source' plugin.

'Source' plugins provide a mechanism to customize various aspects of
the image generation process in wic, mainly the contents of
partitions.

The initial version of wic defined a --source param for partitions,
which was in the first revision hard-coded to two possible values:
rootfs and bootimg.

This patch essentially removes the hard-coded --bootimg param and
replaces it with a plugin system that maps the value specified as
--source to a particular 'source' plugin instead.

A 'source' plugin is created as a subclass of SourcePlugin and the
plugin file containing it is added to scriptsl/lib/mic/plugins/source/
to make the plugin implementation available to the wic implementation.

When the wic implementation needs to invoke a partition-specific
implementation, it looks for the plugin that has the same name as the
--source param given to that partition.  For example, if the partition
is set up like this:

  part /boot --source bootimg-pcbios   ...

then the methods defined as class members of the plugin having the
matching .name class member would be used.

To be more concrete, here's the plugin definition that would match a
'--source bootimg-pcbios' usage, along with an example method that
would be called by the wic implementation when it needed to invoke an
implementation-specific partition-preparation function:

  class BootimgPcbiosPlugin(SourcePlugin):
      name = 'bootimg-pcbios'

  @classmethod
      def do_prepare_partition(self, part, ...)

If the subclass itself doesn't implement a function, a 'default'
version in a superclass will be located and used, which is why all
plugins must be derived from SourcePlugin.

This scheme is extensible - adding more hooks is a simple matter of
adding more plugin methods to SourcePlugin and derived classes.  The
code that then needs to call the plugin methods the uses
plugin.get_source_plugin_methods() to find the method(s) needed by the
call; this is done by filling up a dict with keys containing the
methon names of interest - on success, these will be filled in with
the actual methods. fPlease see the implementation for examples and
details.

Note that a source plugin need not restrict itself to methods that
apply directly to partitions - methods can also be defined for higher
level processing such as at the 'disk' level.  The
get_default_source_plugin() of DirectImageCreator allows the default
source plugin to be retrieved; by default this is set to be the same
plugin used for the /boot partition, but that can be overridden by
specifying a different --source and therefore different plugin on the
'bootloader' line.  This isn't ideal, but it avoids forcing a new
high-level object to be defined for that purpose.

Note that the '--source rootfs' param remains as its current
hard-coded value, which is just the rootfs to be used to populate the
partition - by default, that's just the value of the bitbake
ROOTFS_DIR variable (or whatever was passed in using the -r param).
Note that this also could also be overridden by creating a source
plugin using a different name; at this point, unlike with bootimg,
there's been no need to do so.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wic: Add BootimgEFIPlugin and BootimgPcbiosPlugin

Implement the BootimgPcbiosPlugin and BootimgEFIPlugin SourcePlugin
classes.  The configure/prepare_partition() methods are implemented
using code derived from similar code in the Wic_PartData class.

These classes have the corresponding names 'bootimg-pcbios' and
'bootimg-efi', which are the names that should be used in the --source
parameters of the .wks partition commands.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wic: Hook up BootimgEFIPlugin and BootimgPcbiosPlugin plugins

Remove all the Wic_PartData and DirectImageCreator code now
implemented by the BootimgEFIPlugin and BootimgPcbiosPlugin plugins,
as well as all the special-cased boot_type code, significantly
cleaning up the code.

Replace the calling code with general-purpose plugin invocations, in
essence calling the appropriate implementations at run-time based on
the --source value in effect.

Change the directdisk.wks and mkefidisk.wks scripts to make use of the
new plugins.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wic: Hook up --debug option

Hook up the existing --debug option to toggle the wic debug loglevel,
which is indispensible when things go wrong, and make it easy to use
from the command-line.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
sstate: Improve funciton checksums

Now that bitbake is recursing into pre/postfuncs, we need to ensure
the dependencies of these functions is correct. We don't want dependencies
on MACHINE or other related variables. This patch adds in appropriate
variable exclusions to achieve this.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
package.bbclass: add SHLIBSSEARCHDIRS to define where to search for shlib providers

* when package contains some files matching "^.*\.so", but in directory
  not default linker search paths (e.g. /opt/package/bundled-lib/libfoo.so)
  don't register it as libfoo provider, because it's possible that there
  is different package providing libfoo.so in ${libdir} and that would
  be better shlib provider for other packages to depend on
* recipes providing libs intentionally in some other directory can
  define own SHLIBSSEARCHDIRS value

[YOCTO #4628]

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
qemux86: Add identical qemux86copy variant for tests

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
WIP: Add KERNEL_EXTRA_ARGS?
gtk+: Add PACKAGECONFIG for directfb

* building without x11 doesn't work, because it sets default
  gdkbackend to x11 and then requires cairo-xlib to be available
* checking for CAIRO_BACKEND... no
  configure: error: Package requirements (cairo-xlib >= 1.6) were not met:

  No package 'cairo-xlib' found

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
libsdl: Add support for libsdl-native

Change-Id: I4fb1e623c7bbb1f35ae3001c839cd7e16ce1bd65
Signed-off-by: Alexandru Niculita <alexnick87@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
classes/archive*.bbclass: remove archive-*-source.bbclass

Nearly all of the codes in the following 3 files are the same, we can
move the code to archiver.bbclass and remove them:

  archive-configured-source.bbclass
  archive-original-source.bbclass
  archive-patched-source.bbclass

[YOCTO #5113]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
archiver.bbclass: refactor it

The archiver didn't work, and there were a few problems, for example:
1) There was no src_dir.org (or orig), but the diff command still use it
2) There were a few duplicated code
3) It didn't archive the source for the native or gcc
4) The work flow is not very well
5) The "subprocess.call('fakeroot cp xxxx'" should be removed
6) And others ...

So that we have to refactor it, the benefits are:
1) Fix the problems and make it work well.
2) Reduce more than 300 lines
3) Make it easy to use.

Hre are the explanation about the bbclass:
The bbclass is used for creating the tarball from:
1) prepatch source: ARCHIVER_MODE[src] = "prepatch"
2) patched source: ARCHIVER_MODE[src] = "patched"
3) configured source: ARCHIVER_MODE[src] = "configured"
4) The patches between do_unpack and do_patch:
   ARCHIVER_MODE[diff] = "1"
   And set the files that will be excluded from diff:
   ARCHIVER_MODE[diff-exclude] ?= ".pc autom4te.cache patches"
5) The environment data, similar to 'bitbake -e recipe':
   ARCHIVER_MODE[dumpdata] = "1"
6) The recipe (.bb and .inc): ARCHIVER_MODE[recipe] = "1"
7) The log.* and run.* files under ${T}
   ARCHIVER_MODE[log] = "1"

All of the above can be packed into a .src.rpm package: (when PACKAGES != "")
ARCHIVER_MODE[type] = "srpm",
except the seventh, because the logs are not completed until the rpm
package has been built: ARCHIVER_MODE[type] = "srpm"

[YOCTO #4986]
[YOCTO #5113]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
package_rpm.bbclass: archive the source to srpm package

The archiver.bbclass will put the sources to ARCHIVER_OUTDIR according
to configuration, then the rpmbuild -bs will create the srpm.

[YOCTO #4986]
[YOCTO #5113]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
archiver.bbclass: move a few code to copyleft_compliance.bbclass

Move the code which is only used by copyleft_compliance.bbclass from
archiver.bbclassc, and remove the "inherit archiver" from
copyleft_compliance.bbclass.

The archiver.bbclass is used for archiving various types of sources, but
the copyleft_compliance.bbclass is used for analysing the license, they
don't have much relationships.

[YOCTO #4986]
[YOCTO #5113]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>