Commit Graph

5360 Commits

Author SHA1 Message Date
Trevor Woerner 2180349f75 core-image.bbclass: update available IMAGE_FEATURES
Update the list of available IMAGE_FEATURES with the sub-features of
'debug-tweaks' and add 'splash'.

(From OE-Core rev: 1e46220bb3901476266846447ff40533c9bffa1d)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-24 23:43:32 +00:00
Alexander Kanavin 4581e2c3e6 sign_rpm.bbclass: do not set/use RPM_GPG_PUBKEY
This is entirely unnecessary (we can ask the signer backend to export the
key to a file when needed), and was causing confusing selftest failures
due to the variable being set from two different places.

[YOCTO #11191]

(From OE-Core rev: 74ea979044368dc28c24325e7e77471b70aa8fe8)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-23 13:19:49 +00:00
Richard Purdie 0cb6f85335 sstate: Ensure installation directory is empty before execution
When you enable the systemd DISTRO_FEATURE, opkg-native contains systemd units
which have a relocation fixme list. When systemd isn't in DISTRO_FEATURES, there
are no fixmes required. Unfortunately as sstate isn't cleaning up its installation
directory before use, if you install the systemd version, then install the
non-systemd version from sstate, it would leave behind the fixme file from the
systemd version and breakage results as it would try and fixup files which don't
exist.

The solution is to ensure the unpack/install directory is clean before use. It
does raise other questions about opkg-native, systemd and DISTRO_FEATURES but there
is an underlying sstate issue here too which would cause missing file failures.

(From OE-Core rev: d1d55041e38b12d40f896834b56475ea19a6047f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:22 +00:00
Richard Purdie c0a2268ae8 externalsrc: Use git add -A for compatibility with all git versions
I've been debugging a selftest failure on Centos7. The problem turns out
to be the elderly git version (1.8.3.1) on those systems. It means that
the system doesn't correctly checksum changed files in the source tree,
which in turn means do_compile fails to run and this leads to the following
selftest failure:

======================================================================
FAIL [141.373s]: test_devtool_buildclean (oeqa.selftest.devtool.DevtoolTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/devtool.py", line 530, in test_devtool_buildclean
    assertFile(tempdir_mdadm, 'mdadm')
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/devtool.py", line 497, in assertFile
    self.assertTrue(os.path.exists(f), "%r does not exist" % f)
AssertionError: False is not true : '/tmp/devtoolqag88s39z8/mdadm' does not exist

The solution is to use -A on the git add commandline which matches the behaviour
in git 2.0+ versions and resolves the problem.

(From OE-Core rev: 964e8b8cae4b28e21ade12b5effb494e459b1f0f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:22 +00:00
Mikko Rapeli c52fe3a77a buildhistory.bbclass: add layer name to source recipe data
It is useful to know which layer provided a given recipe and its
binary packages.

Many projects combine a number of layers and some of them
also provide same recipe names in which case bitbake
can prioritize between them. buildhistory can record
the decision by saving the layer from where the recipe
was taken from.

Also, if a project is split to sub projects which maintain
recipes in different meta layers, then meta layer specific
summaries of e.g. disk usage can be calculated if
source recipes meta layer name is recorded for example in
buildhistory.

If source layer is not in build history, then layer providing
the recipe can be exported from build environment using
'bitbake-layers show-recipes', but it takes a long time to execute
since all recipes are parsed again and requires full source tree
with correct build configuration.

This patch exports the name of layer as configured in BBFILE_COLLECTIONS
append of its layer.conf. 'bitbake-layers show-recipes' exports the
meta layers directory path name. For several open source layers
these are different, e.g. meta-openembedded/meta-perl/conf/layer.conf
is perl-layer, poky/meta/conf/layer.conf is core,
poky/meta-skeleton/conf/layer.conf is skeleton etc.

(From OE-Core rev: d8e59d1f840e4282859ad14397d1c06516b8eb11)

Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:22 +00:00
Ross Burton 3a1e31d714 insane: remove broken unsafe-references-in-binaries test
This test aims to detect binaries in /bin which link to libraries in /usr/lib,
for the case where the user has /usr on a separate filesystem to /.

However it doesn't scan both image/ and the sysroot, so if a binary in /bin
links to a library in /usr/lib that was built by the same recipe then it will
error out.

This test isn't enabled by default, and because of this serious bug I suspect
nobody else is enabling it either.  As /usr being on a separate partition to /
is a very rare configuration these days I think we should delete the test: if
someone cares sufficiently they should write a test that actually works.

(From OE-Core rev: a6af5bbf3dad6f0951c67a0aae13ef86a8906893)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:21 +00:00
Peter Kjellerstedt fc3ae0cb2a package.bbclass: Add PRIVATE_LIBS to list of package specific variables
Changes to PRIVATE_LIBS should change the sstate checksum. To make
that happen, it needs to be listed in the list of package specific
variables, therefore add it.

(From OE-Core rev: 1a6555dfd17e180b81dec407095787d8a72a9edd)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:21 +00:00
Patrick Ohly ff73130718 image-buildinfo.bbclass: configurable location for build file
In a stateless image, /etc is not a good place for the "build"
file. By definining the location with a variable it becomes possible
to have the file created elsewhere on a per-image basis. The default
is the same as before.

(From OE-Core rev: 6750ea8160edccb156cb2ab68548adfc1c789895)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:21 +00:00
brian avery c0970e0af9 meta/lib/oeqa: change sdk test from cvs to cpio
We currently fetch,configure,build, and install cvs as our test for the
sdk.  cvs unfortunately, requires a default editor in order to run.  The
change in 94790a8254 that checks to see if you have something like vi
installed is fragile since you may have a different default editor. This
patch switches from using cvs as a test to using cpio. cpio also uses
autotools so the functionality tested is equivalent.

(From OE-Core rev: 233d36b0382a8b2e430c3377e50885d1a0c3ba21)

Signed-off-by: brian avery <brian.avery@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:21 +00:00
Patrick Ohly 3c8d045d79 rm_work.bbclass: re-enable recursive do_rm_work_all
When rewriting the do_rm_work injection, do_rm_work_all had been
removed because it seemed obsolete, as do_build now always triggers
do_rm_work.

However, do_build does not get triggered for all recipes and thus
do_rm_work was not called for recipes that got built only
partially. For example, zlib depends indirectly on
zlib-native:do_populate_sysroot.  Because of that dependency,
zlib-native got compiled, but do_rm_work was never called for it.

Re-introducing do_rm_work_all fixes that by making do_build depend on
do_rm_work_all, which then recursively depends on do_rm_work of all
dependencies. This has the unintended side-effect that do_rm_work then
also triggers additional work (like do_populate_lic) that normally
doesn't need to be done for a build. This seems like the lesser evil,
compared to an incomplete cleanup because it mostly enables the
lighter tasks after do_populate_sysroot.

The real solution would be to have two kinds of relationships: a weak
ordering relationship ("if A and B are enabled, A must run before B,
but B can also run without A") and hard dependencies ("B cannot run
unless A has run before").

(From OE-Core rev: b3de5d5795767a4b8c331fa5040166e7e410eeec)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:21 +00:00
Patrick Ohly e4b5771409 image_types_wic.bbclass: tighten dependency to help do_rm_work_all
Depending on wic-tools:do_build pulls a lot of additional, indirect
dependencies into the image sysroot during do_image_wic as soon as
rm_work.bbclass is active, because then we have
do_build->do_rm_work_all->[all dependencies]. One of those
dependencies is libgcc-initial, which clashes with libgcc itself,
leading to errors in extend_recipe_sysroot like this:

   Exception: FileExistsError: [Errno 17] File exists: '.../tmp/sysroots-components/corei7-64/glibc-initial/usr/include/fstab.h' -> '.../tmp/work/intel_corei7_64-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/include/fstab.h'

As the image recipe only needs the sysroot of wic-tools and does not
need to wait for the build of wic-tools to finish, depending on
do_populate_sysroot is the better choice and happens to avoid
the problem above.

(From OE-Core rev: a678f54e710e46b3cf674ffa41d6432b22effbdf)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:21 +00:00
Florian Wickert 1ec405ef5d kernel-fitimage: dtb sections named by their filenames and one config section for each dtb
Before this, dtb sections were named by their position index in KERNEL_DEVICETREE. Also there was only one item in the config section, so only the first dtb was seen by the bootloader.
This patch adds a config section for each dtb named by the dtb filename. This is what bootloaders usually know about the machine they run on.

(From OE-Core rev: cd2ed7f80b555add07795cc0cbaee866e6c193a3)

Signed-off-by: Florian Wickert <fw@javox-solutions.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:21 +00:00
Amarnath Valluri 0decf1cc1c kernel: use ${nonarch_base_libdir} for kernel modules installation.
Replace hardcoded '/lib' in kernel modules installation path with
${nonarch_base_libdir}, which is meant exactly for this.

(From OE-Core rev: 22f5ba7154fcbe826d0a3283740903312b2aab46)

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:20 +00:00
Peter Kjellerstedt b2cd8759b1 useradd-staticids.bbclass: Always fail/warn for missing IDs
Previously, with USERADD_ERROR_DYNAMIC set to error/warn, if a static
UID/GID was specified in the recipe, then no error/warning would be
issued even if no ID was specified in the passwd/groups files.

(From OE-Core rev: 8e4b4e28a7c3a9dbd6b9298bea5d2c1328b3f24a)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:20 +00:00
Peter Kjellerstedt 6b5502566f useradd-staticids.bbclass: Support recipes specifying static IDs
If this bbclass is used and a recipe specifies a static ID for a
user/group as part of the USERADD_PARAM_${PN} or GROUPADD_PARAM_${PN},
the build would fail with and error like this if there was no
corresponding ID in the passwd/group files specified via
USERADD_UID_TABLES/USERADD_GID_TABLES:

  ERROR: meta-oe/recipes-support/postgresql/postgresql_9.4.11.bb:
  meta-oe/recipes-support/postgresql/postgresql_9.4.11.bb inherits
  useradd but doesn't set USERADD_PARAM, GROUPADD_PARAM or
  GROUPMEMS_PARAM for package postgresql

(From OE-Core rev: e744fac05fc5cc19cabc59c1e79ff4c1b3ee396d)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:20 +00:00
Anders Darander b1f10b18ea classes/npm: allow installation of devDependencies
Often, eg when using angular2, there's a need to install also
the devDependencies.

The default is to keep the old behaviour, to not install
devDependencies.

(From OE-Core rev: 9377d16751aeff0a913e754d711bca6e4e4d9df1)

Signed-off-by: Anders Darander <anders@chargestorm.se>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:20 +00:00
Joshua Lock cc2744267f meta: replace uses of bb.data.expand(VARNAME, d) with d.expand(VARNAME)
bb.data.expand(x, d) is deprecated API.

[YOCTO #10678]

(From OE-Core rev: a361babe443da635aed83be46679067457fd6a58)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:19 +00:00
Ed Bartosh e7ce3c7f62 image_types: increase filesystem size for BTRFS
16777216 bytes is a minimal possible filesystem size for BTRFS.
mkfs.btrfs fails to create a filesystem if rootfs size is too small.

Increased filesystem size to make it possible for mkfs.btrfs
to create an image for small rootfs directories,
e.g. for core-image-minimal.

[YOCTO #11163]

(From OE-Core rev: 17c2b1ca8a4e2023583645840db61bbde22bf65e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22 11:35:19 +00:00
Mike Crowe e987f62009 ccache: Disable CCACHE_HASHDIR by default
As of ccache-3.3, ccache tries to ensure that the paths in the debug
information are always correct. It does this by including the current
directory in the hash if debug output is enabled. It includes support for
detecting remapping via a single -fdebug-prefix-map argument uses the
remapped directory in the hash instead.

The DEBUG_PREFIX_MAP in bitbake.conf remaps the source directory, target
sysroot and native sysroot separately which results in multiple
-fdebug-prefix-map arguments. Although ccache passes all these arguments
through to the compiler, it only enables the special behaviour described
above if the last one matches the current directory. (See
https://github.com/ccache/ccache/issues/163 )

Even if ccache did correctly honour each of the remapping arguments, the
hashes would still be different every time ${PV} or ${PR} change because
the default DEBUG_PREFIX_MAP contains maps to paths including them.

So it seems that for ccache to be of any use with this configuration,
CCACHE_NOHASHDIR needs to be set.

(From OE-Core rev: fb7a5cdcff19bb44a25a51e20de0440c1ebcc057)

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Helped-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-17 16:53:06 +00:00
Leonardo Sandoval 37785b9fdb uninative.bbclass: split long command
Single long commands are difficult to read and maintain. Split it to make
it more human-friendly.

(From OE-Core rev: c93b3b18f8daa8b419cc65b52cb5ceccfb1c142d)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-17 16:53:06 +00:00
Robert P. J. Day 8c1ac497da classes: Fix "U-boot", use proper spelling of "U-Boot".
U-Boot people are amazingly pedantic in their insistence on proper
spelling of "U-Boot", so humour them.

(From OE-Core rev: f346a9bdc372ec477bafcda358f9339ff4e4c79d)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-17 16:53:05 +00:00
Peter Kjellerstedt 12cc4f550a toaster.bbclass: Correct parsing of installed-package-sizes.txt
The recent change in buildhistory.bbclass to use a tab in
installed-package-sizes.txt between "KiB" and the package name caused
toaster_buildhistory_dump() to fail since it parses the file and
expected a space there.

(From OE-Core rev: 7b3692f57628b33840f6dbcddbe05ae56c24b98e)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-17 16:53:05 +00:00
Peter Kjellerstedt cb05db0d03 package.bbclass: Add SKIP_FILEDEPS to list of package specific variables
Changes to SKIP_FILEDEPS should change the sstate checksum. To make
that happen, it needs to be listed in the list of package specific
variables, therefore add it.

(From OE-Core rev: 4d9fb8414300c0adc003f2d77041713a17b49bd4)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-17 16:53:04 +00:00
Paul Eggleton 8aebe890fd classes/base: reformat HOSTTOOLS error
Adjust the message slightly to make it clearer, in particular mentioning
the HOSTTOOLS variable.

(From OE-Core rev: e022b27d189c1dcc7b3baea2b99dba8d724e6e2b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-16 22:11:32 +00:00
Juro Bystricky ab2caed31a sanity.bbclass: modify check for shell
Due to the recently implemented update-alternatives for bash binary,
sanity checker may end up with a (false-positive) error such as:

Error, /bin/sh links to /bin/bash.bash, must be dash or bash

This patch modifies the test: presence of "/bash" or "/dash" in shell binary
name results in pass.

[YOCTO#11108]

(From OE-Core rev: ef51746cdd12e6b08109e9bd90a0a465c3f9f93c)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-16 22:11:32 +00:00
Khem Raj c46c25dcfe go: Enable on musl
Working fine for musl targets now

(From OE-Core rev: 1bab5be8133f62cdae251e66db6f472c3c37297c)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:18 +00:00
Richard Purdie c90246caeb package: Fix various rpmdeps relocation issues
There are several issues with rpmdeps after the rpm v5 -> v4 transition:
 * _rpmfc_magic_path  is an invalid option for rpm4
 * --rpmpopt is an invalid option for rpm4
 * we need to use the path to rpmrc since otherwise it poitns at the
   original build path
 * we need to set MAGIC in the environment so libmagic can find its
   files.

This patch addresses those and ensures rpmdeps works in relocated builds
from sstate (or with rm_work).

(From OE-Core rev: 806e37264d7102ae982867350ad8363ed3e5f475)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:18 +00:00
Richard Purdie d97a6eeaed testimage: Don't use systemd.log_level=debug logging
This causes MBs of log messages which overload the standard 200kb syslog limit
used by busybox syslog by default. This means some tests which rely on messages
being detected in syslog, e.g.
rpm.RpmInstallRemoveTest.test_check_rpm_install_removal_log_file_size
fail (AssertionError: 54 not greater than or equal to 80 : Cound not find sufficient
amount of rpm entries in /var/log/messages, found 54 entries).

We enabled this to aid debugging of some systemd race issues, those are
now resolved so we can disable this. Leave the log level parameter as a
comment to save others having to look it up if they need debugging.

(From OE-Core rev: 84d4daffaebcb4816d597671b287329e8a472f59)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:18 +00:00
Alexander Kanavin 226cc7396a package.bbclass: don't exclude package groups from runtime mapping
This ensures that remapping happens correctly, particularly
when package groups list noarch packages, and multilib is in use. Previously
this was masked by rpm doing *another* layer of remapping on top of this.

(From OE-Core rev: ad0e32014e846d20a1449de76e152e5f06812685)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:17 +00:00
Alexander Kanavin 44e229c995 package_rpm.bbclass: do not strip multilib prefixes from package names, do not add multilib prefix to package arch
This is done for reasons I cannot establish, and greatly complicates the code
that installs packages into rootfs.

(From OE-Core rev: d9ea9003677d195f64eb4b3202e1c5d37d21b330)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:17 +00:00
Alexander Kanavin b45765d7ac package_rpm.bbclass: do not set the OS dynamically when building rpms
Packages need to contain just one value for the os field, otherwise
rpm will refuse to install them if they don't match what is in
/etc/rpm/platform.

(From OE-Core rev: 580ba965f5f38f6718a83f690bbe23a63fbcd3dd)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:17 +00:00
Alexander Kanavin 1cf9dd6492 package_rpm.bbclass: add a /bin/sh Provides for nativesdk- packages
nativesdk-* rpm packages all require /bin/sh because postinst scriptlets
are run with it. We can either teach rpm4 and dnf to ignore that dependency
(a lot of non-upstreamable work), or add auto-satisfy the dependency
in each package. I've chosen to do the latter.

(From OE-Core rev: b18c32ab6bc9c4f1953e9f79aa39bc92d1c4e30d)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:17 +00:00
Alexander Kanavin 529244ee21 run-postinsts: simplify the logic of whether to install it to images
The logic is scattered all over the place, but amounts to
"install, unless the rootfs is read only". Let's express that directly.

(From OE-Core rev: 697804229a172125ce7d3bfc9b343812d6fe3240)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:17 +00:00
Alexander Kanavin d94b98fe30 package_rpm.bbclass: instruct rpm to not remove the buildroot directory
This is the ${W}/package directory which may be reused in subsequent builds.

Also clean up various default directories rpm 4 creates.

(From OE-Core rev: bdebe0d50a210438730ee7797968eafe169ded23)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:17 +00:00
Alexander Kanavin ea4bac7e45 testimage.bbclass: fix runtime test for rpm, port smart tests to dnf
(From OE-Core rev: 749a496d273f9fd378588e309cf976294584ca5f)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:17 +00:00
Alexander Kanavin dfa2987623 package_rpm.bbclass: no need to specify the magic file location
It's handled by the rpm wrapper command, created in rpm recipe.

(From OE-Core rev: 8f331db8136c8bf28ceea7f8ae410eb9d83225ad)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:17 +00:00
Alexander Kanavin 5445f03975 package_rpm.bbclass: replace createrepo reference with createrepo_c
(From OE-Core rev: de6ed676712f79e54a32000a1b090eb918c939b9)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:17 +00:00
Alexander Kanavin 67615e0175 rootfs_rpm.bbclass: migrate image creation to dnf
To properly look at this patch, you probably need a side-by-side diff viewing tool.

(From OE-Core rev: 65581c68d130fa74d703f6c3c92560e053857ac7)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:17 +00:00
Alexander Kanavin df3734551f package_rpm.bbclass: correctly map RRECOMMENDS and RSUGGESTS to rpm tags
Previously they were swapped, not sure why. Their meaning, as far as rpm
world goes, is different:

- Recommends is a soft dependency and will be installed by default; there is
an option not to do that.

- Suggests is a suggestion to be picked up and presented to end user by
package management tools; it has no special meaning otherwise.

OE packages use RRECOMMENDS, which should be mapped to Recommends rpm tag,
so that the packages will be picked up as dependencies.

(From OE-Core rev: 06270f20ba4312d20d0fd348595adf1b239bcac5)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:17 +00:00
Alexander Kanavin cf7e0baffa package_rpm.bbclass: make architecture-independent .rpm packages "noarch" instead of "all"
Too many places in dnf/rpm4 stack make that assumption; let's not fight against it.

(From OE-Core rev: 341810aff923ace6b1cc1e15e19383c4f8773b51)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:17 +00:00
Alexander Kanavin a1180e91d0 package.bbclass: fix locations of debugedit and rpmdeps utilities
rpm4 installs them in different locations than rpm5. This also replaces
our custom rpmdeps-oecore with standard rpmdeps; I'm not seeing a
significant performance penalty.

(From OE-Core rev: ec20cda53caeebfdf95e2871d5da8b926e84d2aa)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-14 14:42:16 +00:00
Jack Mitchell 3e5f3cfe81 u-boot: add option to specify FDT argument in extlinux.conf
Also fixes a use before defined bug with localdata.

(From OE-Core rev: 86b09a7ed67a43a45c805f44778bed0bfdf57361)

Signed-off-by: Jack Mitchell <jack@embed.me.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-13 09:43:14 +00:00
Richard Purdie 8406db9e11 terminal: Use original PATH for terminals
Now that we filter out PATH to only the utilities we rely upon, the devshel
terminal was broken since it can no longer find the terminals. Even if
we fix that, the user couldn't access any of their commands within
devshell which somewhat defeats its purpose.

Add the original PATH back to the environment to restore that behaviour
since this is more in line with user expectations and it wouldn't be possible
(or desireable) to whitelist all the commands a user might want to use from
the shell.

(From OE-Core rev: 67d7ea2db8bce766daf3419feae3cd8045af5114)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-13 09:42:09 +00:00
Stephano Cetola e018993541 uninative: remove unneeded call to sparse copy
As of this commit:

39f5a05152aa0c3503735e18dd3b4c066b284107

patchelf no longer inflates file sizes. Since the files are no longer
inflated by patchelf, we can skip using cp with the --sparse option.
More details as to how patchelf has changed are available in that
commit log.

(From OE-Core rev: a2519a2f96bfea53a527c704e620e3584c97c67d)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-11 16:09:14 +00:00
Ross Burton ca5059e638 classes: add devupstream class
This class lets you use BBCLASSEXTEND to add a variant of the recipe that
fetches from an alternative URI (such as git:) instead of a tarball.

For example:

 BBCLASSEXTEND = "devupstream:target"
 SRC_URI_class-devupstream = "git://git.example.com/example"
 SRCREV_class-devupstream = "abcd1234"

This variant will have DEFAULT_PREFERENCE set to -1 so it needs to be selected
to be used, and any development-specific tweaks can be done with the
class-devupstream override, for example:

 DEPENDS_append_class-devupstream = " gperf-native"

 do_configure_prepend_class-devupstream() {
    touch ${S}/README
 }

It currently only supports creating a development variant of the target recipe,
not native or nativesdk.  The BBCLASSEXTEND syntax (devupstream:target) was
chosen so that support for native and nativesdk can be added at a later date.

Support for other version control systems such as subversion is limited, as
bitbake's automatic fetch dependencies on for example subversion-native are not
generated.

[ YOCTO #10215 ]

(From OE-Core rev: c48ef2d7c7198232846f36a975c673cc57f4a090)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-11 16:09:14 +00:00
Richard Purdie 94790a8254 base/bitbake.conf: Filter contents of PATH to only allow whitelisted tools
We currently have a determinism problem in that the host tools present
in PATH can influence the build. In particular, the presence of pkg-config
on the build host can mask missing pkgconfig class dependencies.

This adds in a new HOSTTOOLS variable and then uses it to set up a directory
of symlinks to the whitelisted host tools. This directory is placed as PATH
instead of the usual /usr/bin:/bin and so on.

This should improve determinism of builds and avoid the issues which have
been particularly obvious since the introduction of recipe specific sysroots.

If users find there is a tool missing, they can extend HOSTTOOLS from a global
class or global conf file.

Right now the settings should be enough to build everything in OE-Core.

(From OE-Core rev: fa764a403da34bb0ca9fa3767a9e9dba8d685965)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-11 16:09:14 +00:00
Khem Raj 760e81678c go: Add recipes for golang compilers and tools
* This is converging the recipes for go from
  meta-virtualization and oe-meta-go

* Add recipes for go 1.7

* go.bbclass is added to ease out writing
  recipes for go packages

* go-examples: Add an example, helloworld written in go
  This should serve as temlate for writing go recipes

* Disable for musl, at least for now

* Disable for x32/ppc32 which is not supported

(From OE-Core rev: 78615e9260fb5d6569de4883521b049717fa4340)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-10 15:51:55 +00:00
Ross Burton 0ed537f95b license: don't assume source files are UTF-8
We can't assume that source files are entirely UTF-8, so when copying the
license blocks open the file as binary instead of text.

[ YOCTO #11135 ]

(From OE-Core rev: b606e1430c36f1ad528fbfbbf9b8b6243390b879)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-10 14:50:11 +00:00
Andre McCurdy 3f3ced499c sanity.bbclass: allow s3 protocol when sanity checking MIRRORS, etc
Bitbake now supports an Amazon AWS S3 fetcher:

  http://git.openembedded.org/bitbake/commit/?id=6fe07ed25457dd7952b60f4b2153d56b15d5eea6

(From OE-Core rev: 5cc3592afc72bae8dd12d3d8ff15bb7418baaea3)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-10 14:50:10 +00:00
Ed Bartosh 51edde6537 sstate.bbclass: update .siginfo atime
.siginfo files are not being accessed from local or NFS-mounted
sstate mirrors when sstate package is installed, so their atime
is not updated. If sstate mirror is cleaned based on access time,
they get deleted, even though they are still being used.

Updated atime of .siginfo symlinks with 'touch -a'. This command
dereferences symlinks pointing to the local mirror and updates
atime of the .siginfo file on the mirror.

[YOCTO #10857]

(From OE-Core rev: fb1499a42756faeef025122bbde98bc14f4ae61e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-10 14:50:10 +00:00
Maxin B. John d070d151d3 useradd.bbclass: drop obsolete code
Cleanup useradd class by removing the code made obsolete by
the introduction of Recipe Specific Sysroot.

(From OE-Core rev: 2c126e704ebb58afc0d79fe220dc370e09d6bfd5)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-08 11:52:57 +00:00
Khem Raj dc80d4f4bc kernel-arch: Lock the toolchain to use gcc compiler
kernel and external modules are still using gcc to build

(From OE-Core rev: 75cf0f0690c9c192e4cbffb71015866f967c2e1f)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-08 11:52:57 +00:00
Andre McCurdy b41e1c9209 base.bbclass: improve wording when skipping recipes with incompatible licenses
The previous wording, e.g.

  ERROR: wget was skipped: incompatible with license GPLv3

isn't very clear and could be taken to imply that the recipe is
incompatible with its own license.

(From OE-Core rev: c2047067daadb40ff3a944f380c10b2a56b8e080)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-08 11:52:56 +00:00
Peter Kjellerstedt 1df119cd06 module.bbclass: Add inherit of pkgconfig
This is needed for the make_scripts task.

(From OE-Core rev: 554672d5f649eaf6a7d76f79520304415d926a3e)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-08 11:52:56 +00:00
Aníbal Limón aac3ad4785 buildhistory.bbclass: Only execute get_extra_sdkinfo when sdk is enabled
If sdk ins't in BUILDHISTORY_FEATURES the get_extra_sdkinfo fails
because no information about sdk is generated in buildhistory repo.

(From OE-Core rev: e6a0ea6146171635c49b18e00b4b11a9a7ff20ee)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-08 11:52:56 +00:00
Mikko Rapeli f1475ed582 buildhistory.bbclass: use tabs as separator in installed-package-sizes.txt
All other fields are separated by tabs except KiB and binary package
name. This helps users, *cough managers*, who import this file into
MS Excel to calculate file system usage summaries.

(From OE-Core rev: e26bed8493d7b096740cd6fff2e72ab27d48a933)

Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:19 +00:00
California Sullivan 132b4d13e0 kernel.bbclass: Give sanity check function an opt-out variable
Having no opt-out method and adding the task to linux-yocto.inc was
causing issues. For example, linux-yocto-dev would often fail because
it uses AUTOREV with no way to dynamically change the PV.

Add a variable to turn off the sanity check, allowing an easy opt out,
and set the opt-out variable in linux-yocto-dev, fixing the issue with
AUTOREV.

(From OE-Core rev: 1b6a3c17874ead7ee0957e67329aa3bd019fa129)

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:19 +00:00
Nathan Rossi f3881e63fd package.bbclass: Add SHLIB detection support for mingw targets
Add support to detect dll files as shared objects as well as process
Windows .dll and .exe files to determine the runtime libraries
dependencies.

This implementation is sufficient to detect and map runtime library
dependencies between packages. And does not implement any version naming
conventions that might apply for .dll files (e.g. lib*-x.dll).

(From OE-Core rev: 7df031e1ffe409573753585ba2f1a82ff707ad7e)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:19 +00:00
Nathan Rossi 09a253d09f update-alternatives.bbclass: Disable for mingw32 targets
When building for mingw32 targets (e.g. nativesdk cross compiling for
windows), disable the dependency on update-alternatives as the Windows
platform does not support symlinks or package management.

This avoids the complex (partly non-buildable for mingw32) dependency
chain virtual/update-alternatives -> opkg-utils -> python -> ...

(From OE-Core rev: 0131abe2d94d6836a54bc1616566c3bf3f2d6eb0)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:19 +00:00
Dengke Du f6eec55982 autotools.bbclass: delete the extra varflag set for autotools_copy_aclocals
The autotools_copy_aclocals has been droped, so the varflag set for that should
be removed.

(From OE-Core rev: 2940340cc3c8581d16acdaec3ba1dbfd3e88f840)

Signed-off-by: Dengke Du <dengke.du@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:19 +00:00
Jackie Huang 5528cd5c0f ptest.bbclass: use BPN in PTEST_PATH for multilib
Use BPN instead of PN in PTEST_PATH for multilib builds,
or we get two directories for a package in libdir which
doesn't make sense, e.g.

$ ls /usr/lib/*coreutils
/usr/lib/coreutils:
libstdbuf.so

/usr/lib/lib32-coreutils:
ptest

(From OE-Core rev: 0e949b7bfc4207aba0e3c4d12b76cc1f1815470d)

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:19 +00:00
Andre McCurdy 2d1b0452ba bitbake.conf: replace USE_LDCONFIG with new "ldconfig" distro feature
USE_LDCONFIG could previously be set to 0 by distros which do not
require ldconfig or ld.so.conf on the target. Since more and more
recipes may need to respect that option, replace the ad-hoc variable
with a distro feature.

Distros which previously set:

  USE_LDCONFIG = "0"

Should now instead use:

  DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " ldconfig"

(From OE-Core rev: a905df2dd8f43a2febffa64a39b6e508510326a0)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:19 +00:00
Ed Bartosh ee860b3bf5 wic: add WKS_FILE_DEPENDS variable
This variable should be used to specify dependencies that
will be added to DEPENDS only if wic image build is 'active'
i.e. when 'wic' is in IMAGE_FSTYPES.

(From OE-Core rev: 243ccd6b8b389231f6c4a8e251c2bd6b2cf6eaad)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04 23:18:18 +00:00
Richard Purdie 2e5181e510 testsdk: Fix lockfile patch
In the previous lock removal patch I mixed up the two tasks and broke sdk
testing. Fix this by removing locks for both sdk and extsdk.

(From OE-Core rev: 20c6e876ed6b8c8ac007848e2b36e9a8a56bb703)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-03 12:21:09 +00:00
Richard Purdie 32e1eac492 populate_ext_sdk: Merge auto.conf into local.conf
auto.conf is included before local.conf. Instead of keeping them separate, merge
them into the extsdk local.conf. As it happens we can do this quite neatly, more
neatly than the current code IMO and it makes the configuration easier for the end
user to understand too.

This means auto.conf is then available for the testsdk code to use for testing
purposes.

(From OE-Core rev: fb625e555707478d5b4931c6bc83ab06b17a8ca9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-03 11:16:12 +00:00
Richard Purdie 7fefdc1e11 populate_ext_sdk: Append to SSTATE_MIRRORS
We need to appent to SSTATE_MIRRORS in case other areas of code are also
setting the variable.

(From OE-Core rev: 9cab832b1e85822fa9be5ea9fa0415f48fba86f2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-03 11:16:12 +00:00
Richard Purdie e05c8d812e testsdk: Drop lockfile usage
We should be able to test sdks in parallel. As far as I can tell, this
restriction crept in for no good reason, based on locks that testimage used
for the non-qemu case.

Therefore remove the lock and allow sdks to test in parallel.

(From OE-Core rev: 54477664dc13c6aa15b3246f328b66591a340659)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-03 11:16:12 +00:00
Richard Purdie 85188262f7 sanity: Allow whitespace only mirror entries
Forcing the use of "\n" in mirror variables is pointless, we can just require that
there are pairs of values. With the bitbake restriction relaxed, we can relax
the sanity check too.

(From OE-Core rev: 7313b10e242da9225211ca9fd53d14a121c5fa42)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-03 00:19:37 +00:00
Richard Purdie ea2fd77ba5 testsdk: Use auto.conf instead of local.conf to set SSTATE_MIRROR
The local.conf file can get overritten and changed by the SDK so (ab)use
auto.conf instead to ensure our configuration tweaks get applied.

Also ensure we append to any other configured SSTATE_MIRROR variable
that already exists.

(From OE-Core rev: 444a71b1c2d8f86fc4c35c8ff8e92bcbbe646b75)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-02 16:09:42 +00:00
Ross Burton 88c1fb2f0c oeqa/sdkext/devtool: use finally instead of repeating cleanup
Use the finally: block to always to cleanup.

Now that the test harness in testsdk.bbclass has monkey-patched
CalledProcessException to display the output we don't need to do that in the
test case.

(From OE-Core rev: 9f0f6326083ee76b72b431fbfcbe12c1ab2793b2)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:11 +00:00
Richard Purdie 28430385ad populate_sdk_ext: Allow generation of meta-extsdk-toolchain even for minimal SDKs
If you build a minimal eSDK currently, you don't build meta-extesdk-toolchain
even if you will have built most of its dependencies. This means when you try
and install a toolchain into the eSDK, it fails, breaking our automated testing
of the eSDK.

Therefore add the dependency unconditionally even when a minimal eSDK is being
built and allow the automated testing to work.

(From OE-Core rev: 6e4ae81d76c5a61e7603ff4ca94452a6e724c244)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:11 +00:00
Richard Purdie 51d6f19fa8 testsdk: Handle minimal eSDK and avoid download costs
When using a minimal eSDK, testing currently fails as the sdk isn't
populated. We therefore setup the eSDK under test to point at local
sstate and execute a command to ensure the toolchain is populated
since most of the tests depend on this being present.

At the same time, add in a link to DL_DIR through own-mirrors so
that tests which fetch source (e.g. the kernel module one) can
use the local stash. This cuts test execution of the kernel module
test from 2000s to 120s.

We did try using DL_DIR directly but that causes uninative issues
requiring other workarounds so own-mirrors is neater.

Together these fixes unbreak eSDK testing on the autobuilder.

(From OE-Core rev: 866b55905eabf93f45c10a08d5b53c459ac4c056)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:11 +00:00
Mariano Lopez f786def0ec insane.bbclass: Add missing dependencies
package_qa task requires some tools installed in sysroot; with
the introduction of recipe specific sysroot this task won't
have such tools installed if it's forced to run.

(From OE-Core rev: cf351eb49c44d9cbba82392f3331e7cba0c0d0ee)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:10 +00:00
Joshua Watt 8d8d0a52d5 base.bbclass: Fix OE_IMPORTS
Udpate OE_IMPORTS to include oe.license because it is being used.

(From OE-Core rev: d0902a5c3babbd3b291fa494462e083794ca4bee)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:10 +00:00
Pavel Modilaynen 010b368bc8 buildstats.bbclass: Avoid index exception in /proc/PID/io parsing
There is some probability (depends on system load) to get empty
or line containing "0" as the last line while reading /proc/PID/io.
Avoid build failure by checking if line contains separator
":" before split.

(From OE-Core rev: b26feaf51af55f17fad79dbd53dd3ec0a37c38ff)

Signed-off-by: Pavel Modilaynen <pavelmn@axis.com>
Signed-off-by: Daniel Lublin <daniel@lublin.se>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:10 +00:00
Markus Lehtonen 6e1aad4596 license.bbclass: run chown only under pseudo
The copy_license_files() function in license.bbclass is called in two
different contexts. First, it is run as part of the do_populate_lic
task. In addition, it is called from do_package task when
LICENSE_CREATE_PACKAGE is enabled. The function has code that changes
the owner of license files to root which is meant only to happend in the
latter case - i.e. under do_package which is run under pseudo.
Previously, the code was blindly always running chown and just ignored
errors that happened when running from do_populate_lic. This patch
changes it to be more intelligent, only doing chown when running under
pseudo.

[YOCTO #10897]

(From OE-Core rev: 19118a1408f32bb24d95ab3d7d7faed58cbae900)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:09 +00:00
Aníbal Limón 129fbf324a classes/license.bbclass: Don't copy unneeded licenses by package
Usually a recipe only provides one package but when provides more
than one package the LICENSE variable per package (i.e. linux-firmware)
needs to take into account to avoid unnecesary copy of licenses into
packages.

The patch validates if LICENSE exists in package LICENSES in order to
don't copy unneeded licenses.

As result of this patch some packages will not contain licenses there
are not into LICENSE variable.

For example:

acl contains GPLv2+ instead of GPLv2+ and LGPLv2.1+
libacl contains LGPLv2+ instead of GPLv2+ and LGPLv2.1+

This behaviour is declared on the acl recipe as:

SUMMARY = "Utilities for managing POSIX Access Control Lists"
HOMEPAGE = "http://savannah.nongnu.org/projects/acl/"
SECTION = "libs"

LICENSE = "LGPLv2.1+ & GPLv2+"
LICENSE_${PN} = "GPLv2+"
LICENSE_lib${BPN} = "LGPLv2.1+"

[YOCTO #10325]

(From OE-Core rev: 8c8c8edea9c9015e21f47f3d10e6f45446a2823b)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:06 +00:00
Aníbal Limón 5a2a1ec16b license.bbclass: Don't copy again LICENSE already handled as no-generic
The NO_GENERIC_LICENSE mapping was added [1] to enable copy LICENSES
from upstream source code into recipe licenses, previously that only
common-licenses was processed.

This result on copy twice the NO_GENERIC_LICENSE specified because there
is a mapping between license in LIC_CHKSUM and NO_GENERIC_LICENSE.

In order to avoid double copy one as generic_ and other as LICENSE. keep
track of licenses already copied.

For linux-firmware the result will be only generic_ licenses into
common-licenses.

[YOCTO #10325]

[1] http://lists.openembedded.org/pipermail/openembedded-core/2015-April/104222.html

(From OE-Core rev: 95b9e2cd26c7cae265ff52af90480b75251f00e5)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:06 +00:00
Peter Kjellerstedt 254bfb1071 recipes: Make use of the new bb.utils.filter() function
(From OE-Core rev: 0a1427bf9aeeda6bee2cc0af8da4ea5fd90aef6f)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 11:17:45 +00:00
Mike Crowe 0b8d85a094 kernel, license, sstate, rootfs.py: Remove deploy directory README
It isn't clear that the README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt
file in the deploy directory warrants the complexity it brings elsewhere.
Let's just remove it entirely.

In particular, if two do_image_complete tasks run in parallel they risk
both trying to put their image into ${DEPLOY_DIR_IMAGE} at the same time.
Both will contain a README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt
file. In theory this should be safe because "cp -alf" will just cause one
to overwrite the other. Unfortunately, coreutils cp also has a race[1]
which means that if one copy creates the file at just the wrong point the
other will fail with:

 cp: cannot create hard link ‘..../tmp-glibc/deploy/images/pantera/README_-_DO_NOT_DELETE_FILES_IN_THIS_D.txt’ to
+‘..../tmp-glibc/work/rage_against-oe-linux-gnueabi/my-own-image/1.0-r0/deploy-my-own-image-complete/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt’: File exists

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25680

(From OE-Core rev: 71e9e88847d7000781642ea6187ebd8f40dfdcfe)

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 11:17:45 +00:00
Robert Yang 3711607d91 binconfig.bbclass: fix get_binconfig_mangle()
The command was:
s += " -e 's:-L${libdir}:-LOELIBDIR:;'"
s += " -e 's:-I${includedir}:-IOEINCDIR:;'"
s += " -e 's:OELIBDIR:${STAGING_LIBDIR}:;'"
s += " -e 's:OEINCDIR:${STAGING_INCDIR}:;'"
s += " -e 's:-I${WORKDIR}:-I${STAGING_INCDIR}:'"
s += " -e 's:-L${WORKDIR}:-L${STAGING_LIBDIR}:'"

The STAGING_LIBDIR and STAGING_INCDIR now contains WORKDIR, so the
result would be incorrect like:
TCL_INCLUDE_SPEC='-IFIXMESTAGINGDIRTARGET/usr/include/recipe-sysroot/usr/include/tcl8.6'

Note, the "/usr/include/recipe-sysroot" is not needed. Move the last two
sed commands ahead will fix the problem.

(From OE-Core rev: 42e4e36de37b8e06a2ff56172d04d3ffeccfbfae)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-23 12:49:49 -08:00
Saul Wold ce79111e73 native.bbclass: populate native recipe with it's files
This allows a native package's recipe-sysroot-native to be populated with
that packages native image files.  This in turns allows it to be used by
scripts or other tools without creating un-necessary DEPENDS.

An example of this is systemtap-native and the crosstap script.

(From OE-Core rev: 7f6b4359e1f2d9d748d23305a2af73c0efba5928)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-23 12:49:49 -08:00
Robert Yang 970b0321cf kernel.bbclass: do_deploy requires depmodwrapper
Fixed:
run.do_deploy.27809: line 155: depmodwrapper: command not found

(From OE-Core rev: 96b7eceefb3e99848d1c16d7c5da123056dcdc24)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-23 12:49:49 -08:00
Robert Yang 1aed4140bf terminal.bbclass: export configure vars
So that we can easily reproduce configure by:

$ $CACHED_CONFIGUREVARS ./configure $CONFIGUREOPTS $EXTRA_OECONF

[YOCTO #9423]

(From OE-Core rev: a851f57de63fe527e04f2296245e9720c40f9c2e)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-23 12:49:49 -08:00
Peter Bergin 42d6b7818d useradd-staticids: fix typo for '--expiredate'
There is a typo in the useradd-staticids.bbclass that
causes error during do_install.

If build was configured to use usedadd-staticids and
the recipe included (for example):

USERADD_PARAM_${PN} = "--expiredate '' testUser"

Due to the typo this added the wrong option '--expiredata '
that caused an error.

(From OE-Core rev: 9d26a2f9f52ae9df6aa5e0ee20683ada35c32af1)

Signed-off-by: Peter Bergin <peter@berginkonsult.se>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-23 12:49:48 -08:00
Mariano Lopez cf0b92f893 oeqa/runtime/context.py: Fix use of getTarget() with testexport
The idea on getTarget is to use kwargs to send custom variables
to different targets, instead of this, a new variable was added
(just used for custom targets) and this broke testexport. So
in order to fix it, just add the custom variable to kwargs.

This fixes the use of getTarget() in testexport class that was
introduced in 1dc8010afd71fe46fb28bb86fb7c07a5fbd3d7cf.

(From OE-Core rev: cf138029a1f18f991fc7a28c81d85884942e9d56)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-23 12:49:48 -08:00
Ed Bartosh 88bda7d78d image_types_wic: fix expansion error
Variable WKS_SEARCH_PATH was not fully expanded when used directly
in this expression:
    WKS_FULL_PATH = "${@wks_search('${WKS_FILES}'.split(), '${WKS_SEARCH_PATH}') or ''}"

This caused expansion error: bb.data_smart.ExpansionError:
Failure expanding variable WKS_FULL_PATH, .... which triggered exception
SyntaxError: invalid syntax (WKS_FULL_PATH, line 1)

Calling d.getVar instead of directly referencing variables
should fix the issue.

(From OE-Core rev: 20f8fddd28fe46d7e694804de3d894cdf9f7c636)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-23 12:49:48 -08:00
Randy Witt 5da9c1c38b image-container.bbclass: Error if not using linux-dummy
In the typical case of a container, the user doesn't particularly care
about the kernel version used. Since using linux-dummy prevents building
a kernel in the most common case, alert the user if they choose a
container image, but don't also specify linux-dummy.

In the cases the user actually does want to build against particular
kernel headers, etc, they can override by setting
IMAGE_CONTAINER_NO_DUMMY = "1".

[YOCTO #9502]

(From OE-Core rev: f0645e172bb839803d616f19307e1e81e0d204c0)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-19 06:49:00 -08:00
Randy Witt 1b8f485c24 image-container.bbclass: Add the "container" IMAGE_FSTYPES
The "container" fstype does very little other than pick tar.bz2 as the
actual image type and disable installation of ROOTFS_BOOTSTRAP_INSTALL.

[YOCTO #9502]

(From OE-Core rev: e45f074b792a43aa2fd84a5a3f0e20bf1d88ad7e)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-19 06:49:00 -08:00
Bruce Ashfield 9b77a677a0 kernel-yocto: trivial: remove extra } from bsp_definition
A typo introduced an extra } in the logging of the bsp_definition.
While this won't cause problems .. it needs to be fixed!

(From OE-Core rev: 9b95f3fca2a94ca922e05321096e07a11e98f9bb)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-19 06:16:58 -08:00
Awais Belal 35a79cc495 kernel-yocto.bbclass: ensure repatching when HEAD is checked out
In some cases it is seen that kernel_checkout and validate_branches are
run again in simultaneous builds. During do_patch the kgit-s2q mechanism
looks for a sentinel file inside the .git directory, finds a fence post
and starts picking up patches after that.

This can create trouble as validate_branches checks out the HEAD of the
branch and so the patches should be reapplied rather than skipped due to
finding of the fence post.

We can call kgit-s2q --clean to remove the sentinel file when the
branches are checked out.

(From OE-Core rev: d57aeafdd2b49010a9fa6d1cd9d10f3cfd5754a5)

Signed-off-by: Awais Belal <awais_belal@mentor.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-19 06:16:57 -08:00
Joshua Watt 8279d6f257 classes/license: Respect beginline and endline
Recipes have the option of specifying a 'beginline' and 'endline'
options in LIC_FILES_CHKSUM which will cause the license bbclass to
only extract those specific lines from the license file when generating
the license database.

(From OE-Core rev: 515f4c129ad27e9502621738d0bf7f5552627f19)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:41 -08:00
Stephano Cetola 2c74929555 insane.bbclass: print QA message correctly
Replace call to non-existent method "messages" with call to correct
QA logging method.

Fixes [YOCTO #11014]

introduced in OE-core revision 1dcb38ca9d6

(From OE-Core rev: 7f3e6d7ce94659447e1b1cdcb2440305581c8cbb)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:40 -08:00
Amarnath Valluri f377eaa011 package_deb.bbclass: Ignore file paths in RPROVIDES
Unlike rpm, debian packaging does not allow file paths in 'Provides:' field.
When 'usrmerge' distro feature enabled bash/busybox packages adds '/bin/sh' to
it's RPROVIDES to satisfy build dependencies, this entry should be filtered out.

(From OE-Core rev: a36165ea8bf8c7a061a0173076c83ae6806d65b6)

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:40 -08:00
Mariano Lopez b61eee699d testimage.bbclass: Add check for empty test suite
If for some reason (most likely incorrect TEST_SUITES var)
you end with an empty test suite, testimage will start the
target (qemu by default) and will run an empty suite, so
better have a check before starting the target.

[YOCTO #10979]

(From OE-Core rev: 8345f834a080737f03bee3f0c615dd9654401d93)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 09:29:56 -08:00
Nathan Rossi fd1ecec6a9 image.bbclass: Use 'populate_sdk_base' for non-linux targets
When 'populate_sdk_ext' was first introduced in commit bf81d6bb7f6 it
replaced the inheriting of 'populate_sdk_base'. For non-linux targets
building the extensible SDK caused build errors, and the image class was
changed to inherit 'populate_sdk' when targeting a non-linux SDK_OS (in
commmit e471ce3464d). However inheriting 'populate_sdk' instead of
'populate_sdk_base' causes the SDK to always be built, this is not
expected for the image class.

This change makes the image class inherit 'populate_sdk_base' in the
non-linux SDK_OS case so that it behaves the same as it is expected to
behave where 'bitbake <image> -c populate_sdk' must be executed to
generate the SDK deployables.

(From OE-Core rev: b7d6bb07fd37c55d07903a1e8921f17e39afde0a)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 09:29:56 -08:00
Philip Balister b6939b7392 sanity.bbclass: Add which to SANITY_REQUIRED_UTILITIES.
Using docker with the Fedora 23 container exposed an issue with
the rpm-native configure step. If which is not present the configure
script fork bombs. After much pain, I tracked this to which not being
present in the default container. Add a check for which so others
do not have to have this experience.

(From OE-Core rev: 096c07900250db157bb0c38785b9d8efc6301cab)

Signed-off-by: Philip Balister <philip@balister.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 09:29:56 -08:00
Dalon Westergreen 6f3f9457a6 uboot-extlinux-config.bbclass: add support for timeout & default
When multible targets are defined it is useful to allow for
a default target along with a timeout.  After timeout, the
default target will be selected.

(From OE-Core rev: 1e01c2e32c168805a9b71c1dba4b487916955813)

Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 09:29:56 -08:00
Paul Eggleton 4794518720 classes/copyleft_filter: include AGPL in default included list
If we're including all GPL licenses then we should include AGPL in
the default COPYLEFT_LICENSE_INCLUDE since it has similar terms (and
currently we do have one AGPL-licensed recipe in OE-Core, namely db).

(Note that the default list isn't meant to be a guaranteed complete
safe list - seek legal advice based on what you're distributing if
unsure.)

(From OE-Core rev: a16fbf6970056a79cac8b70ce54e55e61ef63a8d)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 09:29:56 -08:00
Andrea Adami 0fce3ec656 kernel.bbclass: Make symbol to vmlinuz.bin in boot directory
The changes committed with 6e58f54be103814b6b8a85b236510633c49e6832 did only
consider the vmlinuz ELF kernel but some devices do reqire a raw vmlinuz.bin
(as for example gcw0 in meta-handheld booted by ubiboot).
Expand the above mentioned patch to consider this case.

(From OE-Core rev: 413a5faf99280f4e083358e4134aebbcfa47bb4c)

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 09:29:56 -08:00
Jussi Kukkonen 0d637857f2 cve-check.bbclass: Fix dependencies
With recipe-specific sysroots the cve_check task must depend on
cve-check-tool-native:do_populate_sysroot to get the cve-check-tool
binary into the recipe sysroot.

A normal DEPENDS isn't used to avoid cyclic dependencies.

(From OE-Core rev: bd60b1018bc0304bc928701e6d1090c8b1223616)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 09:29:56 -08:00
Juro Bystricky b1f99066bd testimage: Implement custom target loading
This patch implements custom target loading for testimage, currently
missing due to major changes to the test framework.
Custom targets can be defined in various meta-layers, so we
need an extra path information in order to find them.
Any other additional info is retrieved as usual via the variables
TEST_TARGET and TEST_SUITES

(From OE-Core rev: 1dc8010afd71fe46fb28bb86fb7c07a5fbd3d7cf)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 09:29:55 -08:00
Richard Purdie bfd0a39bdf classes: Drop now unneeded update_data calls
Now that the datastore works dynamically we don't need the update_data calls
so we can just remove them. They're not actually done anything at all for
a while.

(From OE-Core rev: 8de0c5d3bd01919e2bf0394f9c485936d6098cec)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 09:29:55 -08:00
Richard Purdie 3eee8e99e1 sstate: Make absolute symlinks an error
The current relocation code is broken, at least in the native case. Fixing it
would mean trying pass in new data on sstate tasks about the relative positioning
of symlinks compared to the sstate relocation paths. Whilst we could do this,
right now I'm favouring making this an error and fixing the small number of
problematic recipes we have in OE-Core (3).

(From OE-Core rev: cf94de4ddee3e5072da8608c9151301fcec02cd0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-09 10:52:03 +00:00
Richard Purdie 23d9886aae openssl/fontconfig/bzip2: Use relative symlinks instead of absolute ones (using a new class)
Absolute path symlinks are a bit of a pain for sstate and the native versions
of these recipes currently contain broken symlinks as a result. There are
only a small number of problematic recipes, at least in OE-Core, namely the
three here.

Rather than trying to make sstate handle this magically, which turns out to
be a harder problem than you'd first realise, simply make the symlinks relative
early in the process and avoid all the problems.

The alternative is adding new complexity to sstate which we could really
do without as without the complexity, you can't always tell where the
absolute symlink is relative to (due to prefixes used for native sstate).

(From OE-Core rev: e478550c8cd889f12e336e268e9e3b30827bf840)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-09 10:52:03 +00:00
Andre McCurdy 1baae2a0d1 image_types.bbclass: fix image dependency chain collection
If image type "foo" depends on image type "bar.xz", then dependencies
should be collected from the base image type (ie "IMAGE_DEPENDS_bar")
not from "IMAGE_DEPENDS_bar.xz".

(From OE-Core rev: 8a9f249a9166347cc0468191ce130003e3d306e1)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:10 +00:00
Andreas Oberritter 36e7717efe kernel-module-split: Allow custom suffix for package names
This makes it possible to restore the behaviour changed by commit 78cde87
"kernel-module-split: Append KERNEL_VERSION string to kernel module name".

(From OE-Core rev: 4aabdddf67859cd8518e5cb672fb391c859817e0)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:10 +00:00
Paul Eggleton 21ace8b620 classes/npm: set HOME during do_install
In do_compile we set HOME so that ~/.npm* only get created in the work
directory; we need to do the same in do_install as well or they'll go
into the user's home directory which we do not want.

(From OE-Core rev: a667cb9ed2dceb804b85d1a024e2619bc34d2681)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Paul Eggleton 014278d370 classes/populate_sdk_ext: account for custom image tasks
Any custom tasks that were added on the image between do_image_complete
and do_build were not being taken into account. Use the newly added
bb.build.tasksbetween() function to take care of that.

(From OE-Core rev: c966dee6208d3b7a9fa3c1b8aa1266058dcb65ff)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Paul Eggleton 1a9f33ccc7 classes/patch: switch to new bb.build.tasksbetween() function
A generic version of the code to work out the tasks between two
tasks (based on the code here) has been added to bb.build, so use that
instead.

(From OE-Core rev: 1226e2eb2678407c315befd5700e653602e616a0)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Paul Eggleton 4b870ed47b classes/populate_sdk_ext: remove unnecessary dependencies breaking SDK_TARGETS
Up until recently it was possible to set SDK_TARGETS to include a native
recipe you wanted installed into the sysroot when installing the eSDK.
I'm not sure what happened but now when you try to add a native recipe
to SDK_TARGETS you get a missing task error because this recipe has no
do_package_write_* task. Of course such a task dependency is erroneous
and is apparently caused by setting SDK_RDEPENDS. I've checked and it
turns out that we no longer need to set SDK_RDEPENDS anyway (probably
because we explicitly set up task dependencies further down in the
class, which I don't think we were fully doing in early versions of the
eSDK). Thus, drop setting this variable to restore the functionality.

(From OE-Core rev: fe8268ede33a8c76492b85da0f41062f47a5279c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Richard Purdie 529582a238 staging: Add missing parameter to debug message
(From OE-Core rev: 77ac40f8d4a4718b05f3692222a0dc91d90f0ab8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Richard Purdie ab78c782f7 staging: Improve file creation resiliance
If you abort a build mid execution of the staging extend_sysroot function
there are currently races and cleanup of that function may fail.

This change splits the code into separate phases so that the manifests are
manipulated before files are installed, meaning we should be able to reverse
actions if builds fail, crash or are interrupted.

(From OE-Core rev: fc504b6b8538453d2f058d7cc69be098f52f8091)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Richard Purdie 175a457032 staging: Add shared manifest support
(From OE-Core rev: 51834006476786f847b3ca60d5ed83a952fc64cb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Richard Purdie c8b280e8a4 staging: Don't put ptest files into the sysroot
This wastes space/time as the ptest files aren't going to be used in the
sysroot so add them to the blacklist.

(From OE-Core rev: 61591fe2eea588ff92ff7f81f2ed8844617f5307)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Ed Bartosh 791391e257 image_types_wic: remove dependency to do_bootimg
Removing task dependency do_wic -> do_bootimg as wic
doesn't depend on hddimg/booimg anymore.

(From OE-Core rev: af52d878940babb88bc8a2650e8c0115b6ccaf9f)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-05 09:22:18 +00:00
Ed Bartosh faa2823801 image: rename image-wic -> image_types_wic
Make name of the wic image type class consistent with
existing naming scheme for image types.

(From OE-Core rev: 4aab1b77d5f9403cbb3fae790069ef54821491fb)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-05 09:22:18 +00:00
Bruce Ashfield fcc40ac908 kernel-yocto: log the BSP definition file
When debugging a kernel configuration issue, one of the first questions
is "what BSP was used". To answer this qusetion, we log the BSP .scc
file that was used to generate the kernel configuration in the kernel
source meta directory.

(From OE-Core rev: 1003615b866bfe196994bdc25d305ff5eace2715)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-05 09:22:17 +00:00
Bruce Ashfield 80a74318de kern-tools: re-enable scc merge command
The ability to merge two branches directly from a .scc file was
dropped during the streamlining of the tools.

As was pointed out by David Vincent <freesilicon@gmail.com>, there is
once again a valid use case for this functionality, so we restore the
capability.

(From OE-Core rev: a0059ebbb52c659282e355664bba1a2fa282170e)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-05 09:22:17 +00:00
Richard Purdie f431f766a0 uninative: Make patchelf modified files sparse
When we switched to recipe specific sysroots (rss), performance took a nose dive. Its
easy to blame rss but it turns out not to be entirely at fault.

Three configurations are compared here:

a) Pre-RSS (revision 45df694a9f)
b) Post-RSS (revision 226a508da9)
c) as b) with this change

Overall build times:

a) 22794.25user 2687.88system 30:32.84elapsed 1390%CPU (0avgtext+0avgdata 919056maxresident)k
b) 22677.25user 3238.79system 36:16.68elapsed 1190%CPU (0avgtext+0avgdata 918896maxresident)k
c) 23571.84user 3383.65system 31:36.83elapsed 1421%CPU (0avgtext+0avgdata 919068maxresident)k

For the overall build and sstate directories, du -s shows:
a)
3992588   build-pre-rss/sstate-cache
30804484  build-pre-rss/tmp
b)
4013272   build-with-rss/sstate-cache
36519084  build-with-rss/tmp
c)
4014744   build-with-rss2/sstate-cache
35336960  build-with-rss2/tmp

However more worryingly:

$ du -s build-pre-rss/tmp/sysroots/
2506092 build-pre-rss/tmp/sysroots/
$ du -s build-with-rss/tmp/sysroots-components/
3790712 build-with-rss/tmp/sysroots-components/
$ du -s build-with-rss2/tmp/sysroots-components/
2467544 build-with-rss2/tmp/sysroots-components/

These numbers *should* be equivalent but as you can see, b) is ~1.2GB larger. The reason turned out
to be patchelf. Taking a specific binary from a specific recipe, bc from bc-native, in a) its 82kb
(stripped) yet in b) its 2.17MB.

$ ./patchelf --set-interpreter /bin/rp bc
warning: working around a Linux kernel bug by creating a hole of 2084864 bytes in ‘bc’

https://github.com/NixOS/patchelf/blob/master/src/patchelf.cc#L710 shows that this "hole" is just
padded zeros using memset, its not a proper sparse hole.

This patch copies files with cp --sparse=always after modifying them with patchelf, then replacing
the original file. The better fix will be to fix this in patchself itself and seek() there
when writing the new file but that means new uninative tarballs and will take a bit of work
so I'm proposing this workaround in the meantime.

Also, this patch drops error handling since subprocess check_output() tracebacks will print this
information if the command fails so we can simplify the code.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02 17:58:24 +00:00
Richard Purdie 85e9af9d78 staging: Reduce the number of mkdirs calls
The number of mkdir calls was showing up high on the profile charts since
it was getting called once per file which is excessive. Each call results
in one or more syscalls which is bad for performance. Cache which
directories we've seen to reduce the calls to a more reasonable number
and speed up recipe specific sysroots.

(From OE-Core rev: 680fb343be5d0a7f9abbe9c75ca232abe5871663)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-01 18:02:12 +00:00
Richard Purdie 758f18167f sstate/staging: Batch log messages for performance
According to profile data, repeated calls to bb.debug and bb.note in
the extend_recipe_sysroot() codepath were accounting for 75% of the time
(1.5s) in calls from tasks like do_image_complete.

This batches up the log messages into one call into the logging system
which gives similar behaviour to disabling the logging but retains the
debug information.

Since setscene_depvalid is also called from bitbake's setscene code,
we have to be a little creative with the function parameters and leave
the other debug output mechanism in place. This should hopefully
speed up recipe specific sysroots.

(From OE-Core rev: 3b0af8dc0f796345d1f1ba77ea35bbd090a5feb3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-01 18:02:12 +00:00
Richard Purdie e9256edb33 relocatable: Make native .pc files relocatable
The native .pc files currently have hardcoded paths in them meaning each has
to be relocated at final install time. pkg-config has built in functionality
to avoid this, namely the pcfiledir variable.

This function translates .pc files to use the variable meaning further
relocation later is unnecessary.

(From OE-Core rev: a3f4e9ff55c7d9eba175e83eb6c99cf349a74432)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 23:47:33 +00:00
Richard Purdie 2bb0b1d9b5 utils: Avoid need to relocate wrapper scripts
Whilst the path to the executable is dynamically determined, the passed in
environment variables or parameters are not relocatable and rely on the sstate
remapping code. In the recipe specific sysroot case this has become more costly.

This patch translates such paths into relocatable entries which means that
a sed replacement at final installation isn't needed.

(From OE-Core rev: 3e02a7cda0ba70e3f9886c5cce37d71361280b11)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 23:47:33 +00:00
Aníbal Limón 90b4e075f4 oeqa/runtime/cases: Rename syslog module to oe_syslog
Debian based distros has a builtin syslog module so when
try to load tests using unittest it references the builtin
module instead of runtime/cases.

[YOCTO #10964]

(From OE-Core rev: 9923e3cdb58c2b3c54ec5fe99b2cec4cdc9fff92)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 23:27:47 +00:00
Mariano Lopez 3eef8f7955 testimage.bbclass: Fixes about suites and dependencies
There are some missing suites on sato-sdk and lsb-sdk images so add it.

The createrepo-native needs to be built before run testimage in
order to create a repository from install packages.

The DL_DIR data also needs to be updated from the current bitbake
environment instead of use the value from testdata file.

[YOCTO #10964]

(From OE-Core rev: 42f3026b39519ba98ae3153329622ce670d57c09)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 23:27:47 +00:00
Patrick Ohly a15895dac1 populate_sdk_ext: fix == bashism
Found via verify-bashisms.

(From OE-Core rev: b690b8dc634844b4f6672d524f0e6f1d86dc4e20)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 15:28:41 +00:00
Ming Liu 5707949f03 rootfs-postcommands.bbclass: drop insert_feed_uris function
The source makes no reference to insert_feed_uris any more, simply drop
the unused reference, to avoid confusing the developers.

(From OE-Core rev: 26dddb7d4a4945abaaefd460a342de6abd609594)

Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:43:02 +00:00
Ming Liu e2280b9e12 meta: remove remaining True option to getVar calls
This is a complementary fix to commit 7c552996:
[ meta: remove True option to getVar calls ]

it intended to remove all True option to getVar calls, but there are
still some remaining.

Search made with the following regex: getVar ?\((.*), True\)

(From OE-Core rev: 87d03ffe03d6f01e360bfd51714be96e62506e0a)

Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:43:02 +00:00
Mariano Lopez 1e88c8fce4 testimage.bbclass: Allow to run tests on autobuilder's images
With the change to the new framework data store dependecy was
removed, instead a new file is generated and used in testimage.
When testing builds from the autobuilders the test data values
are from the autobuilder, including the paths.

Some tests require paths to current environment in order to run,
this commit will update such paths and fix the error of running
images donwloaded from autobuilders.

[YOCTO #10964]

(From OE-Core rev: 26ad5105fc2ce03b7ee8ecc6911fd40a52bd573a)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:43:01 +00:00
Ola x Nilsson 2e77eff6cc externalsrc: Hide created symlinks with .git/info/exclude
Add created symlinks to the exclude file.  This will both make them
less distracting and hide them from the srctree_hash_files function.

(From OE-Core rev: c11fcd6fbde4a90913960b223451e0ce9e6b4b64)

Signed-off-by: Ola x Nilsson <olani@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:43:01 +00:00
Kristian Amlie 2313a77d84 sstate: Make SSTATE_SCAN_CMD vars configurable using weak defaults.
For this we move them out of the python section so they can be
overridden on a per-recipe basis.

The motivation for this change is that not all tool chains need the
path modifications provided by the command, and these will provide
alternative or empty commands. The Go compiler is such an example.

(From OE-Core rev: 7d2a2160336413736dd4640f5b84ba4d74bb00f5)

Signed-off-by: Kristian Amlie <kristian.amlie@mender.io>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:43:01 +00:00
Ed Bartosh 5302fb4620 toolchain-shar-extract: compare SDK and host gcc versions
If ext sdk is built by gcc version higher than host gcc version
and host gcc version is 4.8 or 4.9 the installation is known to
fail due to the way uninative sstate package is built.

It's a known issue and we don't have a way to fix it for above
mentioned combinations of build and host gcc versions.

Detected non-installable combinations of gcc versions and
print an installation error.

[YOCTO #10881]

(From OE-Core rev: bfb9ea2604557804bd8c16adb57ccdd868a4020f)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:43:01 +00:00
Ross Burton e286829fcc package_deb: handle allarch when mapping tune to dpkg architectures
It was discovered that buildtools-tarball can't be built with Debian packaging:

E: Unable to locate package nativesdk-buildtools-perl-dummy

The package exists but dpkg doesn't see it because the Architecture field isn't
valid: for this package the Architecture field is 'allarch' which isn't in the
list of valid architectures we define.

package_deb already has a mapping of OE architectures (PACKAGE_ARCH) to dpkg
architectures (DPKG_ARCH), for example our x86_64 is amd64 in dpkg.  However
allarch.bbclass sets an invalid TARGET_ARCH of 'allarch' (to break anything
which attempts to use the target architecture) and package_deb relied on the
PACKAGE_ARCH check later turning the Architecture field into 'all'.

This usually works, but nativesdk-buildtools-perl-dummy inherits allarch but
then changes PACKAGE_ARCH to buildtools-dummy-nativesdk to isolate the packages
in a separate feed.  We can handle this by explictly checking for allarch in the
TARGET_ARCH check, as that everything that inherits allarch will want to have
Architecture: all in their packages.

[ YOCTO #10700 ]

(From OE-Core rev: 58a5771f20f7851816b5f39df0ada8f16438065c)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:43:00 +00:00
Ross Burton 9533e14e6f distrodata: add DATETIME to vardepsexclude for do_distro_check.
This task uses DATETIME so add it to vardepsexclude so bitbake doesn't refuse to
execute the task when the time changes between the controller and the worker
calculating the hash.

[ YOCTO #10960 ]

(From OE-Core rev: e6784ef0d56a1b297001bc59c0da3aecebd1c656)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:43:00 +00:00
Ed Bartosh 75df73526a grub-efi.bbclass: use 'grub-efi-' prefix
grub-efi recipe added 'grub-efi-' prefix to the file name of
efi binary. Changed grub-efi.bbclass accordingly.

(From OE-Core rev: 860c44435ea7cbbe3517d5ab9146213cc80fd0e7)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Ed Bartosh 6740b8fdbb isoimage-isohybrid: use TRANSLATED_TARGET_ARCH instead of MACHINE_ARCH
isoimage-sihybrid plugin uses MACHINE_ARCH to get the name of initrd image.
It doesn't work for all machines, for example for quemux86-64 machine
MACHINE_ARCH is quemux86_64 and initrd name is
core-image-minimal-initramfs-qemux86-64.cpio.gz

Used TRANSLATED_TARGET_ARCH variable to get the initrd image name.
Replaced MACHINE_ARCH->TRANSLATED_TARGET_ARCH in WICVARS variable to
make it available from <image>.env file.

(From OE-Core rev: edf0830412de66eada9ef3f3947ca42e301c5377)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Ed Bartosh 62310b3726 image-wic: remove HDDDIR from WICVARS
Removed HDDDIR as it's not used by wic anymore.
Stopped usage of HDDDIR in wic test suite.

(From OE-Core rev: b3ed3a79852f85651c8fa192a8118f9904e88ef8)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Ed Bartosh a508cb384c wic: use INITRD_LIVE in isoimage-isohybrid
INITRD variable is not set if hddimg is disabled.
isoimage-isohybrid can't get correct name for initrd if INITRD
variable is not set.

Added INITRD_LIVE to WICVARS and used it in isoimage-isohybrid
code to get initrd artifact name. Used INITRD if INITRD_LIVE is not set.

(From OE-Core rev: c672753be60550b15d5d593c251b61776d5b104d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Ed Bartosh 02dafba6ed image-wic: move wic code to image-wic.bbclass
There is a lot of wic code in image.bbclass and image_types.bbclass
Having all code separated in one file should make it more readable
and easier to maintain.

(From OE-Core rev: 786368568a9525212e69f5cbf6da236f0a6be013)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Ed Bartosh c01cc6ff24 wic: change location of .env files
Current location of .env files $STAGING_DIR/imagedata. It doesn't
depend on machine and be rewritten by the builds for different
machines.

Changed location to $STAGING_DIR/$MACHINE/imagedata to avoid .env
files to be rewritten.

(From OE-Core rev: 94245144f5cef344d90bc2a7b3267cdae9d192e4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Ed Bartosh 6d78ff1144 image_types: use correct output directory
Wic put result images into <output dir>/build, which was confusing.
Now it's fixed in wic code and images are put into output directory.
Changed code in image_types to reflect this.

[YOCTO #10783]

(From OE-Core rev: 3983507bf859f6c3c29e9dea06ffe51f42c0759c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Richard Purdie d45d4a5a21 staging: Handle stale sysroot rebuild issue
If a stale sysroot object was found the complete stamp wasn't removed,
meaning later code could fail when the new link creation was attempted.
Ensure the stale complete stamp is also removed if present.

(From OE-Core rev: d7d26488f252d60628862ee114a4404e8d6cb6f1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Richard Purdie f66f1af4b1 staging: Fix missing nativesdk do_populate_sysroot depends on binutils
Recent changes exposed the fact this dependency was missing in nativesdk
cases, fix this.

(From OE-Core rev: 46bd7e48cb5ae654d915fa493420534219682e85)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Richard Purdie 1d4c20ecc2 staging: Allow removal of stale sysroot objects
The main sysroot components of unreachable build targets will be removed by the core
code. This currently doesn't trigger a removal in the individual workdirs. This
adds in symlinking between the complete stamps and the component sysroot meaning
we can detect when someting was removed and hence remove it from the sysroot.

This fixes cases where DISTRO_FEATURES like systemd are changed amongst other
things and makes builds more robust against configuration changes.

If a dependency is rebuild, that is caught by checksum comparision code elsewhere
in this function as before.

(From OE-Core rev: 7656347c556915dc9acc5a2311ec4e879de6f43d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Richard Purdie a4274bcc37 staging: Drop common prefix WORKDIR from manifest files
Manifest files containing the same duplicated prefix are wasteful on space
and ultimately this costs build time. Drop the WORKDIR prefix from the manifest
files since this small change mounts up a lot.

(From OE-Core rev: 1cb245a99762e21a170b6a9beabb07e558424946)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Richard Purdie a90c8817a5 sstate: Allow sstate_clean_manifest to take a prefix
Manifest files containing the same duplicated prefix are wasteful on space
and ultimately this costs build time. Add support for manifest files with
common prefixes removed and use the prefix if the path isn't absolute.

(From OE-Core rev: 71e8c98238d627f9665faee9d7c226b9c07bd256)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Richard Purdie ab0f46400c gzip/pigz/expat/image: Simplify gzip-native/pigz-native
With recipe specific sysroots, the gzip-replacement-native dance/class
is obsolete, simplify the code accordingly.

(From OE-Core rev: 39865fdf3698a130f792d41853f9c9ca1901e335)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Richard Purdie e6e0ac4fb8 allarch: Drop STAGING_DIR_HOST expansion
Now that STAGINGDIR_HOST doesn't contain MACHINE, we no longer need to expand
the value. Pre-expansion can mean components like PV can be expanded too early
and cause problems for certain use cases.

(From OE-Core rev: d04f0363a1e8ae641da3e80ffbd4c8803cb1c91a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Richard Purdie 60662a2117 image/kernelsrc/packagegroups/recipes: Remove uneeded noexec tasks
We used to have issues removing tasks like do_fetch due to implications
for targets like world and universe. These have now been resolved.

Removing uneeded tasks has advantages compared to noexec since it means
that accidentally left in dependencies are no longer needed/processed
(e.g. do_patch depends on quilt-native).

This cleans up a number of cases which local analysis highlighted as
being unneeded leading to slightly cleaner task graphs.

(From OE-Core rev: 4e6ee37e09c60e83c0dfd844ba9cf8a07507f099)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Patrick Ohly 46ed698f05 image_types.bbclass: rebuild .wks file when .wks.in changes
WKS_FILE(S) can refer to .wks.in files which get expanded during the
build by do_write_wks_template. The actual content of the .wks.in file
gets added to the recipe meta data during parsing, and thus we need to
ensure that the recipe gets re-parsed when the file changes.

This fixes two related problems:
- editing the .wks.in file and rebuilding an image did not recreate
  the image unless something else changed or "bitbake -c clean" was
  used explicitly
- when forcing a rebuild, the cached meta data and the actual one
  do not match, leading to "ERROR: Taskhash mismatch ... for ....bb.do_write_wks_template"

(From OE-Core rev: d00b95b18237b276c221b16dfc511a6da150ef06)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Mariano Lopez a02f7f2a33 testimage.bbclass: Add systemd test automatically
This adds systemd test automatically when an image
is build with systemd DISTRO_FEATURE

[YOCTO #10935]

(From OE-Core rev: 2e6ba167bee7c7b42b1e0e96eb5a7be2eb0fd2c0)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26 10:44:27 +00:00
Ioan-Adrian Ratiu 6805ae0f2a useradd_base: keep group if it still has users
perform_groupdel() tries to delete a group irrespective if other
users have it as their primary group, thus the call to groupdel will
fail with the following error error:

groupdel: cannot remove the primary group of user '<user>'

Add a check to perform_groupdel() to determine if there are other
users and keep the group, printing a warning. This is called right
after a user is deleted to delete it's group. If the last user is
deleted, only then the group is also deleted.

(From OE-Core rev: bba1f02cb6d80279c6fed34bb18f010aa921fc1e)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26 10:44:27 +00:00
David Vincent fdaa2d181d useradd-staticids: Fix groupadd
When a group name is duplicated between USERADD_PARAM and
GROUPADD_PARAM, this class tries to add it twice which results in
failure of the groupadd command.

(From OE-Core rev: 5b84cc895500c28674d2a7b7c2dd618cf8fb30e9)

Signed-off-by: David Vincent <freesilicon@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26 10:44:27 +00:00
Joshua Lock 0eafcc05d8 toolchain-scripts: remove CCACHE_PATH from environment script
CCACHE_PATH was added to the toolchain-scripts in commit
1d31ddb856a80ba9da1a64ed5d701dc0f7351ef7 without a detailed
explanation as to why. This commit removes that environment
variable as it's causing failures since the introduction of
host_gcc_version() to oe.utils in
d36f41e5658bbbb6080ee833027879c119edf3e0, as used by
uninative to determine NATIVELSBSTRING.

This causes errors when the host has ccache available in in PATH
- host_gcc_version() fails because ccache has been told to only
look for the compiler in CCACHE_PATH and can't find gcc in order
to check its version. Toolchain compilers aren't detected due to
the binaries being prefixed with the triplet of the target.

(From OE-Core rev: e47fb403c2cb472d2666ed3ba4b10933467c8c7b)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26 10:44:27 +00:00
Khem Raj 27c106e087 autotools.bbclass: Change acpaths defaults to be a weak assignment
We currently have to override the default setting using a particular
assignment order in the recipe, setting it weakly helps to get rid
of this problem.

(From OE-Core rev: 57be81156f74666ff2ed2755f5faa48edf00e4dc)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26 10:44:27 +00:00
Richard Purdie da114c7d7d staging: Handle overlapping files for build-sysroot
The use of bb.fatal means build-sysroots fails as soon as multiple gdb's are
built with overlapping files, or multiple recipes with overlapping headers
exist.

Change the fatal call into an exception which we can then trap. Also
avoid trying to call readlink on something with isn't a symlink.

This allows build-sysroots to work better under various scenarios.

(From OE-Core rev: e20343a90e401bc92167867729076d321081d120)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26 10:44:27 +00:00
Richard Purdie 7fb3c6a40a image/packagegroup/populate_sdk: Drop do_populate_sysroot task properly
Setting do_populate_sysroot as noexec means the code keeps thinking it can find
a manifest file for it. It also complicates sstate installtion since the code
would believe there is an sstate object there it should look for.

Instead, delete the task. This causes sdk failures as the dependencies are wrong
so fix those as well.

(From OE-Core rev: bd7d0314038a4c1a8e8c9ebdb7194f8e17db3fef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26 10:44:27 +00:00
Richard Purdie 1cec0f3bf4 cross: Update MULTIMACH_TARGET_SYS to reflect modern recipes
Mixing PACKAGE_ARCH with BUILD_* has always seemed somewhat odd. This
comes into play when building different SDKMACHINES as the PN space
for the recipes did once overlap. With the modern build process we
use, this overlap is a thing of the past since PN has SDK_SYS appended
to it.

cross.bbclass sets PACKAGE_ARCH == BUILD_ARCH so this change only affects
crosssdk.bbclass where PACKAGE_ARCH == SDK_ARCH.

The current structure is quite confusing and this removes this artefact
of history, allowing other gcc cleanups rather than meaning we futher
complicate the code.

(From OE-Core rev: 525bbfd08dacba84c92da0ab34310a85369526b7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26 10:44:27 +00:00
Richard Purdie bb5fe4c35d staging/allarch: Remove hardcoded PACKAGE_ARCHS from the class
The code was making an assumption that the only PACKAGE_ARCH in use
was TUNE_PKGARCH. This is incorrect so iterate over the list from
PACKAGE_EXTRA_ARCH instead.

We also need to change allarch to preserve this variable, else the
staging code doesn't function. We do this in a way which clears the
variable history so that the task hashes remain unaffected.

[Thanks to Andrew Goodbody <andrew.goodbody@cambrionix.com> for
testing/fixing]

(From OE-Core rev: b1bab7a6eff6b195824be7d754de58c6e9ee2bfb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26 10:44:27 +00:00
Richard Purdie 6ab4c5033a classes/oeqa: Replace subprocess.check_call() with check_output()
If you use subprocess.check_output() the traceback will contain the output
when the command fails which is very useful for debugging. There is no
good reason not to use this everywhere.

(From OE-Core rev: ad750dd1cc9d789abe723daddd098ce41d8547f5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 23:30:57 +00:00
Richard Purdie 3b4a36be50 sanity/abi-version: Force a clean TMPDIR after recipe specific sysroot changes
With the recipe specific sysroots, we need a clean tmpdir, else pseudo-native,
openssl-native, subversion-native and serf-native need to be manually cleaned.
After these there are probably more places where software doesn't rebuild correctly
even if we pass in new parameters to it.

The simplest solution is to force people to start from a clean TMPDIR since
everything would rebuild anyway.

(From OE-Core rev: da58e27a0f8fc8200f1953f05888834abd79c9f8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 23:30:14 +00:00
Rick Altherr 4aa6644f92 kernel-fitimage: Use compressed ramdisks in FIT images if available
kernel-fitimage:fitimage_assemble() was calling copy_initramfs from
kernel.bbclass which decompresses the initramfs cpio.  Assume that if
INITRAMFS_FSTYPES includes a compressed cpio, that is what it desired in
the FIT image.

(From OE-Core rev: 842ad404b36e00c89f615a3f7db4a2d30062effa)

Signed-off-by: Rick Altherr <raltherr@google.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:23 +00:00
Robert Yang be60ae52f2 qemuboot.bbclass: add blank lines in comments
Add blank lines in comments to make it easy for readind and updating.

(From OE-Core rev: 3f3344d1c063b0013a9ae7203bac30ab8f4ea17c)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:22 +00:00
Robert Yang 9dd223bf18 runqemu: fixes for slirp, network device and hostfwd
Fixed:
- Add QB_NETWORK_DEVICE to set network device, it will be used by both
  slirp and tap.
- Set QB_NETWORK_DEVICE to "-device virtio-net-pci" in qemuboot.bbclass
  but runqemu will default to "-device e1000" when QB_NETWORK_DEVICE is
  not set, this is because oe-core's qemu targets support
  virtio-net-pci, but the one outside of oe-core may not,
  "-device e1000" is more common.
- Set hostfwd by default: 2222 -> 22, 2323 -> 23, and it will choose a
  usable port when the one like 222 is being used. This can avoid
  conflicts when multilib slirp qemus are running. We can forward more
  ports by default if needed, and bsp.conf can custom it.
- Use different mac sections for slirp and tap to fix conflicts when
  running both of them on the same host.

[YOCTO #7887]

CC: Nathan Rossi <nathan@nathanrossi.com>
CC: Randy Witt <randy.e.witt@linux.intel.com>
(From OE-Core rev: 7dddd090806914a62d977730440d803e48f44763)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:22 +00:00
Mariano Lopez 46ce0b5ef3 testexport.bbclass: Migrate testexport to use new framework
This migrates current testexport implmentation to use the
new OEQA framework.

[YOCTO #10686]

(From OE-Core rev: 92cb884c989460563a063b29d2be8b7acd20577e)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:21 +00:00
Mariano Lopez 58789be270 testimage.bbclass: Add package install feature
This allows to use the package install feature with
the new OEQA framework.

[YOCTO #10234]

(From OE-Core rev: 077dc19445574457769eb4f231de97e8059cb75e)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:20 +00:00
Mariano Lopez f8d7db1905 testimage.bbclass: Add support for package extraction
testimage support the installation of packages without a package
manager in the target. This adds support for package extraction
required to support the installation feature.

[YOCTO #10234]

(From OE-Core rev: 8c7335290cb00ed0683241249297ca573ebd353a)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:20 +00:00
Mariano Lopez 41e4db0eea runtime/cases/smart.py: Migrate smart tests
This migrates the smart test from the old framework to
the new one. This has its own commit because smart
test was using bb and oe libraries that are available
when exporting the test cases to run in a different host.

Because of the removal of bb and oe libraries index and
packages feeds creation will be managed in testimage bbclass.

[YOCTO #10234]

(From OE-Core rev: 8d64ac4208e8dcb8a6fde6ea2959c9b3edfe2172)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:20 +00:00
Mariano Lopez 3857e5c91d testimage.bbclass: Migrate class to use new runtime framework
This migrates testimage class to use the new framework. Most of
the code added here is to get rid off the data store dependency.

[YOCTO #10234]

(From OE-Core rev: 2aa5a4954d7610f31875ba7e655f25f8892517b6)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:20 +00:00
Aníbal Limón 2d34b08533 oeqa/utils/dump: Move get_host_dumper to OERuntimeTestContextExecutor class
To avoid getVar calls inside a utils module, also moves
get_host_dumper import inside testexport isn't needed.

[YOCTO #10231]

(From OE-Core rev: f8beaf94e943a8b20d146be47a756af312ef107c)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:20 +00:00
Aníbal Limón ba1aec3407 oeqa: Fix files handling on runtime tests.
Common files was move to oeqa/files from oeqa/runtime/files
because the same files are used across Runtime,SDK,eSDK tests.

(From OE-Core rev: f099302efe8f222c3e4ae3604429f5ede4fd8c67)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:19 +00:00
Aníbal Limón e5f05409d0 oeqa/runtime: Fix TargetBuildProject instances
TargetBuildProject was refactored to avoid bitbake dependency so
the instance don't allow to pass data store anymore.

classes/testimage: Export proxies before run tests

The TargetBuildProject based tests download archives from network.

(From OE-Core rev: e275f29de500a338a02402ecc570405309963b35)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:19 +00:00
Aníbal Limón 03d175f1fa classes/testsdk: Migrate to use the new OESDKExtTestContext
(From OE-Core rev: b254822dad850ce74563c83b7a9e31463501baa7)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:19 +00:00
Aníbal Limón 3fac2417dd classes/testsdk: Remove the need of TEST_LOG_DIR variable
The TEST_LOG_DIR was used for store sdk_target_log this log
contains the output of the run of build commands now that information
could be found also on log.do_testsdk under WORKDIR.

The log will continue to store into SDK_DIR instead of TEST_LOG_DIR.

(From OE-Core rev: 1c9ba4b698bab916d42b58255692a7bf3d773bbc)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:19 +00:00
Aníbal Limón 92c57a5db7 classes/testsdk: Migrates testsdk.bbclass to use new OESDKTestContext
The functionality provided is the same with imporvements on code
reuse and better interfaces.

(From OE-Core rev: 7a1ae3149965b162fb2c71fc7067e07a7a189249)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:19 +00:00
Aníbal Limón ad2168365f classes/populate_sdk_base: Add write_sdk_test_data to postprocess
This function will generates testdata.json per SDK type.

[YOCTO #10231]

(From OE-Core rev: bff1b66c6b88fd2d99d14cecba27ee2f7462711f)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:19 +00:00
Aníbal Limón 60e5310f56 classes/rootfs-postcommands: Add write_image_test_data
This function will generates testdata.json by image type.

[YOCTO #10231]

(From OE-Core rev: 4c0061422df472395ca0caa76ef92adb860f1167)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:19 +00:00
Ed Bartosh dc4a612e60 image.bbclass: put .env files to ${STAGING_DIR}/imgdata/
As STAGING_DIR_TARGET started to point to a recipe specific
sysroot wic is not able to add .env files when .wks file refers
to multiple rootfs recipes.

Used STAGING_DIR instead of STAGING_DIR_TARGET to make the
directory with .env files the same for all recipes.

(From OE-Core rev: 3797cfd7473d3f9b7c0d999dcf9cd9608c8c7c6c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:17 +00:00
Ed Bartosh d781747102 image_types: add RECIPE_SYSROOT_NATIVE to WICVARS
Added RECIPE_SYSROOT_NATIVE to the WICVARS for wic
to be able to access it when run from bitbake.

(From OE-Core rev: 3443ff47374c7e20ea54e838609b991f3f72810e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:17 +00:00
Ed Bartosh 06a4500004 image_types.bbclass: build wic-tools
Added dependency do_image_wic -> wic-tools:do_build to ensure
that all required tools are ready to use by wic.

(From OE-Core rev: 9f547605d2bec282c5679fb35cd5b28a37c5a0d5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:17 +00:00
Richard Purdie 9107d6ca14 Switch to Recipe Specific Sysroots
This patch is comparatively large and invasive. It does only do one thing, switching the
system to build using recipe specific sysroots and where changes could be isolated from it,
that has been done.

With the current single sysroot approach, its possible for software to find things which
aren't in their dependencies. This leads to a determinism problem and is a growing issue in
several of the market segments where OE makes sense. The way to solve this problem for OE is
to have seperate sysroots for each recipe and these will only contain the dependencies for
that recipe.

Its worth noting that this is not task specific sysroots and that OE's dependencies do vary
enormously by task. This did result in some implementation challenges. There is nothing stopping
the implementation of task specific sysroots at some later point based on this work but
that as deemed a bridge too far right now.

Implementation details:

* Rather than installing the sysroot artefacts into a combined sysroots, they are now placed in
  TMPDIR/sysroot-components/PACKAGE_ARCH/PN.

* WORKDIR/recipe-sysroot and WORKDIR/recipe-sysroot-native are built by hardlinking in files
  from the sysroot-component trees. These new directories are known as RECIPE_SYSROOT and
  RECIPE_SYSROOT_NATIVE.

* This construction is primarily done by a new do_prepare_recipe_sysroot task which runs
  before do_configure and consists of a call to the extend_recipe_sysroot function.

* Other tasks need things in the sysroot before/after this, e.g. do_patch needs quilt-native
  and do_package_write_deb needs dpkg-native. The code therefore inspects the dependencies
  for each task and adds extend_recipe_sysroot as a prefunc if it has populate_sysroot
  dependencies.

* We have to do a search/replace 'fixme' operation on the files installed into the sysroot to
  change hardcoded paths into the correct ones. We create a fixmepath file in the component
  directory which lists the files which need this operation.

* Some files have "postinstall" commands which need to run against them, e.g. gdk-pixbuf each
  time a new loader is added. These are handled by adding files in bindir with the name
  prefixed by "postinst-" and are run in each sysroot as its created if they're present.
  This did mean most sstate postinstalls have to be rewritten but there shouldn't be many of them.

* Since a recipe can have multiple tasks and these tasks can run against each other at the same
  time we have to have a lock when we perform write operations against the sysroot. We also have
  to maintain manifests of what we install against a task checksum of the dependency. If the
  checksum changes, we remove its files and then add the new ones.

* The autotools logic for filtering the view of m4 files is no longer needed (and was the model
  for the way extend_recipe_sysroot works).

* For autotools, we used to build a combined m4 macros directory which had both the native and
  target m4 files. We can no longer do this so we use the target sysroot as the default and add
  the native sysroot as an extra backup include path. If we don't do this, we'd have to build
  target pkg-config before we could built anything using pkg-config for example (ditto gettext).
  Such dependencies would be painful so we haven't required that.

* PKDDATA_DIR was moved out the sysroot and works as before using sstate to build a hybrid copy
  for each machine. The paths therefore changed, the behaviour did not.

* The ccache class had to be reworked to function with rss.

* The TCBOOTSTRAP sysroot for compiler bootstrap is no longer needed but the -initial data
  does have to be filtered out from the main recipe sysroots. Putting "-initial" in a normal
  recipe name therefore remains a bad idea.

* The logic in insane needed tweaks to deal with the new path layout, as did the debug source
  file extraction code in package.bbclass.

* The logic in sstate.bbclass had to be rewritten since it previously only performed search and
  replace on extracted sstate and we now need this to happen even if the compiled path was
  "correct". This in theory could cause a mild performance issue but since the sysroot data
  was the main data that needed this and we'd have to do it there regardless with rss, I've opted
  just to change the way the class for everything. The built output used to build the sstate output
  is now retained and installed rather than deleted.

* The search and replace logic used in sstate objects also seemed weak/incorrect and didn't hold
  up against testing. This has been rewritten too. There are some assumptions made about paths, we
  save the 'proper' search and replace operations to fixmepath.cmd but then ignore this. What is
  here works but is a little hardcoded and an area for future improvement.

* In order to work with eSDK we need a way to build something that looks like the old style sysroot.
  "bitbake build-sysroots" will construct such a sysroot based on everything in the components
  directory that matches the current MACHINE. It will allow transition of external tools and can
  built target or native variants or both. It also supports a clean task. I'd suggest not relying on
  this for anything other than transitional purposes though. To see XXX in that sysroot, you'd have
  to have built that in a previous bitbake invocation.

* pseudo is run out of its components directory. This is fine as its statically linked.

* The hacks for wayland to see allarch dependencies in the multilib case are no longer needed
  and can be dropped.

* wic needed more extensive changes to work with rss and the fixes are in a separate commit series

* Various oe-selftest tweaks were needed since tests did assume the location to binaries and the
  combined sysroot in several cases.

* Most missing dependencies this work found have been sent out as separate patches as they were found
  but a few tweaks are still included here.

* A late addition is that extend_recipe_sysroot became multilib aware and able to populate multilib
  sysroots. I had hoped not to have to add that complexity but the meta-environment recipe forced my
  hand. That implementation can probably be neater but this is on the list of things to cleanup later
  at this point.

In summary, the impact people will likely see after this change:

* Recipes may fail with missing dependencies, particularly native tools like gettext-native,
  glib-2.0-native and libxml2.0-native. Some hosts have these installed and will mask these errors

* Any recipe/class using SSTATEPOSTINSTFUNCS will need that code rewriting into a postinst

* There was a separate patch series dealing with roots postinst native dependency issues. Any postinst
  which expects native tools at rootfs time will need to mark that dependency with PACKAGE_WRITE_DEPS.

There could well be other issues. This has been tested repeatedly against our autobuilders and oe-selftest
and issues found have been fixed. We believe at least OE-Core is in good shape but that doesn't mean
we've found all the issues.

Also, the logging is a bit chatty at the moment. It does help if something goes wrong and goes to the
task logfiles, not the console so I've intentionally left this like that for now. We can turn it down
easily enough in due course.

(From OE-Core rev: 809746f56df4b91af014bf6a3f28997d6698ac78)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:17 +00:00
Richard Purdie 0ccdfb116e package_rpm: Clean up pointless exception handling
The exception handling in this function seemed mildly crazy. Python will
given perfectly good or in several cases better information if we let its
standard traceback/exception handling happen. Remove the pointless code.

(From OE-Core rev: 5ecdab6c2589a83bbbc522074052ff4438782102)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22 09:05:39 +00:00
Richard Purdie 2628a65ffe package_ipk: Clean up pointless exception handling
The exception handling in this function seemed mildly crazy. Python will
given perfectly good or in several cases better information if we let its
standard traceback/exception handling happen. Remove the pointless code.

(From OE-Core rev: 61390438aec4a1f9beb4d332821cc6cda82e0379)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22 09:05:39 +00:00
Richard Purdie 596c9eff21 package_ipk: Improve failure debug output
Currently if the dpkg-deb command fails you see an error message like this:

ERROR: nss-3.27.1-r0 do_package_write_ipk: opkg-build execution failed
ERROR: nss-3.27.1-r0 do_package_write_ipk: Function failed: do_package_ipk

which is pretty much useless. If we use subprocess.check_output, we see a
traceback and then:

Exception: subprocess.CalledProcessError: Command '<cmd>' returned non-zero exit status 1

Subprocess output:
<output>

which is much easier to debug from.

(From OE-Core rev: 64c8366a805e9cf0168ea2331c50c8d6a70c6dc4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22 09:05:39 +00:00
Richard Purdie fdb52ade90 package_deb: Clean up pointless exception handling
The exception handling in this function seemed mildly crazy. Python will
given perfectly good or in several cases better information if we let its
standard traceback/exception handling happen. Remove the pointless code
along with the duplicated key checking which was broken in the inner loop
by usage of the wrong variable.

(From OE-Core rev: f755b07b528e828618141eda402399d791efba4a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22 09:05:39 +00:00
Richard Purdie 53a3c58774 package_deb: Improve failure debug output
Currently if the dpkg-deb command fails you see an error message like this:

ERROR: nss-3.27.1-r0 do_package_write_deb: dpkg-deb execution failed
ERROR: nss-3.27.1-r0 do_package_write_deb: Function failed: do_package_deb

which is pretty much useless. If we use subprocess.check_output, we see a
traceback and then:

Exception: subprocess.CalledProcessError: Command '<cmd>' returned non-zero exit status 1

Subprocess output:
<output>

which is much easier to debug from.

(From OE-Core rev: 18160442869f56ee71538bc2dc60d7cb6c08c8a2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22 09:05:39 +00:00
Richard Purdie d6b3f722c7 populate_sdk_ext: Add wic-tools to BB_SETSCENE_ENFORCE_WHITELIST
wic-tools has tasks which would always rerun and not come from sstate
to ensure we have a correctly populated sysroot. This is low overhead
and can be ignored from an eSDK perspective.

(From OE-Core rev: b631fe91b3939b7981dbf62cb2fb70f7baebe403)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22 09:05:39 +00:00
Richard Purdie 60d8ca3e96 Revert "populate_sdk_ext: whitelist do_package tasks"
Since Paul reverted the sstate.bbclass change which was checking the sstate
mirror test results, this change should also not be needed anymore.

This reverts commit e30f5002c4.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22 09:05:39 +00:00
Richard Purdie a49ee524a9 utils: Factor out common multilib datastore creation function
This code is already used in two places and we need it in others so
turn it into its own function.

(From OE-Core rev: 2a57e1334ff261a7ab45084be0f217e2acfe99af)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-22 09:05:39 +00:00
Jussi Kukkonen fc7394fe2d kernel.bbclass: Add PACKAGE_WRITE_DEPS for postinst
The depmodwrapper dependency is not actually used by the class but
anyone using pkg_postinst_kernel-base() will need it.

(From OE-Core rev: e3f5290d8deba9b7cead73b52ac45a37228fece9)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:51 +00:00
Jussi Kukkonen b7d5e29dd7 fontcache.bbclass: Add PACKAGE_WRITE_DEPS for postinst
Qemu is used to run fc-cache on postinstall.

(From OE-Core rev: bd20404a78b258bb95df41066f844e08a21e53fa)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:51 +00:00
Jussi Kukkonen c8a488768b gconf.bbclass: Add PACKAGE_WRITE_DEPS for postinst
gconftool-2 is used during postinstall.

(From OE-Core rev: d4272e712fe26689f350142426c9893ffe088ddb)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:51 +00:00
Jussi Kukkonen 136e4781b3 gio-module-cache: Add PACKAGE_WRITE_DEPS for postinst
Qemu is used to run gio-querymodules on postinstall.

(From OE-Core rev: d5361cc25fb7dd749e69063be48275c52462f72c)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:51 +00:00
Jussi Kukkonen 1ceb9934b3 gsettings: Add PACKAGE_WRITE_DEPS for postinst
glib-compile-schemas is needed during postinstall.

(From OE-Core rev: e049427e09b51c09b55d7f1299a7b878fe21768a)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:51 +00:00
Jussi Kukkonen ef05d22456 gtk-immodules-cache: Add PACKAGE_WRITE_DEPS for postinst
Qemu is used to run gtk-query-immodules-* on postinstall.

(From OE-Core rev: 7103447b198a12a30fdee3f789ff9e0d81534d54)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:51 +00:00
Jussi Kukkonen c197a98cee mime.bbclass: Add PACKAGE_WRITE_DEPS for postinst
update-mime-database is used in postinstall.

(From OE-Core rev: 57d63e8e89980c53f40e12ca670fc3f58f7e4c0f)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:51 +00:00
Jussi Kukkonen 777ed33f44 update-alternatives.bbclass: Add PACKAGE_WRITE_DEPS for postinst
(From OE-Core rev: 00e1e87d0dcf13f3b30682f1fb066f7fa4eed205)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:50 +00:00
Jussi Kukkonen b699afaeb8 update-rc.d: Add PACKAGE_WRITE_DEPS for postinst
use_updatercd() will always return true in rootfs generation so
checking that is not required.

(From OE-Core rev: 0db5328ee2a80152904b9f82b738f92e9e38da55)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:50 +00:00
Richard Purdie b5a8679574 useradd: Add PACKAGE_WRITE_DEPS for postinst
The postinstall needs shadow-native, mark the dependency

(From OE-Core rev: f3140f9c9cb8ff7ea29d0b77a9bfac419a216cf4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:50 +00:00