Commit Graph

6348 Commits

Author SHA1 Message Date
Richard Purdie
8ae762ada1 sstate: Ensure a given machine only removes things which it created
Currently if you build qemux86 and then generic86, the latter will
remove all of the former from deploy and workdir. This is because
qemux86 is i586, genericx86 is i686 and the architctures are compatible
therefore the sstate 'cleaup' code kicks in.

There was a valid reason for this to ensure i586 packages didn't get into
an i686 rootfs for example. With the rootfs creation being filtered now, this
is no longer necessary.

Instead, save out a list of stamps which a give machine has ever seen in
a given build and only clean up these things if they're no longer
"reachable".

In particular this means the autobuilder should no longer spend a load of time
deleting files when switching MACHINE, improving build times.

(From OE-Core rev: 5634f2fb1740732056d2c1a22717184ef94405bf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-15 09:44:33 +01:00
Richard Purdie
65c8154f21 image: Add locale archive optimisation
Refactor the locale archive function from the SDK to also make it work during
general image creation. This reduces the size of the locales from 900MB to 220MB
in core-image-lsb-sdk.

The exception handling around subprocess was dropped as the standard subprocess
exception printing is better handled than the catchall exception.

(From OE-Core rev: 8ffd93bdb09b0a4a84b27dafcd684c6abba392ed)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-15 09:44:33 +01:00
Ross Burton
a316be88cd classes: sanity-check LIC_FILES_CHKSUM
We assume that LIC_FILES_CHKSUM is a file: URI but don't actually verify this,
which can lead to problems if you have a URI that resolves to a path of / as
Bitbake will then dutifully checksum / recursively.

[ YOCTO #12883 ]

(From OE-Core rev: e2b8a3d5a10868f9c0dec8d7b9f5f89fdd100fc8)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-14 11:36:31 +01:00
Richard Purdie
5784b20d13 package: Fix file copying to preserve sparse files
We want to preserve sparse files when building the system, add the option
to tar to ensure we do this when copying files.

(From OE-Core rev: d86da5ae386a8129a966a53901de160823f4d250)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-14 11:36:31 +01:00
Zhixiong Chi
ecd4ac1962 multilib-script: Fix ALTERNATIVE_${PN} overwrite issue
If multilib scripts handle more than one file per package, the variable
ALTERNATIVE_${PN} will be overwritten and there will be only one symbol
link file. Append to the variable to avoid this.

(From OE-Core rev: f474a7ed02acaffe5d0fcc67e06dde17fc8e4d0e)

Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-14 11:36:31 +01:00
Jaewon Lee
c0f9caeda5 kernel-yocto.bbclass: Adds oe-local-files path (devtool) to include directives
The devtool-source class moves all local files specified in SRC_URI to
an oe-local-files directory. When using devtool and a recipe space kernel-meta,
devtool modify throws an error because the paths the kernel-yocto class
is looking for feature directories in, don't include the oe-local-files
directory which devtool is using.

This patch checks for feature directories in oe-local-files,
and if present, adds that path to include directives.

[YOCTO #12855]

(From OE-Core rev: 4eceae7e3e6dab935e2cf49b75148139192fc6e7)

Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com>
Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-14 11:36:31 +01:00
Jaewon Lee
97684b24b3 devtool-source.bbclass: Support kernel-fragments/patch not in SRC_URI
When using a recipe space kernel-meta, scc files are added through
SRC_URI, but they may include corresponding kernel fragments or patches
that are not necessarily in SRC_URI.

For bitbake, this is not a problem because the kernel-yocto class adds
the path where the .scc file was found to includes which consequentially
makes the .cfg, .patch file available to the kernel build.

However, when using devtool, only files specified in SRC_URI are copied
to oe-local-files in devtool's workspace. So if the cfg/patch file is not in
SRC_URI, it won't be copied, causing a kernel build failure when trying
to find it.

This fix parses local .scc files in SRC_URI, copies the corresponding
.cfg/.patch file to devtool's workdir, and also adds it to local_files
so it is available when doing a devtool build for the kernel.

[YOCTO #12858]

v2: also supporting patch not in SRC_URI
v3: fix spacing issues

(From OE-Core rev: 5dffd5403664dfcc9e8e42fd3581d5cb70823d7e)

Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com>
Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-14 11:36:31 +01:00
Richard Purdie
79457a3e2b sstate: Remove DEPLOY_DIR_IMAGE from SSTATE_DUPWHITELIST
Replace the generic whitelist entry with entries for the three specific
'problem' cases in OE-Core. This means the general DEPLOY_DIR_IMAGE entry
doesn't mask problems for others as was recently encoutered by users
reported on irc. In the whitelisted cases they occur only in multilib builds
and the files are identical.

(From OE-Core rev: 05f6042a40bb772f7ce8d6819c5b2937d8c9808d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-14 11:36:31 +01:00
Richard Purdie
6bb9ac9c65 sstate: Add sstate usage summary to the build
Currently the user has no indication of how much sstate was already present
or that would be used by the build. This change adds some summary information
so that the user can see how much reuse is occurring. To fully work it
needs some extra information from a recent bitbake commit but this is
optional.

When combined with bitbake --dry-run this feature can be used to check
if sstate would be reused in a build.

[YOCTO #12749]

(From OE-Core rev: 596f76029ccb6f87c3b049552bd08f5034c41d9c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-08 10:52:00 +01:00
Joshua Watt
033fca1671 classes/sanity: Clean up getstatusoutput usage
Replace usage of oe.utils.getstatusoutput() with direct subprocess
calls.

(From OE-Core rev: 2f44b9b5babf8c95340b141917c1142081f1e594)

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>
2018-08-08 10:52:00 +01:00
Joshua Watt
24e9ed8bee classes/reproducible_build: Avoid dereferencing symlinks
Using os.path.getmtime() will dereference symbolic links in an attempt
to get the last modified time. This can cause errors if the target
doesn't exist, or worse map to some absolute build host path which would
make a build not reproducible.

(From OE-Core rev: fae23c72288068f90e2f357a8abf1384850c02ed)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-08 10:51:59 +01:00
Nathan Rossi
4ffc885788 devicetree.bbclass: User/BSP device tree source compilation class
This bbclass implements the device tree compilation for user provided
device trees. In order to use this class, it should be inherited in a
BSP recipe which provides the sources. The default setup enables
inclusion of kernel device tree sources (though can be disabled by the
recipe by overriding DT_INCLUDE or KERNEL_INCLUDE).

This provides an additional mechanism for BSPs to provide device trees
and device tree overlays for their target machines. Whilst still
enabling access to the kernel device trees for base SoC includes and
headers.

This approach to providing device trees has benefits for certain use
cases over patching the device trees into the kernel source.

* device trees are separated from kernel source, allows for selection of
kernel and or kernel versions without needing to explicitly patch the
kernel (or appending to the kernel recipes).

* providing device trees from separate sources, from the layer,
generated by the recipe or other recipes.

This class also implements some additional features that are not
available in the kernel-devicetree flow. This includes population of
device tree blobs into the sysroot which allows for other recipes to
consume built dtbs (e.g. U-Boot with EXT_DTB compilation), device tree
overlay compilation and customizing DTC compilation args (boot
cpu/padding/etc.).

(From OE-Core rev: 3874c3859c3515fc8440fa9e776a02ad6ff3135c)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Acked-by: Martin Hundebøll <mnhu@prevas.dk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-08 10:51:59 +01:00
Ross Burton
481833a693 toolchain-scripts: put TARGET_ARCH and TARGET_OS into environment
It's useful for the SDK to know exactly what TARGET_ARCH and TARGET_OS are,
specifically for SDK QA.

(From OE-Core rev: 0b5f1b0430efac8129bca330370d8818ea93bb39)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-07 12:13:03 +01:00
Ross Burton
05f2bf7970 cmake: fix linking in multilib SDKs
CMake, in it's infinite wisdom, when searching for libraries (using
find_library) will look inside the libraries PREFIX/lib, PREFIX/lib32, and
PREFIX/lib64.  In a multilib SDK more than one of these will exist (potentially
all three) and obviously for a given build configuration only one of those is
valid.  This search path is hard-coded deep inside CMake but by setting
CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX we can bypass it and set an explicit
lib<SUFFIX> to use.

Do this by writing ${baselib} into the environment file, and then stripping
"lib" from this to obtain the suffix in the cmake-specific environment script,
which is then read in the CMake toolchain.

(From OE-Core rev: 47160a8c51310f2b40cabf4c1910b5df6e0a15d6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-07 12:13:03 +01:00
Ross Burton
1dccb37d89 python[3]native: allow use of both native Python 2 and 3
Instead of both classes using ${PYTHON_PN} (which is set by python-dir and
python3-dir), hardcode the right values so that it is possible to inherit both
pythonnative and python3native at the same time.

If both are inherited then both native Pythons are available, but the last to be
inherited will be the one to set PYTHON.

(From OE-Core rev: 96ccdadb8473daa3c9c2e1cb42fbdff1edd270d6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-02 09:30:11 +01:00
Ross Burton
1b52a28de8 meson: don't dump full error log on failure
If the configure fails then we don't really want to see hundreds of lines of
test output (this would be similar to dumping out autoconf's config.log).  The
error includes the path of the full log if further debugging is required.

(From OE-Core rev: 09917f582aa1a7b752fa96303e06f9f4712a1d86)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-02 09:30:11 +01:00
Alejandro Enedino Hernandez Samaniego
b7c2c78580 multiconfig: Enable multiconfig dependencies on oe-core
This patch enables multiconfig dependencies (mcdepends) to be used on
recipes using the following format:

task[mcdepends] = "multiconfig:FROM-MC:TO-MC:PN:task-to-depend-on"

For the sake of simplicity consider the following example:

Assuming we have set up multiconfig builds, one for qemux86 and one for
qemuarm, named x86 and arm respectively.

Adding the following line to an image recipe (core-image-sato):
do_image[mcdepends] = "multiconfig:x86:arm:core-image-minimal:do_rootfs"

Would state that core-image-sato:do_image from x86 will depend on
core-image-minimal:do_rootfs from arm so it can be executed.

This patch makes modifications to bitbake.conf to enable mcdepends, and
to sstatesig and staging.bbclass to avoid conflicts between packages from
different multiconfigs.

[YOCTO #10681]

(From OE-Core rev: f71bfe833c657244d2fd07b3b71e86081d7d1c04)

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-01 10:07:22 +01:00
Richard Purdie
099625aacf package.bbclass: Fix hardlink preservation issue
Recent changes broke the preservation of hardlinks during processing due to a missing index.
Fix this, reducing the size of the git recipe packages in particular (it contains many hardlinks).

(From OE-Core rev: 28eeada955762f38ccbd1d26c53768364dbd1a5e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-31 22:47:35 +01:00
Richard Purdie
e3497cc22b multilib_script: Add support for multilib scripts
Whilst the package managers handle multilib ELF binaries well, they don't
handle scripts in the *bindir directories well. This adds support for
marking these up so that they can be handled using update-alternatives.

Its done this way so that non-multilib systems don't see any changes and
there is standardisation amongst the multilibs on how the alternatives are
named and prioritiesd. The priotitisation code needs to be added but this
change means there is somewhere to add it.

Recipe needs to set MULTILIB_SCRIPTS in the form <pkgname>:<scriptname>, e.g.
MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/file1 ${PN}:${base_bindir}/file2"
to indicate which script files to process from which packages.

libtool is used a as a reference to stop the libtool scripts conflicting
in a multilib case and allows the kernel-devsrc change to be merged.

(From OE-Core rev: 18e837433d07cfdce4019c13f682c6676425a2ad)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-31 22:47:35 +01:00
Hongxu Jia
ce31c498f8 distutils/distutils3: do not try to fetch code during do_configure
For distutils3, any setup.py invoking will cause setup_requires
argument to trigger a code fetching. Since the following commit
applied in oe-core, code fetching occurs during do_confugire
before the do_compile.
...
b805cef distutils: clean the build tree in do_configure
...

Refer what do_compile did, add var-NO_FETCH_BUILD to do_configure.

Sync with distutils3, add do_configure to distutils also.

[YOCTO #12084]

(From OE-Core rev: 9d556092fcc6f04c487afd126d52935bac133165)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-30 12:44:35 +01:00
Robert Yang
ac134ce9be testsdk.bbclass: check python module testtools and subunit
The testtools or subunit is not part of python's standard library, so check them
before use.

Fixed when they are not installed on host:
$ bitbake core-image-minimal -ctestsdk
Exception: ImportError: No module named 'testtools'

Now it can run with a warning:
WARNING: core-image-minimal-1.0-r0 do_testsdk: Failed to import testtools or subunit, the testcases will run serially

(From OE-Core rev: ae53461608c4e71533378369b3f623b4c9002e39)

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>
2018-07-30 12:44:35 +01:00
Martin Jansa
b521ee42e8 package.bbclass: append to FILERPROVIDES_*/FILERDEPENDS_* variables instead of setting them
* this allows to work around some of the issues with file-rdeps
* e.g. in my case I have /usr/lib/libmali.so.0.1 which according to rpmdeps
  provides only following libmali*
  libmali.so(LIBMALI_1.0)
  libmali.so.0.1
  but many users of this link with libmali.so directly and according to
  rpmdeps require libmali.so which causes file-rdeps for a lot of
  recipes
* I was using simple work around to just set:
  RPROVIDES_${PN} = "libmali.so libGLESv2.so libEGL.so"
  but that doesn't work well with multilib, because the value gets
  expanded with MLPREFIX and
  RPROVIDES_${PN} = "lib32-libmali.so lib32-libGLESv2.so lib32-libEGL.so"
  doesn't help at all.

[YOCTO #9217] Many unsolveable QA warnings from build-deps and file-rdeps

(From OE-Core rev: 01b9810ff1cea53ae321f6fbe760b83573ed78c0)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-30 12:44:34 +01:00
Paul Eggleton
1b56227d77 classes/package: fix variable name in comment
The variable is PACKAGE_WRITE_DEPS as seen in the default below the
comment.

(From OE-Core rev: 364449251ffe4ff2c11acaa258edcec244c38818)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-26 17:14:42 +01:00
Andre McCurdy
fe258fb84a autotools.bbclass: fix autoreconf bbnote commandline arguments
Leaving -Wcross out of the bbnote version of the autoreconf command
seems to be a long standing inconsistency (dating back to the very
first commit in oe-core) but there's no obvious reason to do so.

(From OE-Core rev: 40644b2b33db6332293543bb39e8d4da07cf8c54)

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>
2018-07-26 13:16:41 +01:00
Ross Burton
4f67aef1bf lib/oe: split out machine to ELF data dictionary
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-26 13:16:40 +01:00
Hongxu Jia
896b360746 distutils/setuptools, distutils3/setuptools3: improve reproducibility
- Unify var-DISTUTILS_INSTALL_ARGS in distutils and setuptools

- Supply "--root" directory to the "install" command, and use
  it as a prefix to strip off the purported filename encoded
  in bytecode files. (It strips build path prefix from .pyc files)

[YOCTO #8446]
[YOCTO #12084]

(From OE-Core rev: 21f0c5a50e00ac34975d79fd48f08730d8f19b15)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-26 13:16:40 +01:00
Hongxu Jia
8fdbb0381d distutils/setuptools-native, distutils3/setuptools3-native: do not try to fetch code during do_compile
If a python recipe is using setuptools and the setup_requires argument, where
setuptools will use easy_install to fetch the module if it isn't
present.

The build failed on a machine where a proxy was required, but succeeded on a
machine which had direct access to the internet

Add var-NO_FETCH_BUILD, and set it in distutils_do_compile which does not
allow to fetch code from internet during do_compile.

Example result:
...
ERROR: Do not try to fetch `pytest-runner1' for building. Please add its native recipe to DEPENDS.
Traceback (most recent call last):
  File "setup.py", line 56, in <module>
...

The improvement is flexible for test_requirements argument (used at
`setup.py test'), where use easy_install also.

[YOCTO #12084]
(From OE-Core rev: 57414f4a1c549e6faaa110e6e95ff601b05b7361)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-26 13:16:40 +01:00
Richard Purdie
ce5cd33a8a license_image: Fix race
The current code pokes into do_deploy manifests from do_image_complete when the
do_image_complete task may or may not depend upon the do_deploy tasks in question.
Often it gets lucky, sometimes it results in build failures.

To fix this, split the functionality to its own task which can have the correct
task dependencies. This means the data in BB_TASKDEPDATA is definitive, the other
code can be dropped, as can the IMAGE_EXTRATYPES do_populate_lic dependencies
from image.bbclass.

This fixes bugs which show up as:

NOTE: recipe linux-yocto-4.14.48+gitAUTOINC+d64aec9793_97c8063d2d-r0: task do_deploy: Started
ERROR: core-image-minimal-1.0-r0 do_image_complete: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:write_deploy_manifest(d)
     0003:
File: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/classes/license.bbclass', lineno: 33, function: write_deploy_manifest
     0029:        'w+').write(output)
     0030:}
     0031:
     0032:python write_deploy_manifest() {
 *** 0033:    license_deployed_manifest(d)
     0034:}
     0035:
     0036:python license_create_manifest() {
     0037:    import oe.packagedata
File: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/classes/license.bbclass', lineno: 191, function: license_deployed_manifest
     0187:        # It is necessary to mark this will be used for image manifest
     0188:        man_dic[dep]["IMAGE_MANIFEST"] = True
     0189:        man_dic[dep]["PN"] = dep
     0190:        man_dic[dep]["FILES"] = \
 *** 0191:            " ".join(get_deployed_files(dep_dic[dep]))
     0192:        with open(os.path.join(lic_dir, dep, "recipeinfo"), "r") as f:
     0193:            for line in f.readlines():
     0194:                key,val = line.split(": ", 1)
     0195:                man_dic[dep][key] = val[:-1]
File: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/classes/license.bbclass', lineno: 289, function: get_deployed_files
     0285:    """
     0286:
     0287:    dep_files = []
     0288:    excluded_files = []
 *** 0289:    with open(man_file, "r") as manifest:
     0290:        all_files = manifest.read()
     0291:    for f in all_files.splitlines():
     0292:        if ((not (os.path.islink(f) or os.path.isdir(f))) and
     0293:                not os.path.basename(f) in excluded_files):
Exception: FileNotFoundError: [Errno 2] No such file or directory: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build-st-730/tmp/sstate-control/manifest-qemux86_64-linux-yocto.deploy'

ERROR: core-image-minimal-1.0-r0 do_image_complete: Function failed: write_deploy_manifest
ERROR: Logfile of failure stored in: /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build-st-730/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/temp/log.do_image_complete.50537
NOTE: recipe core-image-minimal-1.0-r0: task do_image_complete: Failed
ERROR: Task (/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/recipes-core/images/core-image-minimal.bb:do_image_complete) failed with exit code '1'
NOTE: recipe linux-yocto-4.14.48+gitAUTOINC+d64aec9793_97c8063d2d-r0: task do_deploy: Succeeded

(From OE-Core rev: b54cdaea7844ee3bf0c39eb97cc7c4c17ed5818c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-25 16:48:27 +01:00
Richard Purdie
a6a865ba93 license: Split image license functions to a separate class
This means the image code is only included in image recipes through
the IMAGE_CLASSES variable.

This sets things up to allow us to fix image deploy dependency problems.

(From OE-Core rev: fd44b8b4b2484f2d35c7a0e749e7dc316d601989)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-25 16:48:27 +01:00
Richard Purdie
2dda838683 package: Use subprocess to be consistent with the rest of the class
Using 'sub' in one function just confuses things, standardise and fix
formatting of the parameters too.

(From OE-Core rev: a740c638148ed7236c49eed55ae9a15b94e55b9f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-25 16:48:27 +01:00
Richard Purdie
d8762a1ea7 Revert "relocate_sdk.py: remove hardcoded SDK path"
This reverts commit 6671a4d980c8bef8f402780a308f6c43a25044aa.

This breaks uninative tarball since the call of relocate_sdk.py from uninative.bbclass
wasn't updated to account for this change. It isn't clear what value that code could
pass in and this isn't simple to fix so revert until a better fix can be found
that doesn't break uninative.

(From OE-Core rev: b247392b4ced57cfe694656032f6a6723740a9e8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-25 16:46:56 +01:00
Richard Purdie
adea90740d package/package_manager: multiprocess_exec -> multiprocess_launch
After this replacement, the parent exception handling works so we don't
need subprocess wrapping with bb.error in the underlying functions.

The underlying contexts also have better module handling so the imports
can be cleaned up.

(From OE-Core rev: aa8260adf53139d776a2affe6118d28b295c1fab)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-24 11:52:27 +01:00
Richard Purdie
1d8924f172 package: Clean up getstatusoutput usage
Replace usage of oe.utils.getstatusoutput() with direct subprocess calls. The
call is just a wraper to the subprocess call of the same name and requires
the caller to handle exceptions themselves. We usually do this badly, failing
to show the output or the command or the return code.

Its much safer to rely on a call like subprocess.check_output() instead.

This also makes it easier to spot and remove cases where shell=True isn't
needed in a later cleanup.

(From OE-Core rev: 9f058857fb692f1251deb43bcaa7ed0120140093)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-24 11:52:27 +01:00
Richard Purdie
9928614e94 sstate/bitbake.conf: Use pigz if available
Currently the compression of sstate objects is single threaded. In the case
of ltp, this takes around 33s. If we add pigz into the list of non-fatal
HOSTTOOLS and then use if it available when building the sstate object,
this time drops to around 6s.

Since pigz is now widely available this is an optimisation we should
utilise.

(From OE-Core rev: 2de56aa0792ec93445130d801936a8ea643fad27)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-24 11:52:27 +01:00
Richard Purdie
e1ba46109e package: Call file to determine elf status in parallel
This allows the calls to is_elf (which calls file) to happen in parallel
allowing a speedup of do_package and do_populate_sysroot for native
recipes.

(From OE-Core rev: bbe0d3e26484f3f347262d40a8a9d415ce21fb43)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-24 11:52:27 +01:00
Richard Purdie
069a1c4a15 package: Refactor to remove isElf/is_elf function duplication
There are probably further cleanups needed here but this at least removes
the major code duplication between these two similar funcitons, keeping the
kernel module ".ko" extension check for efficiency to avoid opening and
reading file contents in the general case.

(From OE-Core rev: 7ad0c0d6ab12bebeac097fc0f5210c876dcfe9be)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-24 11:52:27 +01:00
Richard Purdie
e0ea2c7378 package: Allow parallel processing of shlib analysis
This function is a bit more invasive to add parallelism to but
allows the shlibs analysis to happen in multiple threads. In order
to return values correctly/safely the data types needed tweaking
to avoid lists and use immutable objects.

(From OE-Core rev: b5788fb1f795f2f35d1788d8311e12984ffb2122)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-24 11:52:27 +01:00
Richard Purdie
bc6b668e60 package: Allow parallel processing of debug splitting
Adjust the code so that the splitting of debug symbols from files happens
in parallel. To to this we need to move some path handling code into the
main function and pass more parameters in.

(From OE-Core rev: 9f0c2ed5d44a16e8268ac521236c4752f930f26a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-24 11:52:27 +01:00
Richard Purdie
0e6a662ba2 package: Don't use subshell to execute file
We don't need any functionality from the shell here, its just extra fork
overhead. Therefore remove it and use subprocess directly.

(From OE-Core rev: bcc03ea19e103f6aa93bada2f49fcc5cc7bc0790)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-24 11:52:27 +01:00
Richard Purdie
29482de968 package: Drop subshell usage for dwarfsrcfile generation.
The command for running dwarfsrcfiles is simple and does not need a subshell
for each execution. By expanding out this function to use check_output()
from subprocess and a list of arguments, the shell overhead can be dropped.

For recipes with lots of files this gives a significant saving.

(From OE-Core rev: 6334129dfbe266602fab70ce445641053a05be6c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-24 11:52:27 +01:00
Richard Purdie
3fa835d9bc package_ipk|deb: Use oe.utils.multiprocess_launch
The current code had broken exception handling due to the use of a
"traceback" variable as well as an import. Use the new library code
for this instead which reduces code duplication and has fixed/improved
exception handling.

The chdir code can be dropped since any directory changes are in other
processes now so there is no need for it here and the code no longer
changes directory.

(From OE-Core rev: bcd47389f4b1fc69d2bb4da01933bfa1fdcae092)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-24 11:52:27 +01:00
Richard Purdie
2245a94bb8 package: Rework PACKAGELOCK based upon sstate for do_packagedata
I think this lock dates from before we had sstate for do_packagedata.

Since WORKDIR is recipe specific and we write into WORKDIR, we no longer need
any write locks in the do_packagedata code itself, its handled by the sstate
task lock for the final copy in at the end. The final write lock can be simply
removed.

The only time we need read locking is when actually reading data from the
shared directory. We can therefore reduce the window the lock is held
significantly as well, hence improving the speed of packagedata tasks running
in parallel.

(From OE-Core rev: f7106cdf2190d9ec59132a1cb2bb431d653cd9c5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-24 11:52:27 +01:00
Ruslan Bilovol
bf5b43495a relocate_sdk.py: remove hardcoded SDK path
This patch removes hardcodes added to relocate_sdk.py
during SDK build, making it flexible and reusable.
Now default SDK path is passed to the script as
parameter rather then harcoded inside it.

This allows to reuse this script for multiple
relocations, and adds possibility to relocate
SDK multiple times

(From OE-Core rev: 6671a4d980c8bef8f402780a308f6c43a25044aa)

Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-24 11:52:27 +01:00
Oleksii Konoplitskyi
1d8c7fa369 package.bbclass: exclude packages as shlib providers
Some packages containing shared libraries might be registered
as shlib providers when they shouldn't (for example, the lib is for
their private use and must not generate any dependency).

EXCLUDE_FROM_SHLIBS is targeted at that, but it could be set
for entire recipe only.

This patch allows to set list of packages that are not candidates
for shlib providers.

Variable EXCLUDE_PACKAGES_FROM_SHLIBS is used, e.g.:
EXCLUDE_PACKAGES_FROM_SHLIBS = "glibc-ptest glibc-mtest"

Cc: Andrii Bordunov <aborduno@cisco.com>
(From OE-Core rev: 43be374a6deceeaf105794f034957c65bb6bec72)

Signed-off-by: Oleksii Konoplitskyi <okonopli@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-24 11:52:26 +01:00
Khem Raj
b297c1aa4b recipes: Enforce ARM ISA just for arm arches <= armv5
armv7+ used thumb2 ISA and it compiles fine with thumb2
issues are only when using thumb1 ISA

(From OE-Core rev: c0ef8a91f671f30acd92e2734144f7ddf1acda53)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-18 10:18:42 +01:00
Olof Johansson
a24e8944e7 spdx.bbclass: Encode strings before passing to hashlib
In python3, passing a unicode object to hashlib will result in an
exception that encourages you to encode it first.

(From OE-Core rev: b06a44f1081ea422a365e80bc79b2aeb2783d23f)

Signed-off-by: Olof Johansson <olofjn@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-18 10:18:42 +01:00
Olof Johansson
83b3e1463a spdx.bbclass: Make use of bb.utils' sha1_file()
The same functionality already exists within bitbake, so avoid
duplicating.

(From OE-Core rev: 978f5a8f16bf5942aad73d761df2a00aeb36339d)

Signed-off-by: Olof Johansson <olofjn@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-18 10:18:42 +01:00
Olof Johansson
ae7d14ab44 spdx.bbclass: Fix undefined variable error
The path variable is used in an error message a few lines later, but was
never defined.

(From OE-Core rev: 863ff90b788f66241860e27e1fd3a791b00984cc)

Signed-off-by: Olof Johansson <olofjn@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-18 10:18:42 +01:00
Olof Johansson
a60a3c11f4 spdx.bbclass: Replace deprecated string.replace with str.replace
The string.replace function is removed in python3. Instead, the str
method "replace" should be used instead.

(From OE-Core rev: 8538aabf62d866f36764b4b136ee8575308df690)

Signed-off-by: Olof Johansson <olofjn@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-18 10:18:42 +01:00
Ross Burton
8df7480d1c insane: optimise buildpath search
Instead of decoding every file we open as UTF-8 (with many errors as machine
code isn't UTF-8), convert the build path to the UTF-8 byte representation and
search for that instead.

(From OE-Core rev: ffb52d383bfe413cf31fef13663fe9937a146c76)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-18 10:18:42 +01:00
Paul Eggleton
8274ccae0d classes/buildhistory: properly process escaped chars from pkgdata
All values written out to pkgdata are escaped (see write_if_exists() in
package.bbclass). In practice there tend not to be characters that need
escaping except in the scriptlets (pkg_preinst, pkg_postinst, pkg_prerm
and pkg_postrm) where currently we still see the escape codes in the
corresponding files within buildhistory (e.g. \n and \t) and thus also
in the output of buildhistory-diff, hindering proper diffing of changes.
To fix this, when we read values from pkgdata and write them out to
buildhistory, we need to interpret the escape codes by doing the exact
reverse of what we do in package.bbclass.

(From OE-Core rev: c258379181a438cb01728d223b3d05e0ab205941)

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>
2018-07-18 10:18:41 +01:00
Paul Eggleton
2e8787593f classes/buildhistory: handle packaged files with names containing spaces
The FILELIST field of the package info file in the buildhistory
repository is a space-separated list of all of the files in the package.
If a name of a file packaged by a recipe contains a space character then
of course the result was that we didn't handle its name properly. To fix
that, use quotes around any filename containing spaces and at the other
end use these quotes to extract the proper entries.

Fixes [YOCTO #12742].

(From OE-Core rev: 801b705957dc683030d11393f43407d0b3506b6a)

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>
2018-07-18 10:18:41 +01:00
Richard Purdie
dd31a246aa populate_sdk_base: Use default value assignment for SDK_TITLE/SDKEXTPATH
This allows the user mode flexibility about centrally overriding these
rather than needing to do it on a per recipe basis.

(From OE-Core rev: b0fb5bbd5f62857c32b2e071bcac841f856b1f1b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-18 10:18:41 +01:00
Richard Purdie
da596a2ad6 testsdk: Enable multiprocess execution
This uses the new concurrenttest code to enable parallel test execution
if specified.

(From OE-Core rev: 07d19fb3adab7a8d83ba83d9a16395f70d7b7a47)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-18 10:18:41 +01:00
Richard Purdie
4e4958cba2 oeqa/core/threaded: Remove in favour of using concurrenttests
We have several options for parallel processing in oeqa, parallel
execution of modules, threading and mulitple processes for the runners.

After much experimentation is appears the most scalable and least
invasive approach is multiple processes using concurrenttestsuite
from testtools. This means we can drop the current threading code
which is only used by the sdk test execution.

oeqa/decorator/depends: Remove threading code

Revert "oeqa/sdk: Enable usage of OEQA thread mode"
This reverts commit adc434c063.

Revert "oeqa/core/tests: Add tests of OEQA Threaded mode"
This reverts commit a4eef558c9.

Revert "oeqa/core/decorator/oetimeout: Add support for OEQA threaded mode"
This reverts commit d3d4ba902d.

(From OE-Core rev: a98ab5e560e73b6988512fbae5cefe9e42ceed53)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-18 10:18:41 +01:00
Anuj Mittal
ebbd1e4a94 image-live: fix check for rootfs size with hddimg images
Currently we check if the rootfs.img size is greater than 4 GB and use
mcopy to copy it over to a hddimg, a FAT32 volume.

This results in problems when IMAGE_ROOTFS_SIZE is set to be exact 4 GB
(4294967296 bytes). mcopy uses the max offset/file size to be 4294967295
and as a result, it errors out without any warning to the user.

Change the 4 GB check to '-ge' to catch these cases. Since we allow
IMAGE_ROOTFS_SIZE to be in KBs, the maximum allowed is 4194303 KB. Also,
tweaked the error message to refer to wic too.

Fixes [YOCTO #12776]

(From OE-Core rev: 16956dacd4be2c64e5816ccb2b222b5b128838c9)

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-15 16:16:16 +01:00
Ross Burton
6fbddd24f4 distutils3: pass build arguments when doing a clean
We should pass the build arguments to setup.py when doing a clean, because
sometimes the arguments are required for setup.py get started.

(From OE-Core rev: f9324af88a99eca28b160fa31aa4516fd397e44b)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-10 17:33:00 +01:00
Ross Burton
7af5e3bad3 meson: improve code style
Use elif for consistency.

(From OE-Core rev: 2ad89f12c9819326b29588a8a6c642aaae990f18)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-10 17:33:00 +01:00
Martin Jansa
d0389bf1cd kernel.bbclass: move variables for kernel artifacts names to separate bbclass
* this makes it easier to access these variables from some other bbclass
  e.g. sdcard_image-rpi.bbclass in meta-raspberry where we need to know
  how some files in deploy are named, but we cannot inherit kernel.bbclass
  as it's used in image recipe not kernel recipe
* alternatively we can move these to bitbake.conf like similar image variables are:
  meta/conf/bitbake.conf:IMAGE_BASENAME = "${PN}"
  meta/conf/bitbake.conf:IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}"
  meta/conf/bitbake.conf:IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}"

(From OE-Core rev: 7d0ef0eaa1bfe97015a774c26f5791622e7e8b12)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-10 17:33:00 +01:00
Martin Jansa
c159b6249a kernel.bbclass: use the consistent naming schema for initramfs
* use INITRAMFS_BASE_NAME and INITRAMFS_SYMLINK_NAME variables, like
  other kernel artifacts are using
* use "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" instead of
  "${PV}-${PR}-${MACHINE}-${DATETIME}" to be consistent with other files
* allow to modify default symlink name with INITRAMFS_SYMLINK_NAME
  instead of currently used:
  initramfs_symlink_name=${type}-initramfs-${MACHINE}

(From OE-Core rev: 935b9d5a2bd12effad65f69a631ecff96b8bb553)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-10 17:33:00 +01:00
Martin Jansa
c5b70d7155 kernel-devicetree.bbclass: Fix and simplify instalation of DTB files
* add 2 new variables:
  KERNEL_DTB_BASE_NAME
  KERNEL_DTB_SYMLINK_NAME
  instead of reusing KERNEL_IMAGE_SYMLINK_NAME and than expecting that
  default value ${MACHINE} was being used in e.g.:
  DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`

* install normal DTB files only once even if there is multiple entries
  in KERNEL_IMAGETYPE_FOR_MAKE and don't prefix them with the type of
  the kernel image, use the KERNEL_IMAGETYPE_FOR_MAKE as a prefix only
  when installing them bundled with kernel or initramfs image.

* deploy the files from ${D}/${KERNEL_IMAGEDEST}/ instead of kernel
  build directory, so that we don't need to call
  DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
  again in do_deploy

* create all links in do_deploy task, because default KERNEL_DTB_BASE_NAME
  like KERNEL_IMAGE_BASE_NAME contains PKGR and PKGR is different in
  do_install and do_deploy, because kernel.bbclass calls
  meta/classes/kernel.bbclass:do_install[prefuncs] += "package_get_auto_pr"
  meta/classes/kernel.bbclass:do_deploy[prefuncs] += "package_get_auto_pr"

* the filenames are a bit different, but with separate variable it
  should be easier for other bbclasses which use these DTB files to
  find them correctly, just use either the cannonical name
  $dtb_base_name.$dtb_ext or $dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext
  because PKGR (and other PKG* variables) might be different in your
  task and kernel.do_deploy task.

* fix DTB files being deployed with incorrect filenames when
  KERNEL_IMAGE_SYMLINK_NAME isn't set to ${MACHINE}, e.g. instead of
  the default:
-rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 07:41 deploy/images/raspberrypi3-64/Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
lrwxrwxrwx 2 bitbake bitbake   64 Nov 20 07:41 deploy/images/raspberrypi3-64/Image-lirc-rpi.dtbo -> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
lrwxrwxrwx 2 bitbake bitbake   64 Nov 20 07:41 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo
  I was getting:
-rw-r--r-- 2 bitbake bitbake 1348 Nov 20 10:28 deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi.dtbo
lrwxrwxrwx 2 bitbake bitbake   37 Nov 20 10:28 deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi-master-20171120102653.dtbo -> Image-linux-raspberrypi-lirc-rpi.dtbo
lrwxrwxrwx 2 bitbake bitbake   37 Nov 20 10:28 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> Image-linux-raspberrypi-lirc-rpi.dtbo
  and e.g. sdcard_image-rpi.bbclass from meta-raspberrypi:
  37e4e18f4a/classes/sdcard_image-rpi.bbclass
  was failing in:
  mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::${DTB_BASE_NAME}.dtb
  because ${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb doesn't exist in my
  build, due to
  DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
  not replacing whole "${KERNEL_IMAGE_SYMLINK_NAME}" (read ${MACHINE})
  with just ${DTB_BASE_NAME}

* with this change applied the deploy dir looks like this:
-rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
lrwxrwxrwx 2 bitbake bitbake   74 Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
lrwxrwxrwx 2 bitbake bitbake   74 Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi-raspberrypi3-64.dtbo -> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo
  and works correctly even with DISTRO using different naming scheme

* the sdcard_image-rpi.bbclass still needs to be modified, I've provided
  updated version here:
  https://github.com/agherzan/meta-raspberrypi/pull/159
* mpc8315e-rdb.conf MACHINE in meta-yocto-bsp also needs small fix:
  https://lists.yoctoproject.org/pipermail/poky/2018-July/011436.html

(From OE-Core rev: 1860d9d3c62e2e94cd68a809385873ffd8270b6d)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-10 17:32:59 +01:00
Martin Jansa
85d1f532f3 kernel-devicetree.bbclass: Use lowercase names for shell variables
* just to make it more clear what is local shell variable and what is
  replaced by bitbake from the metadata and also to prevent the variable
  to be incorrectly expanded by bitbake if someone happens to define
  e.g. DTB_BASE_NAME

(From OE-Core rev: 98b0f13f0650d970aac7441e7fcfc1089570785f)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-10 17:32:59 +01:00
Jackie Huang
7c1adcc6d7 rootfs-postcommands: split ssh_allow_empty_password
"allow root login" should not be bundled in ssh_allow_empty_password,
because some distro may want only one of "allow root login" and "allow
empty password", so split it out into ssh_allow_root_login and add new
imagefeature allow-root-login so they can be controlled separately,
debug-tweaks will still include both of them.

(From OE-Core rev: 1ab494f06a12548a902298afabd0a842161ef10d)

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-09 22:48:38 +01:00
Joshua Watt
a4c1720eb3 classes/sstate: Remove unused argument
Removes an unused argument to pstaging_fetch()

(From OE-Core rev: ab0eb2bf0db6e7da7c9b9bb4d46621dbf76dcc2a)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-06 22:59:33 +01:00
Joshua Watt
660374adb6 classes/sstate: Remove trailing whitespace
(From OE-Core rev: dc7c181f231db1290ea7d7d5e42476e70a488d73)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-06 22:59:33 +01:00
Ross Burton
b11fc28a1c setuptools.bbclass: depend on python-setuptools
python-distribute is obsolete and is now simply a PROVIDES of python-setuptools,
so use the right name.

The identical change for setuptools3.bbclass was done in 2015 in 8922e60.

(From OE-Core rev: 87e38f0306400609aeac92bc13fd6f41d61e6271)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-06 22:55:02 +01:00
Ross Burton
1276f1755b meson: map mipsel TARGET_ARCH to mips for the cross file
Meson uses 'mips' for both big- and little-endian MIPS machines, so map mipsel
to mips.

(From OE-Core rev: 23734432a24da77aa838ad4bdcbcc294cde08348)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-06 22:55:02 +01:00
Chen Qi
ef98f64b71 testsdk.bbclass: set PREMIRRORS for kernel to speed up test
Currently if we do a testsdkext task for the image, it would take
very long time to finish. The time is mostly spent fetching kernel
source via network.

We have done some configuration in auto.conf, trying to make use
of own-mirrors.bbclass to avoid fetching kernel via network.

However, the solution normally does not work. Below is some log
from log.do_fetch.

  DEBUG: Fetcher failure: Unable to find file \
  file:///path/to/downloads/git2_git.yoctoproject.org.linux-yocto.git.tar.gz \
  anywhere.

The tar.gz file is not available. It is generated only if
BB_GENERATE_MIRROR_TARBALLS is set to "1". The default value of
BB_GENERATE_MIRROR_TARBALLS is "0", and according to the manual, users
need choose to set it to "1" only if they are trying to make a source
mirror. So generally, this var's value is "0".

Anyway, we do need to avoid fetching kernel source from network when
doing testsdkext. So set PREMIRRORS in auto.conf to achieve this.

After this change, the time reduces from 4209.131s to 1399.436s on
my local machine.

[YOCTO #12729]

(From OE-Core rev: fd18ddb0664f69d77681590774b0123251a98728)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-06 22:55:02 +01:00
Pablo Saavedra
303fb675f2 patch: Jail patch_task_patch_prefunc in classes/patch into the workdir
With PATCHTOOL=git patches the changes in the patch_task_postfunc
of the classes/patch. This works OK when the S dir is a Git repo
but doesn't if the source is a tarball.

The while condition in the patch_task_patch_prefunc must be
jailed into the WORKDIR. In the opposite, when you are executing
the recipe out of a Git subtree the function simply fails but when
your recipes are into a Git repo the patch_task_postfunc execute a
commit over your BSP local Git repo adding the changes in an
arbitrary Git repo found in the path from the SOURCE directory to
the '/'. This situation is highly probable in  cases like ~home
directories under the control of a .git repo or Yocto BSP which
manage the meta layers as git submodules.

This patch fix the changes introduced in

  classes/patch: when PATCHTOOL = "git" double-check the repository
  commit: 86ab56b551
  Author: Paul Eggleton <paul.eggleton@linux.intel.com>
  Date:   Tue Dec 5 14:36:58 2017 +1300

  classes/patch: when PATCHTOOL = "git" double-check the repository

  If a bug is present or the user has set PATCHTOOL = "git" on a source
  tree that isn't git, if we try to perform git operations (such as
  committing or changing branches) when extracting source, then we might
  in fact be running those operations on the metadata repository if the
  build directory is underneath, say, poky or OE-Core, and that could
  make a mess. Check if the source tree is a git repository and refuse
  to continue if it isn't.

(From OE-Core rev: db6ce9d8838b1f9064604654ab579da3e237f361)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-06 22:55:02 +01:00
Ross Burton
2d28e8370e distutils: clean the build tree in do_configure
base_do_configure() tries to do "make clean" if there is a Makefile present.
For most recipes using distutils there is not a Makefile, but we do know that
"setup.py clean" will work so call that instead.

(From OE-Core rev: b805cefb24566772a2beb5d02036266e45370913)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-06 22:55:02 +01:00
Martin Jansa
8b92648246 Revert "kernel-devicetree: Corrected normalize_dtb"
This reverts commit 2e7f3b2b9318d1e5395ad58131eafb873f614326.

It was breaking quite common use case that the dtb files are in
some subdirectory and then kernel build fails to build them.

As reported by khem:
http://lists.openembedded.org/pipermail/openembedded-core/2018-July/152578.html
me:
http://lists.openembedded.org/pipermail/openembedded-core/2018-July/152579.html
on raspberrypi3 build:

make[3]: *** No rule to make target 'arch/arm/boot/dts/dwc2.dtbo'.  Stop.
arch/arm/Makefile:345: recipe for target 'dwc2.dtbo' failed
make[2]: *** [dwc2.dtbo] Error 2
Makefile:146: recipe for target 'sub-make' failed

and trevor on the IRC:
20:35:49 < tlwoerner> the recent 2e7f3b2b9318d1e5395ad58131eafb873f614326 commit in oe-core seems to cause dragonboard-410c's kernel to fail to build
20:36:26 < tlwoerner> for the dragonboard-410c, KERNEL_DEVICETREE is set to "qcom/apq8016-sbc.dtb" but the build failure is:
20:36:37 < tlwoerner> *** No rule to make target 'arch/arm64/boot/dts/dts/qcom/apq8016-sbc.dtb'.  Stop.
20:36:44 < tlwoerner> i.e. the "qcom/" is getting removed
20:37:08 < tlwoerner> oops!!
20:37:33 < tlwoerner> wrong copy&paste, the actual error is:
20:37:36 < tlwoerner> *** No rule to make target 'arch/arm64/boot/dts/apq8016-sbc.dtb'.  Stop.
20:37:53 < tlwoerner> i.e., the "qcom/" is being stripped out

(From OE-Core rev: 0d725c76c113dec441a7319a6ee997e4ae8c4c88)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-05 11:39:06 +01:00
Chunrong Guo
b6bb7e1345 kernel-fitimage: add support for ext2.gz initramfs files
(From OE-Core rev: e2e0c91c2c8229d9ed0958de98b5a9b14c6805d1)

Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-05 11:39:06 +01:00
Ross Burton
5193aedb45 meson: map architecture to correct values in cross file
The cross file specifies the host/target cpu_family, which should be one of a
defined set of values[1] but if it isn't Meson won't complain and instead
recipes may behave unexpectedly.

[1] http://mesonbuild.com/Reference-tables.html#cpu-families

(From OE-Core rev: e33b902a1dc4294dac148715f4d3ca5b0a6ee1b7)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-05 00:22:08 +01:00
Ross Burton
c2ba7177f1 meson: various class improvements
- Ensure that the PACKAGECONFIG arguments are always in EXTRA_OEMESON

- Log the arguments that are being passed in do_configure.

- Do verbose builds so the compile logs are useful for debugging build problems

(From OE-Core rev: 3112ff268d095a65ecb893dd6ca88a85b0f70446)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-05 00:22:08 +01:00
Richard Purdie
0118f01787 multilib: Tweak previous cross-canadian multilib fix
As well as setting RECIPE_SYSROOT we also need to set STAGING_DIR_HOST/TARGET.

(From OE-Core rev: 59a0a05235d80c86251cf45d7142bfc57f2e70d2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-04 00:02:17 +01:00
Richard Purdie
f755066a00 staging: Always use the default sysroot for allarch recipes
Without this, recipes can't find allarch data files like autoconf-archive.

(From OE-Core rev: 8ae70703f68853a8714a4fb8fa5d959b5e21a02d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-04 00:02:17 +01:00
Paulo Neves
396e269c5c kernel-devicetree: Corrected normalize_dtb
The normalize_dtb function was buggy because
it only converted from .dts suffix to .dtb
suffix if the user passed a full source path to
KERNEL_DEVICETREE containing the /dts/ path.
The problem is that if the user did that there
would be a warning.

On the othet hand if user just set the variable
KERNEL_DEVICETREE="file.dts" the bbclass translation
to the respective .dtb target did not occur and
make would fail saying it has no rule to make target
file.dts

This patch decouples the logic of having /dts/ in the
path from the target translation.

(From OE-Core rev: 2e7f3b2b9318d1e5395ad58131eafb873f614326)

Signed-off-by: Paulo Neves <ptsneves@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-04 00:02:17 +01:00
Alex Kiernan
bba7c19eeb kernel-fitimage: Make DTB key insertion optional
If UBOOT_DTB_BINARY is empty, then don't try inserting the U-Boot
signing keys into the DTB. In this configuration the keys are expected
to be already present in U-Boot's DTB.

(From OE-Core rev: a0d74767f7bd18c853df6b0be162363076d8f965)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-04 00:02:16 +01:00
Richard Purdie
9fff2b5a75 multilib: Fix issues with some cross-canadian toolchain sysroots
MACHINE = "qemumips64"
MULTILIBS = "multilib:lib64 multilib:lib32"
DEFAULTTUNE = "mips64-n32"
DEFAULTTUNE_virtclass-multilib-lib64 = "mips64"
DEFAULTTUNE_virtclass-multilib-lib32 = "mips32r2"

bitbake core-image-minimal -c populate_sdk

Results in gcc-cross-canadian-mips failing to build due to the use
of an incorrect sysroot, fix this. All nativesdk pieces should be in
the same sysroot (unprefixed).

(From OE-Core rev: ae48ee6627e6c1c4f1fcc4ead40edc968e64f7fe)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-02 21:37:47 +01:00
Richard Purdie
6ca693f284 staging: Improve fixup processing code
With the fixes to other parts of multilib, it was found that the fixup code's
assumptions about the recipe sysroot were incorrect. We need to use the value
calculated earlier in the function.

It turns out there is a rather neat way to do this which cleans up the code
as an added bonus.

(From OE-Core rev: 2c1978fe1a5b72167c49010fbdd39a9e2eefdef8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-02 21:37:47 +01:00
Richard Purdie
29353297b5 classes/utils: Improve all_multilib_tune_values
Currently there is duplication in the code, we can clean this up
by extending the multilib variants list.

This code also currently fails its its called from an existing multilib
context since its assumes the data store passed in is the non-multilib
case. When building an image, say lib32-core-image-sato, this leads to
incorrect PATH values.

To fix this, we also request a data store for the "" variant allowing
this corner case to be fixed and for the function to correctly return
values for each multilib even when a multilib is already selected.

(From OE-Core rev: cc1c481560b81c223170230430308c7e2f08c812)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-02 21:37:47 +01:00
Richard Purdie
f1079cd193 staging/image: Fix multilib recipe sysroot issues
Currently if you enable multilib, then build an image, the multilib
recipe sysroot is build in the wrong WORKDIR. If you then clean and
rebuild the image you see "file exists" errors.

This patch ensures the real WORKDIR is used consistently and then
cleans/rebuilds also work correctly.

(From OE-Core rev: c013ae59a158378d06ecf8eb123df0a10bf986b4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-02 21:37:47 +01:00
Alp Özmert
42b3761274 license: Fix and extend recommendations for license packages.
Changed package recommendations so that the license package of a
recipe is recommended for all packages of a recipe instead of for one
package given by the recipe name.

Pre-patch behaviour results in a missing recommendation when a recipe
does not have a package with the same name.

(From OE-Core rev: 07343ff6282dd18432ecee5d9b80ad1fb86217f1)

Signed-off-by: Alp Özmert <info@ib-oezmert.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-02 21:37:47 +01:00
Andre McCurdy
3fcec2cfa2 bitbake.conf: handle cmake -dev files packaging with default rules
Move packaging rules for cmake -dev files from cmake.bbclass into
bitbake.conf to handle recipes (e.g. harfbuzz 1.8.1) which build with
autotools but also install cmake -dev files.

(From OE-Core rev: 543e39ad5e2baa0f1ece013a89483783e6b15dd9)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-28 12:26:54 +01:00
Olof Johansson
16f060c56f insane.bbclass: Don't let warnings make previous errors non-fatal
package_qa_handle_error() returns True on non-fatal issues and False on
fatal issues. But the current usage has been to do

  sane = package_qa_handle_error(...)

which would always reset sanity status to be that of the last issue
identified. This change the assignments to use the &= operator instead:

  sane &= package_qa_handle_error(...)

As far as I can tell, this is not a real problem in practice, because
warnings of different levels (WARN_QA, ERROR_QA) does not seem to have
been mixed in a way that triggered this issue.

(From OE-Core rev: 21d015f6c9927598d64c48c925638619b25cf232)

Signed-off-by: Olof Johansson <olofjn@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-28 09:22:35 +01:00
Olof Johansson
fed27b0945 insane.bbclass: Make missing license file fatal
If a license file referenced from LIC_FILES_CHKSUM doesn't exist,
insane.bbclass would output an error message, but would continue the
build. This change makes this error fatal (as I suspect has been the
intention).

(From OE-Core rev: da29440633706fb7a346391d97894d6f2cbb0d01)

Signed-off-by: Olof Johansson <olofjn@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-28 09:22:35 +01:00
Alex Kiernan
8d33b69ed0 kernel: Set SOURCE_DATE_EPOCH to kernel git timestamp if not set
If SOURCE_DATE_EPOCH is unset (in addition to the existing "0" behaviour)
parse out the top most commit timestamp from the kernel tree to use as the
timestamp.

(From OE-Core rev: 2f0dd67a5a8d4269f5155004d532d8fa972b3223)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-28 09:22:35 +01:00
Alex Kiernan
3c46673100 image: Set COREBASE as the git directory for timestamp
When REPRODUCIBLE_TIMESTAMP_ROOTFS is unset and we want to parse one
from git, use COREBASE as the base for the git command so we have a
known repository which we're using. Without this the build may fail
if the current directory is not part of a git repository.

(From OE-Core rev: 1c2197f96d69547e10b74dc722d9a569d9a2b2b6)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-28 09:22:35 +01:00
Damien Riegel
cd928d3a98 systemd: escape paths passed to shell
Systemd mount configuration file must have a name that match the mount
point directory they control. So for instance, if a mount file contains

    [Mount]
    ...
    Where=/mnt/my-data

The file must be named `mnt-my\x2ddata.mount`, or systemd will refuse to
honour it.

If this config file contains an [Install] section, it will silently fail
because the unit file is not escaped properly when systemctl is called.
To fix that, make sure paths are escaped through `shlex.quote`.

(From OE-Core rev: bbd9524256461f1bcafd4103edd575e668de76f8)

Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-27 13:55:22 +01:00
Ross Burton
a947ebce96 mirrors: add Debian snapshot mirror for 2018
Add a Debian snapshot mirror from 2018 (specifically, 10th March, the date 9.4
was released) to DEBIAN_MIRRORS.

(From OE-Core rev: f3f394913b4e4a7c601ad1158faaf8b9d493e1c7)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-27 13:55:21 +01:00
Richard Purdie
1bbcc5931e bitbake.conf/testimage: Add in compatiblity hacks
The testimage changes break the autobuilder. The plan is to revert these hacks
but due to various changes happening with the autobuilder, we need these for now
to keep things working until we can move to the new autobuilder codebase.

(From OE-Core rev: 309a02931779f32d1139cc1169a039cbe4638706)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-21 09:34:40 +01:00
Richard Purdie
fae0a9a439 image/testimage: Rework auto image test execution
The TEST_IMAGE interface has never particularly worked and image testing currently
gets configured manually.

This reworks the interface to better serve the needs of its users, replacing it
with TESTIMAGE_AUTO.

This does away with the need for the separate class due to better bitbake APIs for
changing tasks.

TESTIMAGE_AUTO will automatically boot under qemu any image that is built. It
also adds in dependencies so that any SDK for which testing is requested will
automatically be built first.

The code in bitbake.conf was error prone (e.g. testsdk wasn't considered), this
improves it to standardise on IMAGE_CLASSES as the standard configuration mechanism.

(From OE-Core rev: b34d44f3dfea8254826a46701a4fe3769a900434)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-21 09:34:40 +01:00
Richard Purdie
83d791089f image/image-live: Improve handling of live/iso/hddimg types (drop NOISO/NOHDD)
The logic can be improved and the historical NOISO/NOHDD variables
moved into the class and out of common code.

The variables are also then removed in favour of directly controlling
the behaviour from IMAGE_FSTYPES in line with all the other image types.

(From OE-Core rev: a052caed563a09a01f5a3ea1f0477f379c05bee0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-21 09:34:40 +01:00
Richard Purdie
25a2244265 image: Combine all the class handling code into a single section
Right now the code handling class inherits is spread all over and
its hard to get an idea of what is happening overall. Combine all
the code together to make it clearer. There shoould be no functionality
changes.

(From OE-Core rev: 9b6cda7ff443eebfc5a5a8c9442c93a881807dab)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-21 09:34:40 +01:00
Richard Purdie
52b11deeb9 rm_work: Simplify looping code
The current looping structure is confusing, simplify it a bit
to improve readability. Should be no functionality changes.

(From OE-Core rev: 498065b51b205b43d7dae1008014eba85a8f138c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-21 09:34:40 +01:00
Richard Purdie
79f6fa34ae rm_work: Improve code comments
This function is a little obtuse, add more comments about what its
doing and why. Also combine some of the statements where possible
to improve clarity.

(From OE-Core rev: 3e0c22e9bd9757cd458a073a3f043a48184d7bab)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-21 09:34:40 +01:00
Richard Purdie
3b78eebd09 rm_work: The do_setscene task has not existed for years
Once, there were do_setscene tasks but this hasn't been the case for years,
drop the old code.

(From OE-Core rev: b13a691f1cfc0d68a0f94c343fa3a1b987dbe117)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-21 09:34:40 +01:00
Richard Purdie
80443c42fd rm_work: Stop appending _setscene to do_image_complete_setscene stamps
This is a reworked version of the issue which 5479654eea
attempted to fix.

"""
Each time I build my image after the first, I end up with a
do_image_complete_setscene stamp file with an extra _setscene appended to
the name. Eventually, the filenames end up being so long that mv complains
and the build fails.

It looks like this behaviour was introduced when the special handling was
added for do_image_complete in 2ff9d40dc88d43567472218cf3d3faf414398c71.
"""

Instead of the original approach which broke do_package_setscene, add
an entry to explictly stop the stacking _setscene pieces on do_image_complete.

It's not straightforward to just move *do_image_complete* after the
*_setscene* pattern because do_image_complete stamps would then match
do_image*.

(From OE-Core rev: 0f4e734e0ef40076351ed7ff795aac36197e4949)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-21 09:34:40 +01:00
Richard Purdie
2869b56efa Revert "rm_work: Stop appending _setscene to do_image_complete_setscene stamps"
Whilst this fixes the do_image_complete_setscene append problem, it creates a
new problem since the code can no longer reach the *do_package_setscene.*
code block below it. This breaks builds as per [YOCTO #12765]. Revert this
change in search of a better fix.

This reverts commit 5479654eea.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-21 09:34:40 +01:00
Alexander Kanavin
bdfca89b80 image.bbclass, populate_sdk_base.bbclass: make all variants of qemuwrapper-cross available in sysroots
The variants are needed in particular when executing postinst_intercepts as
those may require running binaries built for different architectures and
against different sets of library paths, when multilib is in use (or nativesdk host
packages are installed), so a single global variant of the script was not working.

I do understand expanding PATH and DEPENDS in this manner is hackish, however
every other approach I could think of is worse.

(From OE-Core rev: 2f31eecc40ea4d0865aa28d65a0ba7d5a629393a)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18 11:07:58 +01:00
Alexander Kanavin
87631af640 qemuwrapper-cross: enable multilib and nativesdk variants of the script
Previously only one global variant of the script was created,
which caused numerous issues:

1) multilib was not properly supported due to multilib variants each
needing their own version of the qemu binary and library paths to be set
2) nativesdk was not properly supported for the same reason

This patch also moves setting LD_LIBRARY_PATH directly into the
recipe, as passing it down from other recipes did not work when
said recipes were allarch, and adjusts calls to qemuwrapper from
postinst-intercepts, so that its correct variant is selected.

Also, the various qemu fallbacks in qemuwrapper script are all removed,
as they are no longer necessary.

(From OE-Core rev: d10fd6ae3fe46290c6e3a5250878966d9f12ca3f)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18 11:07:58 +01:00
Alexander Kanavin
4f3b7477a3 gtk-immodules-cache.bbclass: convert cache creation to postinst_intercept mechanism
This has the following benefits:
- consistent with how the other caches are created into target rootfs
- only runs once per package manager transaction, instead of once per every immodule package
- correctly postpones to first boot if qemu is not working; from postinst itself
this would've required special arrangements to avoid what is now a do_rootfs failure.

(From OE-Core rev: cca3c084b6c9bf600d7306e3fe12c4f236b78656)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18 11:07:58 +01:00
Jeremy Puhlman
90d6d998ce Only add uninative and checksum if inherited uninative class
The checksum value is only calculated if the uninative class is
inherited, so check for inherit before adding it to local.conf

(From OE-Core rev: 3b5b832589d943700b273e3a4d83561be0c47f36)

Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18 11:07:57 +01:00
Jeremy Puhlman
927c2669c5 Multilibize the UPDATERCPN variable
The audit package specifies the following:
UPDATERCPN = "auditd"

However because it is not multilibized, the value "auditd" is used to
search for the package to add the post install script too. In the mutlilib
alternate abi case, that package does not exist. It ends up assigning
the post install script to the lib32-audit-lic package, which
subsequently failes to execute the script due to the initscript it is
trying to turn on is not installed.

(From OE-Core rev: ce99653e1af50d9e8f070ca6ae810908c4c138c6)

Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18 11:07:57 +01:00
Ross Burton
c76ca2c65b meson: only use lists of commands in cross file if required
There's a bug in Meson[1] where it find_program("foo") will fail if foo is
defined in the cross file as a list.

This is causing the Meson build of libdrm to fail, but for this instance we can
work around the problem by only using lists in the cross file if there are
arguments, and just using a string if there are not.

[1] https://github.com/mesonbuild/meson/issues/3737

(From OE-Core rev: 7fd8bc469c2caacc1c2021bd0aa83dd6da7fe1e7)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18 11:07:57 +01:00
Damien Riegel
7d3ad1405c populate_sdk_ext.bbclass: fix corebase identification
When generating the extended SDK, there is a copy step where this class
goes through the layers and other stuff that have been copied to
generate the SDK. The corebase; ie. the folder that contains the core
layer 'meta' is treated in a special way. Unfortunately in our tree, we
have:

  sources/meta/meta
           |     `- core layer
           `------- corebase

In populate_sdk_ext's copy_buildsystem, the heuristic to determine which
element of the list returned by copy_bitbake_and_layers is corebase is
fooled by such layout.

In copy_bitbake_and_layers, corebase is already handled specifically and
reliably, so we should let that function tell us which folder is
corebase instead of trying to determine it.

To do so, change the return type of copy_bitbake_and_layers to a tuple
that contains (corebase, copied_layers). It also simplifies the code on
the caller side.

(From OE-Core rev: 5368bc5d0d3606198b93e877bcafcd77bb5f4fd1)

Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18 11:07:57 +01:00
Alex Kiernan
4957ec32c2 kernel-fitimage: Add DTBO support for configurations
When generating overlay DTB configuration sections, U-Boot doesn't want
the kernel specified again as we already have that in our base DTB. Add
support for this to allow bootm to process overlay configuration sections.

(From OE-Core rev: c0db9776beb4f519079a554a733353c368739dcf)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18 11:07:57 +01:00
Alex Kiernan
430774e459 kernel-fitimage: Allow setting of DTB/DTBO relocation address
Introduce UBOOT_DTB_LOADADDRESS and UBOOT_DTBO_LOADADDRESS so that you
can set where U-Boot loads full and overlay DTBs. This is required when
using bootm's overlay support to construct the final DTB.

(From OE-Core rev: 05d2230db1d7379494814407fc0d79d7e755d89e)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18 11:07:57 +01:00
Andre McCurdy
89cbaca359 rootfs-postcommands.bbclass: drop obsolete sshd UseDNS rootfs postprocessing
The sshd UseDNS option has defaulted to "no" since openssh 6.8p1,
so it's no longer necessary to postprocess the rootfs to force the
option:

  https://www.openssh.com/txt/release-6.8

(From OE-Core rev: 0cb4f11614bd3b17db8e6b3516761193cd45d082)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-15 17:56:25 +01:00
Kai Kang
95a8753766 goarch.bbclass: set SECURITY_CFLAGS for mips64
When include conf/distro/include/security_flags.inc, NOPIE flags are
still required for mips64 target builds. Otherwise it fails to build
packages such as glide which inherit go.bbclass:

| .../tmp-glibc/work/mips64-wrs-linux/glide/0.13.1-r0/recipe-sysroot-native/usr/bin/mips64-wrs-linux/../../libexec/mips64-wrs-linux/
| gcc/mips64-wrs-linux/7.3.0/ld: .../tmp-glibc/work/mips64-wrs-linux/glide/0.13.1-r0/go-tmp/go-link-518447869/go.o:
| relocation r_mips_26 against `a local symbol' can not be used when making a shared object; recompile with -fPIC`

Use override 'mipsarch' to set SECURITY_CFLAGS for both mips and mips64.

(From OE-Core rev: 98b24e9268dc444356ce8bd9ddfec6adcce5e02a)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-15 17:56:24 +01:00
Otavio Salvador
2138f47802 uboot-extlinux-config.bbclass: Add baudrate in console bootparam
By default, we ought to use console="${console},${baudrate}" as
console bootparam as commonly it is left to be passed with the
bootargs.

(From OE-Core rev: 2ce3534b2011cf5516780c9fd7e00bd107619adc)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-15 17:56:24 +01:00
Kai Kang
8c103176e2 manpages.bbclass: Update RDEPENDS and post install scripts
If a package installs manual files, it should update manual index cache
after its installation. Add package 'man-db' to RDEPENDS which contains
command 'mandb' to update the cache. And do the update in the post
install scripts.

(From OE-Core rev: 078900f2416202b677471b10b69c8defb0f14c8d)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-15 17:56:24 +01:00
Jens Rehsack
a34850f703 cpan_build.bbclass: tell Module::Build the replacement
Instead of patching Module::Build, maybe Module::Build::Tiny and all other
similar tools, use the official way to tell them which is the target perl
on target.

(From OE-Core rev: f3925216b06ff7fbe21989210f8eb11e16be6631)

(From OE-Core rev: 306435507c4790ec44f30cd3c7fa7d340b441ec4)

Signed-off-by: Jens Rehsack <sno@netbsd.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-15 17:56:24 +01:00
Alejandro Enedino Hernandez Samaniego
073dbcedf5 tclibc-newlib: Adds a new TCLIBC variant to build with newlib as C library
This patch adds the posibility to build using TCLIBC=newlib.

It allows users to build baremetal applications with the use of a
C library.

Newlib is a lightweight C library meant to be used on embedded systems,
it is meant to be easily portable for new platforms and to provide
basic functionality on them, by design, it provides stubs for some of
these core functions declared as weak, so they can be built correctly
and then linked against some other library which provides specifics
about the platform being used if need be, libgloss takes care of these
in some cases, but it can also be extended, this patch also allows the
user to easily add other libraries to it by adding them to
NEWLIB_EXTENDED for this specific reason.

(From OE-Core rev: 9f0570351a7b0877aa50efff5fe9a9ef368cb38f)

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-15 17:56:24 +01:00
Alejandro Enedino Hernandez Samaniego
361f7a902d insane.bbclass: Adds powerpc to elf headers machine dictionary
This patch adds makes it possible to build elf for powerpc by adding
this combination to the elf headers machine dictionary, this can be
useful when trying to build baremetal applications where the TARGET_OS=elf

(From OE-Core rev: 6f7ef4f6049fa8f2a8e17abfcf53ccbc22394088)

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-15 17:56:24 +01:00
Bruce Ashfield
81e8a52e8e kernel: specify dependencies for compilation for config tasks
With recent kernels (i.e. 4.17+) the configuration phase of the kernel
will check for capabilities/options of the compiler for CVE and other
mitigation support.

For a general kernel, we want to ensure that CC is fully defined when
the config targets are invoked (so the proper compiler will be checked).

For linux-yocto, we also need to specify the compiler/tools dependencies
for the configme task since it executes before configure and hence the
main kernel build DEPENDS will not always be in the sysroot before it
executes. Without those dependencies the kernel will be incorrectly
configured (i.e. bison is missing) or the configuration will fail the
mitigation tests.

[YOCTO #12757]

(From OE-Core rev: ff1bdd75d50f0ebac3d599e461685ace29559a82)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-12 23:34:24 +01:00
Martin Kelly
aa497e057b toolchain-scripts: pass env to post-relocate
It's useful for the post-relocate scripts to be able to see the SDK
environment, for example to see the values of CC, CXX etc. in order to
dynamically generate toolchain files.

To enable this, source the SDK environment script prior to calling the
relocate scripts.

(From OE-Core rev: adcf69ee3310171580c28e141fec6997b1f06da4)

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-07 08:52:55 +01:00
Martin Kelly
27f593ebd2 toolchain-scripts: print post-relocate error
Currently, if a post-relocate script fails, it fails silently. We should
be louder about this, as it likely indicates a broken SDK.

Print a message if a post-relocate script fails.

(From OE-Core rev: 369b5f3f98f8455c79731621cc669ad1948e2022)

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-07 08:52:55 +01:00
Martin Kelly
d7bd3d6575 toolchain-scripts: allow non-sh post-relocate
Currently, we look only for scripts matching *.sh, which means we can't
write post-relocate scripts in other languages.

Expand this to allow any type of script.

(From OE-Core rev: 5569a6ec6d3c4358719350cac88afa69a76097a8)

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-07 08:52:55 +01:00
Martin Kelly
fa415be194 toolchain-scripts: retab file
A function is uses a mix of spaces and tabs. The rest of the file
uses tabs, so switch to tabs uniformly.

(From OE-Core rev: 693daaac7399a5a7665cd3bcbc915ff93db36db5)

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-07 08:52:55 +01:00
Andre McCurdy
762a3f229c dropbear: drop run time detection of read-only rootfs
Previously, when dropbear was started via its init script, relocation
of DROPBEAR_RSAKEY_DIR to support read-only rootfs was handled at
run time from within the init script.

Update the init script to take advantage of the read-only rootfs
config setup by read_only_rootfs_hook() and therefore be consistent
with startup under systemd (where relocation of DROPBEAR_RSAKEY_DIR
is handled by the read_only_rootfs_hook() at build time).

(From OE-Core rev: 4990f87b2f6a8b30c8d1c767636e7f5527f595ba)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04 15:15:00 +01:00
Chen Qi
272ef77429 testimage.bbclass: move codes into testimage_main
testimage-auto is expected to run testimage task's codes automatically.
But in fact, it's currently missing some codes, including testimage_sanity
and create_rpm_index.

This leads to the problem of unexpected runtime failure of test_dnf_makecache.
The error message is as below.

  RESULTS - dnf.DnfRepoTest.test_dnf_makecache - Testcase 1744: ERROR

This error is caused by the fact that create_rpm_index is not executed
before running the tests.

There's no reason why such codes should not be in testimage_main, so
move them into it.

(From OE-Core rev: fa7ba486ded13907f63f9300f66350ba2835a3f7)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04 15:15:00 +01:00
Chen Qi
d478a26e5f testimage.bbclass: also check 'auto' to create rpm index
Having 'auto' in TEST_SUITES will also run the 'dnf' test cases,
so also check it to determine whether to create rpm index or not.

This is to fix the following error when TEST_SUITES = "auto".

  RESULTS - dnf.DnfRepoTest.test_dnf_makecache - Testcase 1744: ERROR

(From OE-Core rev: c1f4177848d25a9121f2a85da655ee414cd424b1)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04 15:15:00 +01:00
Chen Qi
4afe2567b7 testimage.bbclass: fix behavior of empty TEST_SUITES
The current behaviour of TEST_SUITES is very confusing.

setting: TEST_SUITES = ""
result:  Execute all test cases.

setting: TEST_SUITES = "some_case_not_exist"
result:  Error out with 'Empty test suite' message.

The expected behaviour of TEST_SUITES should be:
1. when 'auto' is in it, execute as many test cases as possible
2. when no valid test case is specified, error out and give user message

The first one is implemented by a previous patch.
The second one is fixed in this patch.

Also add debug message to show test cases to be executed. This is
for easier debugging.

(From OE-Core rev: 909568821fbad8a6a7034b10a2dc349a210fdfc6)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04 15:15:00 +01:00
Martin Kelly
34bb960160 meson.bbclass: refactor native override
The native override is specified in two different places, so let's move
it into a function to reduce code duplication.

(From OE-Core rev: c455ec4a12d4966524da9436722476aa2d428765)

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04 15:15:00 +01:00
Andre McCurdy
8302bb9cd8 base.bbclass: update obsolete comment about rpm do_unpack dependencies
The previous comment was made obsolete by:

  http://git.openembedded.org/openembedded-core/commit/?id=2f31f1795bc0c85b1646bc7d9596bbe778cb84e5

(From OE-Core rev: 9a9330aebe201078a47441e1ef9a19a659017ba8)

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>
2018-05-29 21:07:14 +01:00
Andre McCurdy
24882b2416 externalsrc.bbclass: don't configure with --disable-dependency-tracking
One of the uses of externalsrc is to enable iterative editing and
rebuilding of source files during development. In such situations,
disabling Automake dependency tracking can lead to sources not being
rebuilt even though files they depend on have been modified.

(From OE-Core rev: af2f802d5b59203a887982af83252565b8078085)

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>
2018-05-29 21:07:13 +01:00
Andre McCurdy
95a1d7aefa kernel.bbclass: avoid duplicates in KERNEL_IMAGETYPE_FOR_MAKE
Currently if KERNEL_IMAGETYPES contains both vmlinux and vmlinux.gz,
KERNEL_IMAGETYPE_FOR_MAKE will end up containing two copies of
vmlinux, which will result in two calls to "make vmlinux" from
kernel_do_compile().

Avoid duplicating vmlinux in KERNEL_IMAGETYPE_FOR_MAKE plus some
minor non-functional updates to formatting and comments.

(From OE-Core rev: 80455a0b6cce6d12a5b32194d0cad2e4c7f71599)

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>
2018-05-22 13:13:33 +01:00
Andre McCurdy
fc57f9cce3 bitbake.conf: drop _build-${BUILD_OS} over-ride
Building on a host OS other than a recent version of Linux is not
recommended or supported. Drop the historical _build-${BUILD_OS}
over-ride to avoid giving the impression that other host OS's might
be supported.

(From OE-Core rev: 428fc39356cb77830de9e0d3f1dbd00f5868290a)

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>
2018-05-22 13:13:33 +01:00
Andre McCurdy
14a5089e81 default-distrovars.inc: drop obsolete LGPLv2_WHITELIST_GPL-3.0
There doesn't seem to be a clear reason to have two separate
variables to hold whitelisted GPLv3 recipes. Both variables are
treated the same, so adding a recipe to LGPLv2_WHITELIST_GPL-3.0 is
already equivalent to adding it to WHITELIST_GPL-3.0.

Anyone needing to whitelist a GPLv3 recipe should now just use
WHITELIST_GPL-3.0.

(From OE-Core rev: d4dea76fbe9765d489e3e522a9d2c22049610c7b)

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>
2018-05-22 13:13:32 +01:00
Andre McCurdy
a1dda84fe8 native.bbclass: drop _virtclass-native and _virtclass-nativesdk overrides
The _virtclass-XXX over-rides are problematic in that they are higher
priority than _forcevariable, which is documented as being the
highest priority over-ride.

Since they are now obsolete (replaced by _class-native and
_class-nativesdk) drop them entirely rather than try to fix their
priority.

(From OE-Core rev: c5aa33ac483618bc23fbaccb0a18853186f9155d)

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>
2018-05-15 10:56:50 +01:00
Jon Szymaniak
dd5bf3e4d2 cve-check.bbclass: detect CVE IDs listed on multiple lines
Some backported patches fix multiple CVEs and list the corresponding
identifiers on multiple lines, rather than on a single line.

cve-check.bbclass yields false positive warnings when CVE IDs are
presented on multiple lines because re.search() returns only
the first match.

An example of this behavior may be found when running do_cve_check() on
the wpa-supplicant recipe while in the rocko branch. Only CVE-2017-13077
is reported to be patched by commit de57fd8, despite the patch including
fixes for a total of 9 CVEs.

This is resolved by iterating over all regular expression matches,
rather than just the first.

(From OE-Core rev: 8fb70ce2df66fc8404395ecbe66a75d0038f22dd)

Signed-off-by: Jon Szymaniak <jon.szymaniak.foss@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-15 10:56:49 +01:00
Jose Perez Carranza
cb68e9a2fe runtime/dnf: Add new dnf test cases
Add test cases to test “exclude” and “installroot“ options, also modify
the logic of filtering packages on the feed to have all the packages
needed by the tests.

[YOCTO #10744]

(From OE-Core rev: 1121806603c6f621d084b692216f3f616a0768dc)

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-15 10:56:48 +01:00
Mike Crowe
5479654eea rm_work: Stop appending _setscene to do_image_complete_setscene stamps
Each time I build my image after the first, I end up with a
do_image_complete_setscene stamp file with an extra _setscene appended to
the name. Eventually, the filenames end up being so long that mv complains
and the build fails.

It looks like this behaviour was introduced when the special handling was
added for do_image_complete in 2ff9d40dc88d43567472218cf3d3faf414398c71.

So, let's ensure that the *_setscene* pattern is matched before anything
else so that any do_image_complete_setscene stamp file is always ignored
and the do_image_complete non-setscene stamp file is moved only once.

It's not straightforward to just move *do_image_complete* after the
*_setscene* pattern because do_image_complete stamps would then match
do_image*.

(From OE-Core rev: f04e6bd144deb0c8fe2742f66b18904b6619a502)

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-11 07:49:38 +01:00
Ross Burton
06d7df6fe2 base: improve do_unpack[cleandirs] logic
If a recipe sets S to ${WORKDIR}/ then the S != WORKDIR test doesn't work as
expected.  Use os.path.normpath() to normalise the paths so string comparison
works.

(From OE-Core rev: 06aaafd14f3c8e27faeea0a514f80e1ff5eb4deb)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-11 07:49:38 +01:00
Mike Crowe
0ef7994fd0 kernel: Permit overriding of KERNEL_IMAGETYPE_FOR_MAKE
Commit a1690131691507bbf5853540229b3ad775b836bf removed the ability of
recipes to set KERNEL_IMAGETYPE_FOR_MAKE. Fix that by letting recipes
continue to set their own KERNEL_IMAGETYPE_FOR_MAKE if they so wish.
They may have been doing so for a while, and don't want to have their
carefully-selected value trampled on by kernel.bbclass.

This may be required if the recipe itself wants to build one type of
kernel, but post-process it into a different type, rather like the
vmlinux->vmlinux.gz support provided by kernel.bbclass.

(From OE-Core rev: 38abd26fe7de321e0f1fc4895f754f34dee90f6c)

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>
2018-05-11 07:49:37 +01:00
Khem Raj
f21072d2e6 allarch.bbclass: Exclude package_do_shlibs from do_package signature
shlibs is largely useless for allarch, the particular usecase where it
fails is when DISTRO_FEATURE is changing due to libc being different e.g.

Variable package_do_shlibs value changed:
-DISTRO_FEATURES{ldconfig} = Set
+DISTRO_FEATURES{ldconfig} = Unset

musl -> glibc or other way around 'ldconfig' gets added or deleted to
DISTRO_FEATURE set, neither this distro feature nor the shlibs processing
during packaging is of interest to allarch packages which are largely
arch independent scripts

(From OE-Core rev: 06602d56d1d311562144eafe459fcea36931a34c)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-09 10:47:51 +01:00
Khem Raj
cf5be67635 glibc: Drop obsolete rpc and libnsl
use libnsl2 and rpcsvc-proto packages

(From OE-Core rev: 9dc9983901cec364ea57a72b9da1a0396b60663a)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-09 10:47:50 +01:00
Chen Qi
b1b4dd8f76 sstate.bbclass: drop obsolete codes
The SSTATECLEANFUNCS mechanism was introduced to solve user/group
deletion problem. After RSS mechanism was introduced, there's no
need to do so.

There was a patch to remove these obsolete codes for useradd.bbclass,
but the codes in sstate.bbclass were not removed. So clean it up.

(From OE-Core rev: 215b83ce892a7002ed0b1bd7b82a08e67ae15121)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-04 13:28:05 +01:00
Ming Liu
78c0b21e3d image_types_wic: add do_image_wic before do_image_complete
We have some tasks depending on image's do_image_complete task, and we
are also using WKS files to generate partitioned images, but now there
is lacking a inter dependency between do_image_wic and
do_image_complete, so we have to depend on both of them.

Fixed by adding the dependency.

(From OE-Core rev: e3a25f06f2cde701415f4130a43c9b3895d42f10)

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-04 13:28:05 +01:00
Koen Kooi
ab8b5cbfd6 native bbclass: handle base_libdir as well
Native.bbclass needs to fixup both base_libdir and libdir to handle things like multiarch. This fixes wic and ext4.* image failures during do_rootfs where mkfs.ext4 can't find its libraries.

(From OE-Core rev: 464dad0dc93aeeedd34d90c2f06596060ec135fd)

Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-04 13:28:04 +01:00
Richard Purdie
f6689c1dae toolchain-scripts/meta-ide-support: Handle dash shells correctly
Where /bin/sh is dash, the recent toolchain scripts change fails as the $(pwd)
usage in oe-init-build-env doesn't function correctly. Fix this by saving
and restoring the cwd and calling the script within its own directory.

This fixes meta-ide-support on dash based systems.

(From OE-Core rev: dceca6d34071b4cbef9e28bbf19dc12f5d925525)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-04 13:28:01 +01:00
Chin Huat Ang
00302da399 toolchain-scripts: preserve host path in environment setup script
The environment setup script generated in the build directory sets the PATH
variable by expanding ${PATH} which would have host paths filtered. Sourcing
this script to run runqemu will not work as it complains host stty (/bin/stty)
cannot be found.

To resolve this, the script no longer expands ${PATH} during generation time,
instead it will now source oe-init-build-env to initialize the build
environment so that all host paths will be preserved. Also be sure to prepend
STAGING_BINDIR_TOOLCHAIN to the PATH variable so that the toolchain from the
build directory can be found.

[YOCTO #12695]

(From OE-Core rev: a64a144096c0637387244b89ed22f4b5352b2522)

Signed-off-by: Chin Huat Ang <chin.huat.ang@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-04 13:28:01 +01:00
Ola x Nilsson
df08ba32a6 package.bbclass: Make staticlib problems non-fatal
Allow debugsource listing using dwarfsourcefiles to fail for static
libraries when the archive content is not as expected.

(From OE-Core rev: e2235b7567a9aba474cda4cdc20cc9bfffc63711)

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>
2018-04-23 17:26:05 +01:00
Joshua Watt
d331af97a0 Revert "icecc.bbclass: Improve error reporting"
This reverts commit b28114cf1e.

The "-E" option for flock is not ubiquitously supported, so don't use
it.

(From OE-Core rev: 802a2877a78a44c17f3e142f7d12017a08d09dad)

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>
2018-04-23 17:26:04 +01:00
Richard Purdie
a67ad9544a package: Fix PACKAGELOCK handling
PACKAGELOCK is there to protect readers of PKGDATA_DIR from writes and files
changing whilst they're being read. With various changes to the codebase,
the lock code has become confused as the files are now written by the sstate
code in do_packagedata, not in do_package directly any longer.

This change cleans up the code so read sites take the shared lock (anything in
do_package), write sites take the full lock (do_packagedata sstate).

The lock from do_package sstate is no longer needed since it doesn't write
outside WORKDIR.

(From OE-Core rev: d46cadbbb42aa71f9436d640891d6ccc8f8e3618)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-23 17:26:04 +01:00
Richard Purdie
2d93f1c351 package.bbclass: Only try and process static lib debug symbols on targetos != mingw*
"package.bbclass: Include dbgsrc for static libs" introduced a regression
on mingw, fix this by excluding on that TARGETOS.

(From OE-Core rev: 305dda730738a8fb3789047b06fcc45d10212aa3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-20 08:12:17 +01:00
Ola x Nilsson
47651bd6aa package.bbclass: Include dbgsrc for static libs
The debugsource must be added from the package providing the static
lib, because any package using that lib does not have access to the
source code.

Fixes [YOCTO #12558]

(From OE-Core rev: eefa5ba35663fabe1f3f8cf7f1ff126d51240613)

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>
2018-04-20 08:12:17 +01:00
Richard Purdie
1b2f8e6de6 uninative: Set the dynamic linker to use at compile time
Its possible some dynamic runtime library in the dependency chain may
come from sstate and link to libraries which need the libc from
uninative. If we don't do this and binaries are run at do_install time
they would fail to find the symbols from the later libc. Examples:

cmake-native do_install:
bin/cmake: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by TOPDIR/tmp/work/x86_64-linux/cmake-native/3.10.3-r0/recipe-sysroot-native/usr/lib/libexpat.so.1)

dbus-native do_install:
tmp/work/x86_64-linux/dbus-native/1.12.2-r0/build/bus/.libs/lt-dbus-daemon: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-x32/build/build/tmp/work/x86_64-linux/dbus-native/1.12.2-r0/recipe-sysroot-native/usr/lib/libexpat.so.1)

This issue is resolved when the interpreter is changed at sstate unpack
time but this isn't soon enough to avoid issues at compile/install time.

By specifing which dynamic linker/loader to use at compile time, this
race window is removed entirely.

(From OE-Core rev: 35867ee035030ab76fc9ccdb0eb1c3f80126301c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-18 18:57:06 +01:00
Richard Purdie
fa742af158 uninative: Add allow-shlib-undefined to BUILD_LDFLAGS and drop other workarounds
We have a problem when for example, a glibc 2.27 based system builds some
library like libpopt-native and puts it into sstate then it is reused
on a pre glibc-2.27 system to build something which depends on popt like
rpm-native. This results in an error like:

recipe-sysroot-native/usr/lib/libpopt.so: undefined reference to `glob@GLIBC_2.27'

In the past we've had this problem with new symbols like getrandom and
getentropy, here its with a more complex symbol where there is an old
version and a newer version.

We've looked into various options, basically we cannot link against our
uninative libc/ld.so since we don't have the right headers or compiler
link libraries. The compiler doesn't allow you to switch in a new set
either, even if we did want to ship them. Shipping a complete compiler,
dev headers and libs also isn't an option.

On the other hand if we follow the ld man page, it does say:

"""
The reasons for allowing undefined symbol references in shared libraries
specified at link time are that:

- A shared library specified at link time may not be the same as the one
  that is available at load time, so the symbol might actually be
  resolvable at load time.
"""

which is exactly this case. By the time the binary runs, it will use
our uninative loader and libc and the symbol will be available.

Therefore we basically have a choice, we get weird intermittent bugs,
we drop uninative entirely, or we pass this option.

If we pass the option, we can drop the other workarounds too.

(From OE-Core rev: 75a62ede393bf6b4972390ef5290d50add19341a)

(From OE-Core rev: d18bf7fa8e80d6cfaf3fdbe1ab06eec84b954432)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-18 18:57:06 +01:00
Richard Purdie
606ff37690 bitbake.conf: Set and export TZ envvar to UTC
We just ran into an issue where tar failed to build on one server setup
but built everywhere else just fine.

It was running makeinfo to regenerate some docs files and makeinfo was too
old for the host it was running on. There was no dependency on makeinfo-native
as it was not meant to be regenerating the docs.

It was being regenerated as a date from a timestamp used in the docs
was different in Asian timezones than in the other timezones our builds
were being tested in.

I added an entry to https://wiki.yoctoproject.org/wiki/TipsAndTricks/
about how this was debugged.

As such, lets default to setting and exporting TZ to 'UTC' as was already
pioneered by the reproducibile builds work. This makes the builds
deterministic.

[YOCTO #12665]

(From OE-Core rev: 2a90ae7a3286724ff9e3615c4dbf56038f703810)

(From OE-Core rev: e31f31f81efe4b60938b724bece2a03c7c74a68d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-18 18:57:06 +01:00
Mark Hatle
49bfeb0a9c package.bbclass: Add '-b' option to file call in isELF
The isELF function works by running:

   result = file <pathname>
   if 'ELF' in result

By default 'file' will prepend the result with the path name of the file
that is being checked.  This usually works fine, such as:

$ file /home/foo/openembedded-core/meta/classes/package.bbclass
/home/foo/openembedded-core/meta/classes/package.bbclass: Python script, ASCII text executable, with very long lines

However, if the path includes 'ELF', ELF will end up in the result, and then
the check will return positive.

$ file /home/ELF/openembedded-core/meta/classes/package.bbclass
/home/ELF/openembedded-core/meta/classes/package.bbclass: Python script, ASCII text executable, with very long lines

This will then result in the isELF coming back true, and possibly causing the
checks that use isELF, such as the 'is it already stripped' check, to do the
incorrect thing.

Adding the '-b' option to file will result in the path being omitted in the
result:

$ file /home/ELF/openembedded-core/meta/classes/package.bbclass
Python script, ASCII text executable, with very long lines

(From OE-Core rev: 5a324e9b2cf6378f8eaa4e394f9cb36d4e2680ac)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-18 18:57:06 +01:00
Juro Bystricky
b8ce7d0800 rootfs-postcommands.bbclass: improve binary reproducibility
Conditionally support binary reproducibility of rootfs images.
If REPRODUCIBLE_TIMESTAMP_ROOTFS is specified then:

1. set /etc/timestamp to a reproducible value
2. set /etc/version to a reproducible value
3. set /etc/gconf: set mtime in all %gconf.xml to reproducible values

The reproducible value is taken from the variable REPRODUCIBLE_TIMESTAMP_ROOTFS.

[YOCTO #11176]
[YOCTO #12422]

(From OE-Core rev: 11e45082ad00b9c172e59bf6b2a76dd613773f5a)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-18 18:57:06 +01:00
Ross Burton
fb9e636538 testimage: run systemtap test on SDK images
(From OE-Core rev: f7f26bd0fe7085515bdebf23107ed8647a0c98fe)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-18 18:57:06 +01:00
Joshua Watt
59e51d2ac8 icecc.bbclass: Bump version number
Bump the version number for force remotes to use a newly generated
environment, since the old one potentially had a few bugs

(From OE-Core rev: 6c3b2ac41f3412ebce8364df637d64e34daab8a6)

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>
2018-04-13 16:58:07 +01:00
Joshua Watt
b28114cf1e icecc.bbclass: Improve error reporting
Improve reporting when the icecream environment cannot be created by
assigning the flock call a specific error number when the lock fails so
it can be distinguished from environment creation errors.

(From OE-Core rev: 563448a7a3ca87cc07528c18f8047913e0468e7a)

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>
2018-04-13 16:58:07 +01:00
Joshua Watt
089cd3bf55 icecc.bbclass: Add ICECC_ENV_DEBUG variable
The ICECC_ENV_DEBUG variable can be set in local.conf to pass additional
debugging options to the Icecream toolchain creation script.

(From OE-Core rev: be913284bb34ebf4a71770646044603a2a27d01b)

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>
2018-04-13 16:58:07 +01:00
Ross Burton
8b50dfcecf populate_sdk_base: use xz -T instead of pixz
xz has native support for threaded compression now and SDK creation was the only
part of oe-core which is using pixz instead of xz.

Not only does this remove pixz-native from the SDK dependencies, but in my
limited testing xz -T0 is slightly faster and produces smaller archives than
pixz for the same input.

(From OE-Core rev: ce1cfa57d9828c0898f52e736f671ce8db534031)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-13 16:58:06 +01:00
Ross Burton
a559ffab30 image_types: use pigz to create .gz files
Since pigz is no longer a drop-in replacement for gzip (oe-core 1624b7b) the
image creation has been using gzip instead of pigz, despite still depending on
pigz-native.  Fix this by invoking pigz explicitly.

(From OE-Core rev: 214fa7fe3b162162d2fa8b31eec28bedd86fcc7d)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-13 16:58:06 +01:00
Martin Jansa
0a0d01addd license.bbclass: be a bit more strict when searching ${PN}-${LICENSE_PACKAGE_SUFFIX} in packages
* linux-firmware contains ${PN}-license package since this commit:
  commit 1ee083da0730408fffdbbf5f29abc299c0e61be9
  Author: Jackie Huang <jackie.huang@windriver.com>
  Date:   Mon Apr 13 10:17:21 2015 +0800

    linux-firmware: fix the mess of licenses
* LICENSE_CREATE_PACKAGE functionality in license.bbclass when enabled
  adds new package with suffix:
  LICENSE_PACKAGE_SUFFIX ??= "-lic"
  but then it checks if ${PN}-${LICENSE_PACKAGE_SUFFIX} is included
  in PACKAGES before adding it and when found it shows:
  WARNING: linux-firmware-1_0.0+gitAUTOINC+4c0bf113a5-r0 do_package: linux-firmware-lic package already existed in linux-firmware.
  and doesn't add the ${PN}-lic to PACKAGES and causes another warning:
  WARNING: linux-firmware-1_0.0+gitAUTOINC+4c0bf113a5-r0 do_package: QA Issue: linux-firmware: Files/directories were installed but not shipped in any package:
  /usr
  /usr/share
  /usr/share/licenses
  /usr/share/licenses/linux-firmware

  that's because it was searching ${PN}-lic in PACKAGES as a string
  so it found ${PN}-lic as a substring of ${PN}-license, add a split
  to search in an list

(From OE-Core rev: 9b9897fc034819385a9d4ce591cc79dd458f3f24)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-10 09:10:36 +01:00
Peter Kjellerstedt
91782cf429 license.bbclass: Minor simplification of get_deployed_dependencies()
Since ${SSTATE_ARCHS} now contains ${PACKAGE_EXTRA_ARCHS} there is no
longer any need to add those extra architectures to the list of
architectures handled in get_deployed_dependencies().

(From OE-Core rev: e55e6df4f1434458cdfa0e2d3610b48119e5a782)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-10 09:10:36 +01:00
Peter Kjellerstedt
4ea831fb7f sstate.bbclass: Add ${PACKAGE_EXTRA_ARCHS} to SSTATE_ARCHS
This makes sure files provided by packages that use any of the extra
architectures defined using ${PACKAGE_EXTRA_ARCHS} are cleaned from
tmp/sysroot-components when sstate_eventhandler2() executes.

Without this, changing a package from using one of the extra
architectures to another architecture would lead to files being
leftover in tmp/sysroot-components, which could later be picked up
when creating the RSS for another package rather than the files that
belonged to the updated package.

(From OE-Core rev: b959b3bd92aa2939d407800fc4167b0535fd4674)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-10 09:10:36 +01:00
Peter Kjellerstedt
144faeb10c classes: Use ${MACHINE_ARCH} instead of ${MACHINE} for stamp-extra-info task flag
Without this change, there will be two sstate index files in
tmp/sstate-control for any machine that contains a dash in the
name.

(From OE-Core rev: 29e7799bdb3773c40492e01448e0c614ed44583d)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-10 09:10:36 +01:00
Victor Kamensky
a35416cafd image: add image-combined-dbg helper class
There is IMAGE_GEN_DEBUGFS="1" variable that enables build of
additional rootfs-dbg and additional archive that contains
complimentary symbols files for a given image. But the issue
with this resulting directory and tarball that before use it
has to be combined with original image content. It is required
since all cross debugging tools like gdb, perf, and systemtap
need file system that contains both target executables/libraries
and their symbols. Those tools need to find executable/library
first and through it debuglink note find corresponding symbols
file.

image-combined-dbg when added to USER_CLASSES just copies
final resulting rootfs back into rootfs-dbg creating combined
target and debug symbols rootfs that can be used for debugging
directly.

(From OE-Core rev: 7ccb077f51c9232de70e5c6f9897fd9986e3be9d)

Signed-off-by: Victor Kamensky <kamensky@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-07 11:44:50 +01:00
Tom Hochstein
a6567a4c21 archiver: Fix archive for linked kernel source
When archiving a kernel, if S is ${WORKDIR}/git, then
${WORKDIR}/git is in fact a soft link into work-shared,
and the archive contains just the soft link. Fix by
archiving the real directory.

(From OE-Core rev: 564204dd6b73697ef4b6c17243067892876cc323)

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05 14:49:07 +01:00
Tom Hochstein
c2eec907cb archiver: Fix build errors for kernels that don't use kernel-yocto.bbclass
Special handling for kernel source in work-shared was
incorrectly limited to kernel-yocto.bbclass instead
of kernel.bbclass.

(From OE-Core rev: b8c5680a67888d43540366a40bd0c501e926ac31)

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05 14:49:07 +01:00
Alexander Kanavin
243fd5a74d gio-module-cache.bbclass: pass in ${libexecdir}
When it was something else than /usr/libexec (e.g. when
installing native SDK packages), things broke down.

(From OE-Core rev: d99e819a6cbde6d1116c434ddba4c5f8eca7e6d8)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05 14:49:07 +01:00
Alexander Kanavin
e4b8c2bd20 sdk.py: run postinst intercepts
Previously this wasn't done, and so any packages installed from
populate_sdk would not have the postinsts fully executed
(particularly generation of various caches via running nativesdk or target
binaries with qemu wasn't working).

[YOCTO #12630]

(From OE-Core rev: a484ff072eea3f47de2c3348048201249cefa46b)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05 14:49:07 +01:00
Enrico Jorns
42a513489d base.bbclass: fix do_unpack[cleandirs] varflag handling
As introduced by a56fb90dc3 ('base.bbclass
wipe ${S} before unpacking source') the base.bbclass uses a python
anonymous function to set the 'do_unpack' varflag 'cleandirs' to either
'${S}' or '${S}/patches' depending on equality of '${S}' and '${WORKDIR}'.

Not that this only differs from the way almost all other recipes set or
modify a tasks 'cleandirs' flag, it also has a significant impact on the
kernel.bbclass (and possibly further ones) and causes incorrect
behavior for rebuilds triggered by source modification, e.g. by a change
of the defconfig file for a kernel build.

The kernel.bbclass tries to extend do_unpack[cleandirs]:

| do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"

As python anonymous functions are evaluated at the very end of recipe
parsing, the d.setVarFlag('do_unpack', 'cleandirs', '${S}') statement in
base.bbclass will overwrite every modification to cleandirs that is done
as shown for the kernel class above.

As a result of this, a change to a kernels 'defconfig' will lead to an
updated defconfig file in ${WORKDIR}, but as ${B} never gets cleaned and
${B}/.config still exists, it will not be copied to ${B}/.config and
thus not find its way in the build kernel.

This is a severe issue for the kernel development and build process!

This patch changes setting of the cleandirs varflag in base.bbclass to
a simple variable assignment as almost all other recipes do it. This now
again allows overwriting or appending the varflag with common methods
such as done in kernel.bbclass.

This issue affects morty, pyro, rocko and master.

(From OE-Core rev: 20901b9783220aa6e7adae4951c531919c20859b)

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05 14:49:07 +01:00
Paul Eggleton
5e6ffb2adb classes/externalsrc: ensure cleandirs code handles non-absolute paths
It's possible that a trailing or extra slash somewhere in the external
source path could result in the directory not being removed from
cleandirs; it's also possible that a cleandirs entry is somewhere
underneath the source tree and that tree should never have parts of it
deleted by the build system. Use oe.path.is_path_parent() (which makes
paths absolute before checking them) to find out if any path in
cleandirs is anywhere underneath the external source path, and drop it
if it is.

(From OE-Core rev: 87ec0fb470274d980f8553a85f778809c269c5d7)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05 14:49:07 +01:00
Paul Eggleton
eb37cdd890 classes/externalsrc: handle if cleandirs contains python expressions
Use the existing oe.recipeutils.split_var_value() function to split the
unexpanded value of the cleandirs varflag, in case it contains python
expressions - we don't want to split the expression itself as the chunks
will not expand properly individually and we can miss something that
expands to the source tree (and thus it can get deleted, the avoidance
of which is the whole point of this code).

(From OE-Core rev: 611cee69d7300a4746edd752c9557af60e7beecc)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05 14:49:06 +01:00
Cuero Bugot
f5cd91aae0 uninative: add variables to the whitelist so that it does not re-triger recipe parsing
When uninative is activated (poky's default) internal datastore variables are modified (NATIVELSBSTRING and SSTATEPOSTUNPACKFUNCS) to enable uninative
support. This is happening after parsing is done at the beginning of the build. On the next bitbake call the recipe would be parsed if the two
variables above were not added to the parsing whitelist BB_HASHCONFIG_WHITELIST.

The fix is to add these two variables to the recipe parsing whitelist BB_HASHCONFIG_WHITELIST, this is done at recipe parsing time, only when
uninative.bbclass is used.

(From OE-Core rev: 75bb95ada98ef129d2fa48568f27dddb078c852c)

Signed-off-by: Cuero Bugot <cbugot@sierrawireless.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-03 23:53:20 +01:00
Jonathan Liu
4ca75e4226 kernel.bbclass: improve reproducibility
Set KBUILD_BUILD_VERSION=1 to avoid build version being incremented on
every build. It is visible in the output of "cat /proc/version" after
the hash character.

(From OE-Core rev: 7fa32ee42c3320e9e2b24ef747e43484b719f617)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-03 23:53:19 +01:00
California Sullivan
dfd5dc1f55 default-distrovars: set default KERNEL_IMAGETYPE(S)
With the change from assuming kernels will be named "vmlinuz"
everywhere, to instead using KERNEL_IMAGETYPE, we require that
KERNEL_IMAGETYPE is set to something. Instead of setting the default in
multiple individual files, set it in default-distrovars.inc.

x86(-64) arches get bzImage as the default. Others get zImage as per
meta/conf/documentation.conf.

Also set KERNEL_IMAGETYPES, as we will eventually be switching away from
KERNEL_IMAGETYPE.

Thanks to Andre McCurdy <armccurdy@gmail.com> for the arch defaults
part.

(From OE-Core rev: a57d784211a39587538094425ee0246e9ddfbf9d)

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-31 09:48:42 +01:00
Richard Purdie
080a2138db package_rpm: set _builddir to B not S
Recipes which use a shared workdir (e.g. gcc-runtine and libgcc) can
race over temporary files causing interesting build failures.

Using B instead of S avoids this problem.

[YOCTO #12605]

(From OE-Core rev: d6c13a5ff441f7076eb327c0d0b747bd7603db0f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-30 00:31:18 +01:00
Richard Purdie
6b96d9ff73 multilib: Don't extend make-mod-scripts as a multilib version doesn't make any sense
The multilib version would race against then non-ml version leading
to all kinds of odd build failures.

(From OE-Core rev: 6bb70bd3857edb8cb6cc1317f57b899a89be2653)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-30 00:31:18 +01:00
Mikko Rapeli
f6cbf2eadd mirrors.bbclass: change Debian anonscm to salsa
Debian anonscm service in Alioth is shutdown and thus
fetching sources fails.

https://wiki.debian.org/Alioth

"Alioth is broken, and there is nobody around to fix it. Don't ask the remaining people who give it life support to implement fixes and changes. It is being replaced by a cocktail of ?GitLab (see Salsa), read-only repos and keep-alive mechanisms. See below for more information."

https://wiki.debian.org/Salsa

"What is Salsa?

Salsa is the name of a collaborative development server for Debian based on the gitlab software. Salsa is supposed to provide the necessary tools for package maintainers, packaging teams and other Debian related individuals and groups for collaborative development.

What is the status of Salsa?

After various discussions about the future of Alioth, the Alioth Sprint in August 2017 gave birth to the initial setup of the the upcoming Salsa service. The productive weekend resulted in a working prototype and was launched as a beta in December 2017. It left its beta status in January 2018."

(From OE-Core rev: 08ff7b42d8b7d06ef61255185c95e900ada8769b)

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>
2018-03-28 12:09:52 +01:00
Andre McCurdy
e092acd524 package.bbclass: use single quotes for path passed to file in isELF()
Apparently there are recipes in the wild which generate files with
filenames containing '$' characters - which cause errors during
packaging.

Instead of adding another special case to escape '$' characters when
constructing the command passed to oe.utils.getstatusoutput(), switch
to using single quotes to quote the path - and therefore make isELF()
consistent with the way filenames and paths are quoted by every other
caller of oe.utils.getstatusoutput() in oe-core.

(From OE-Core rev: 7877761534b0c2492da6289e9f2269d41b6ed464)

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>
2018-03-28 12:09:52 +01:00
Andre McCurdy
d1b305e40c sanity.bbclass: quote path passed to stat in get_filesystem_id()
Although get_filesystem_id() is a private API and never gets passed
a path containing spaces or other special characters, etc, quote the
path anyway for consistency.

(From OE-Core rev: 1a9878cdb1cdb807c47e852b780c8ef9b93a214e)

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>
2018-03-28 12:09:52 +01:00
Amanda Brindle
b6b6e006f7 waf.bbclass: Throw error if waf doesn't exist
Before, waf.bbclass would fail to catch FileNotFoundError. Now, it will
catch this error and say that waf doesn't exist.

Fixes [YOCTO 12553]

(From OE-Core rev: f8321dedec7abe392f7e49ff8eee0640463adae5)

Signed-off-by: Amanda Brindle <amanda.r.brindle@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-25 09:40:42 +01:00
Juro Bystricky
cf6f3c023c reproducible_build.bbclass: support for binary reproducibility
Setup environment for builds requiring binary reproducibility.
Determine and export SOURCE_DATE_EPOCH per each recipe.
This is a crucial step to achieve binary reproducibility.
The value for this variable (timestamp) is obtained after source code for
a recipe has been unpacked, but before it is patched. If the code sources
come from a GIT repo, we get the timestamp from the top commit. (GIT repo
does not preserve file mktime timestamps). Otherwise, if GIT repo is not
present, we try to get mtime from known files such as NEWS, ChangeLog, etc.
If this also fails, we go through all files and get the timestamp from the
youngest one. We create an individual timestamp for each recipe.
The timestamp is stored in the file '__source_date_epoch.txt' (in the folder
source-date-epoch_). Later on, each task reads this file and sets
the exported value of SOURCE_DATE_EPOCH to the value found in the file.

Uasge:

INHERIT += "reproducible_build"

[YOCTO#11178]
[YOCTO#11179]

(From OE-Core rev: cc438ac7711dedbe05d654e99af9316c9215b02e)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-25 09:40:42 +01:00
Andreas Müller
4fb30daa96 externalsrc: do not call make clean for recipes with CLEANBROKEN = "1" set
ERROR: distrho-ports-0.0.0+git999-r0 do_buildclean: oe_runmake failed
ERROR: distrho-ports-0.0.0+git999-r0 do_buildclean: Function failed: do_buildclean
ERROR: Logfile of failure stored in: <...>/temp/log.do_buildclean.17285
Log data follows:
| DEBUG: Executing shell function do_buildclean
| NOTE: make clean
| make clean -C libs/drowaudio
| make[1]: Entering directory '/home/a.mueller/data/oe-core/workspace/sources/distrho-ports/libs/drowaudio'
| make clean -C build-drowaudio
| make[2]: Entering directory '/home/a.mueller/data/oe-core/workspace/sources/distrho-ports/libs/drowaudio/build-drowaudio'
| make[2]: *** No rule to make target 'clean'.  Stop.
| make[2]: Leaving directory '/home/a.mueller/data/oe-core/workspace/sources/distrho-ports/libs/drowaudio/build-drowaudio'
| make[1]: *** [Makefile:7: clean] Error 2
| make[1]: Leaving directory '/home/a.mueller/data/oe-core/workspace/sources/distrho-ports/libs/drowaudio'
| make: *** [Makefile:73: clean] Error 2
| ERROR: oe_runmake failed

(From OE-Core rev: 21fa28d8faf33b2717e38886352238dd360ef346)

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-25 09:40:42 +01:00
Otavio Salvador
e317745665 glide.bbclass: Add class to easy Glide use
To use 'glide' this class does the integration and reduces code
duplication.

(From OE-Core rev: e0dbcdc2ca0b05b6b062a0ec1496204bb2122fbf)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-25 09:40:42 +01:00
Maxin B. John
f6f688842b image_types.bbclass: Rename lz4_legacy to lz4
LZ4 format currently used by the Linux kernel is the 'legacy' format.

In order to avoid creating an image that can't be used as a compressed
initial ramdisk with Linux kernel, rename lz4_legacy to lz4.

[YOCTO #12461]
[YOCTO #12149]

(From OE-Core rev: 0c62a9b272d381bd5a16cfef19ecd1a15f521473)

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>
2018-03-20 09:59:32 +00:00
California Sullivan
d5075b648b kernel.bbclass: set HOSTLDFLAGS in KCONFIG_CONFIG_COMMAND
Kernel v4.14 and newer contain the following in their Makefile:

HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS)
HOSTLDFLAGS  := $(HOST_LFS_LDFLAGS)

This breaks our menuconfig, because it can no longer find ncurses if its
not on the host machine. This can be seen in linux-yocto-dev, for
example:

[clsulliv@clsulliv build]$ bitbake virtual/kernel -c menuconfig

  GEN     ./Makefile
  HOSTLD  scripts/kconfig/mconf
/home/clsulliv/yocto/poky/build/tmp/hosttools/ld: cannot find -lncurses
/home/clsulliv/yocto/poky/build/tmp/hosttools/ld: cannot find -ltinfo
collect2: error: ld returned 1 exit status
make[3]: *** [scripts/Makefile.host:99: scripts/kconfig/mconf] Error 1
make[2]: *** [/home/clsulliv/yocto/poky/build/tmp/work-shared/intel-corei7-64/kernel-source/Makefile:504: menuconfig] Error 2
make[1]: *** [Makefile:146: sub-make] Error 2
make: *** [Makefile:24: __sub-make] Error 2
Command failed.
Press any key to continue...

Fix this by setting HOSTLDFLAGS to ${BUILD_LDFLAGS} in our
'make menuconfig' command.

(From OE-Core rev: 6afe8e211bfb3deb359194488f34a2c56f4b5ef6)

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>
2018-03-20 09:59:32 +00:00
Khem Raj
a6a96feb18 insane.bbclass: Fix typos in 32bit risc-v machine type
(From OE-Core rev: 33d79f19dd3a2b5777e07fbf75ec4635d08e60e8)

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>
2018-03-15 06:27:19 -07:00
Khem Raj
eb263b79dc insane.bbclass: add support for RISC-V baremetal
(From OE-Core rev: 9b30e805e769b6c8c12a9aba072f7df066b19179)

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>
2018-03-15 06:27:19 -07:00
Ross Burton
3f2fe7a734 gtk-doc: use --srcdir instead of cd
(From OE-Core rev: 1bf1cf24f520960d3d10b0b71d665107953dba54)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-15 06:27:19 -07:00
Ross Burton
29c6083d1f gtk-doc: always inherit python3native
My attempt at only inheriting python3native if it was needed was broken and
didn't work, so back it out and always inherit.

(From OE-Core rev: eb08ce66cf7ca6dbdb51fb9b9725267606fba6b9)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-15 06:27:19 -07:00
Richard Purdie
cc02a00d27 uninative: Add compatiblity version check
If glibc is newer on the host than in uninative, the failure mode is
pretty nasty for clusters where the sstate is shared, including the Yocto
Project autobuilder.

This check aborts the use of uninative in such scenarios where a newer
glibc version appears and avoids corruption of sstate caches.

We use ldd to check the glibc version since that is included in libc-bin
(or equivalent) which locales use so it should always be present.

(From OE-Core rev: d6f6101cd0ae92e8ad2dec0bcb6db5044726edf9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-15 06:27:19 -07:00
Alexander Kanavin
c64a57d2ec package.bbclass: run pre/post installation/removal scriptlets using sh -e
This allows catching errors in the scriptlets which would otherwise
go unnoticed, e.g. this sequence:
====
bogus_command
proper_command
====
would work just fine without any visible warnings or errors.

This was previously done only for rpm packages; this patch replaces
the rpm-specific tweak with one that works for all package types.

(From OE-Core rev: a0aa12e1d0ea9064b8dd816d4e82238df765506b)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-15 06:27:18 -07:00
Juro Bystricky
a5644b6811 reproducible_build_simple.bbclass: simple environment for reproducible binaries
Export environmental variables needed for binary reproducibility with consistent values.

This class can be used either directly via:
INHERIT += "reproducible_build_simple"

or can be inherited by a more complex/complete bbclass, for example a bblass which
will crack SOURCE_DATE_EPOCH for each recipe.

(From OE-Core rev: 5c2685c5ee2f8210a36b9a8591491b6af0482084)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-12 15:06:32 -07:00
Juro Bystricky
98e852983c classes/recipes: Use expanded BUILD_REPRODUCIBLE_BINARIES value
Replace the occurences of BUILD_REPRODUCIBLE_BINARIES with expanded
values ${BUILD_REPRODUCIBLE_BINARIES} so the variable does not need to be
exported.

(From OE-Core rev: 27f87bbc8395a2481ef808465a62d213a6b678ac)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-12 15:06:32 -07:00
Bruce Ashfield
128dd9ec60 kernel: make copying of crtsavres.o conditional
As of the 4.13 kernel, there are configuration + linker combinations
that do not need (or build) crtsavres.o for ppc64 targets. The commit
of interest is:

    commit efe0160cfd40a99c052a00e174787c1f4158a9cd
    Author: Nicholas Piggin <npiggin@gmail.com>
    Date:   Fri May 12 01:56:52 2017 +1000

        powerpc/64: Linker on-demand sfpr functions for modules

        For final link, the powerpc64 linker generates fpr save/restore
        functions on-demand, placing them in the .sfpr section. Starting with
        binutils 2.25, these can be provided for non-final links with
        --save-restore-funcs. Use that where possible for module links.

        This saves about 200 bytes per module (~60kB) on powernv defconfig
        build.

        Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
        Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

As such, our arch test for crtsavres.o is not enough, we add a secondary
existence check before trying the copy.

[YOCTO #12576]

(From OE-Core rev: af58819253a2d4526dc8871a17e1492bd1d92951)

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>
2018-03-08 15:28:04 -08:00
Ross Burton
ffa658dc8f gtk-doc: inherit classes only if gtk-doc is enabled
Respect GTKDOC_ENABLED when inheriting python3native and DEPENDing on
qemu-native, as they're not needed when disabled.

python3native is required as otherwise the host Python is most likely used which
may or may not have python3-six installed (a requirement of gtk-doc).

(From OE-Core rev: b93386b22e1dc78b2917652dac4ad02745a99989)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-07 06:34:52 -08:00
Chen Qi
d1e6aa57f7 meson.bbclass: fix to build for more projects
We should use the value of CC for the c compiler setting in cross
compilation configuration file for meson. For example, if we only
use ${HOST_PREFIX}gcc instead of ${CC}, we would meet the following
do_compile failure for systemd.

  cc1: fatal error: linux/capability.h: No such file or directory

Do the same change for LD, AR, NM, STRIP and READELF.

(From OE-Core rev: 177bd96a531fcc85e62baff04aba327e2bccee07)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:43:10 -08:00
Khem Raj
160e7b0875 godep.bbclass: Add helper class to enable go-dep tool
Many go packages can take advantage of dep tool since
they manage their own dependencies, this class helps
in using go dep tool for such packages

(From OE-Core rev: 9bea8313b0dd5a6af08d15ee8634fe2ef9ee0f75)

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>
2018-03-06 06:43:10 -08:00
Matt Madison
3ffafcd9cf go.bbclass, goarch.bbclass: update SECURITY_CFLAGS
With go1.10 the NOPIE flags are only required for
MIPS target builds, and are now incompatible for
the other architectures.

(From OE-Core rev: f2ff90eb7d27a2f69f5948fa8c301de30f5c8132)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:43:10 -08:00
Matt Madison
58472bc7d0 goarch.bbclass: disable shared runtime for nativesdk builds
While useful on embedded devices for saving disk space, use
of shared runtime in Go is not the usual practice, so disable
it for nativesdk builds.  We don't use it for native builds,
either, so this makes the SDK match the native environment
more closely.

(From OE-Core rev: fde7017f9735c0d317023022817b28771df53109)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:43:10 -08:00
Matt Madison
13fd7abbe0 go.bbclass: ptest cleanup and improvements
* Don't enable verbose test output (-test.v)
  by default, as it generates too much noise
  for automated results parsing

* Override do_install_ptest_base in the bbclass,
  so recipes can provide their own modifications
  with do_install_ptest.

* Improve the generated run-ptest script to better
  handle large numbers of tests, and to generate
  'status: test name' output similar to Automake
  tests.

* Install all non-vendored 'testdata' directories
  from the source into the ptest package, as some
  packages share test data among multiple tests.

(From OE-Core rev: 11037462d80cefbee90a69e6a8a95895375ed6da)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:43:10 -08:00
Matt Madison
02b8eae8c7 go.bbclass: don't stage test data with sources
Any directory in a Go package's source tree called
'testdata' contains test data, and isn't necessary
for building.

Some packages include ELF files and other binaries
as test data, and staging them in the sysroot and
-dev package leads to unnecessary QA warnings.

(From OE-Core rev: b013db7ab58d4d56ad5c6e54a3a32df31aaf8809)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:43:10 -08:00
Matt Madison
b6ff2564e9 go.bbclass: remove debug-related commands
The 'go env' in the do_compile function and
the set -x/+x in the do_install_ptest function
were used for debugging the bbclass, and aren't
really needed.

(From OE-Core rev: 351e9fc39408e094bbb4beedf51221adc8afd143)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:43:10 -08:00
Matt Madison
29af62dfa0 go.bbclass: rename GO_TMPDIR -> GOTMPDIR
and export it. Go 1.10 now supports using this
separate variable locating its temporary files.

TMPDIR is still set, for compatibility with go1.9;
that can be dropped once 1.9 is retired.

(From OE-Core rev: ce9d70ae2f9981bf5b42641922c34c1ed54eeca3)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:43:10 -08:00
Matt Madison
dc2e108efe go: set GOMIPS envrionment variable
Go 1.10 adds support for selecting hard/soft float
object code through the GOMIPS environment variable.

(From OE-Core rev: f3cabc92dca3408da18f04e4af4051fba1f63c14)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:43:10 -08:00
Matt Madison
7a4ca89b55 go: update go 1.9 -> go 1.10
* Patches and recipes reworked for go 1.10's significant
  changes to its bootstrap and build steps.

* Update go1.4 source tarball used for go-native
  bootstrapping to the version recommended
  in the current go documentation

* Remove test data from installed sources to eliminate
  some packaging QA warnings

* Set GOCACHE to 'off' to disable 1.10's build caching
  in the go recipes and bbclass

* Update go_do_compile to compile both static and
  dynamic objects dynamic linking is in use, since
  go1.10's build tool is pickier about this

(From OE-Core rev: 4fd749ca6450a4870be1c1e13802f084b6eb0db6)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:43:10 -08:00
California Sullivan
5e039c33d9 systemd-boot-cfg.bbclass: Don't reference or set OVERRIDES
There's no need to add to the local copy of overrides and then not do
anything with it.

Now that this function is being used in package creation it was causing
sstate issues as well, as MACHINE is always in OVERRIDES, so something
trivial such as the name of the MACHINE would cause the hash to change.

(From OE-Core rev: 24ddc80fc39291d9952b8e3bd37d66c1c4376e6b)

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:35:42 -08:00
California Sullivan
3449ae0f5d grub-efi-cfg.bbclass: Don't reference or set OVERRIDES
There's no need to add to the local copy of overrides and then not do
anything with it.

Now that this function is being used in package creation it was causing
sstate issues as well, as MACHINE is always in OVERRIDES, so something
trivial such as the name of the MACHINE would cause the hash to change.

(From OE-Core rev: 56ab83611d9737b42f05586d2c45d5c438cfc293)

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:35:42 -08:00
California Sullivan
00acdebbed systemd-boot*.bbclass: Don't use vmlinuz
We can't guarantee vmlinuz anymore. Use KERNEL_IMAGETYPE instead.

(From OE-Core rev: cceb4266f3e70382e171c3a338c10d9730c9dc3f)

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:35:42 -08:00
California Sullivan
dbe0736341 systemd-boot.bbclass: break out configuration creation
This class is useful on its own and can be used to create configuration
recipes.

(From OE-Core rev: 5d14ff6e25d3b334d4cc9363a6ddeb16f4c2911d)

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:35:42 -08:00
California Sullivan
49c638264c syslinux.bbclass: don't use vmlinuz
We can't guarantee the kernel will be named vmlinuz anymore. Use
KERNEL_IMAGETYPE instead.

(From OE-Core rev: 8e9a5350e51d4c3be5417e55e4fd1428f49f3d8b)

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:35:42 -08:00
California Sullivan
b6e36c0197 grub-efi*.bbclass: don't reference vmlinuz
Rather than renaming the kernel to vmlinuz and assuming the name is
vmlinuz in the grub.cfg, copy to ${KERNEL_IMAGETYPE} and also use that
value in the grub.cfg file.

(From OE-Core rev: d37be17527b354fddb3a5740d0197c590d620f42)

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:35:42 -08:00
California Sullivan
9703185a83 live-vm-common.bbclass: Don't use vmlinuz or VM_DEFAULT_KERNEL
I can't find VM_DEFAULT_KERNEL used anywhere else, and we should not be
statically installing the kernel as vmlinuz.

(From OE-Core rev: 5493bb5ba4b4520f944d38b214a3d53a5282e0be)

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:35:42 -08:00
California Sullivan
a9921f64a7 grub-efi.bbclass: split out configuration portion
This part is useful on its own, whereas the whole class together is
specific for image-live.

(From OE-Core rev: 8daf2c544eb40d97d99a41627ddc5529c0e23f3c)

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:35:42 -08:00
Tim Orling
d41bcbdebf meta/classes: add ptest-perl.bbclass
* Enable easier testing of perl modules
  - Installs t/* to PTEST_PATH
  - Uses common run-ptest script

(From OE-Core rev: aeffa15350252489c62cd221b2e0548043fec548)

Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:19:18 -08:00
Ross Burton
dc7ec9b8e0 populate_sdk_base: depend on nativesdk-glibc-locale
If we're building a SDK and we're using glibc so may be installing locales,
add a build-dependency on natiesdk-glibc-locale so the locales we need will
exist.

(From OE-Core rev: 8d6869a0a89d8cf3c6e57723fab2750ba2c885db)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-06 06:19:18 -08:00
Richard Purdie
be4c9df542 base: Handle backfilling in anonymous python code, not event handler
Handling of backfilling is trickier than you'd think. We need this to execute
early enough that the user will see the changes in bitbake -e and other output
yet late enough that the virtclass extensions have changed the tunes before
it executes.

It makes more sense to execute this at anonymous python time now bitbake -e
correctly handles this and that unbreaks multilib corruption of these variables.

[YOCTO #12373]

(From OE-Core rev: cefd312541019c1bb0132f41334df58971fd81ef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-04 11:35:42 +00:00
Richard Purdie
49f7c2cd87 image: Remove the do_package_write_* tasks
Now we're filtering tasks in the rpm indexing code so that tasks can only
see the packages they really depend upon, having noexec package_write tasks
around is causing problems since the tasks exist but don't have manifests.

Removing the tasks entirely solves this problem and streamlines the
task execution graph too.

(From OE-Core rev: 027445cd88a4e706bdfe83bb4ff2c21e2186982a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-04 11:35:42 +00:00
Richard Purdie
1a992fd418 base: Don't print LICENSE warning for non-recipe context
Now bitbake is executing anonymous python fragments in bitbake -e,
ensure we don't show the error in that context (where PN would be
unchanged from default).

(From OE-Core rev: 79240b3af32c7fa44751752e9e8f2ff832439643)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-04 11:35:42 +00:00
Justin Bronder
088b3b8c4c kernel-yocto: check git config during checkout
Initialize the git config prior creating a git repository in a plain
directory.

(From OE-Core rev: 0e3a9bed988b5fd4de770fe8cd1160b9f6c8c365)

Signed-off-by: Justin Bronder <jsbronder@cold-front.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-04 11:35:40 +00:00
André Draszik
02fa98e663 cmake: refactor compile and install for easier re-use
cmake_do_compile() and cmake_do_install() basically do the
same, except they use a different --target, and at the
moment this is copy/pasted code with a minor modification.

Other recipes which e.g. might want to support compilation
as part of ptest have to do the same. This is a bit
inconvenient.

By factoring out all of this into a common helper,
cmake_runcmake_build(), this is easily re-used. An
(imaginary) recipe can compile ptest support simply by
using
  cmake_runcmake_build --target buildtest-TESTS
(assuming such a build target exists).

Also, this now is very similar to oe_runmake().

(From OE-Core rev: 7620dafe7358f017a8cd558b480af73896768f04)

Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-04 11:35:40 +00:00
Joshua Watt
10a51d758f icecc: Remove several getVar() expand arguments
Several of the calls to getVar() were either superfluously passing
True for the expand argument, or were wrongly passing False

(From OE-Core rev: a7b0f7605f62420d7c9b9d5ef2e03c5cc5c81d03)

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>
2018-03-04 11:35:40 +00:00
Ross Burton
2f56415059 populate_sdk: install UTF-8 locales in SDKs
As glibc 2.27 can't read older locale-archives, SDKs using glibc 2.27 on hosts
using glibc earlier than 2.27 won't be able to find any locales, so bitbake
won't start and Python can't use UTF-8.

So by default install all locales into the SDK.  Special-case Extensible SDKs by
installing no locales as they ship glibc in a buildtools, and that will have the
locales.

Locale installation requires cross-localedef, so add that to DEPENDS.

Also remove the explicit en_US addition in buildtools-tarball as it is now
redundant.

(From OE-Core rev: 96896568d197cd06302713c24c0f7d91bfaea6c1)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-01 22:18:47 +00:00
Ross Burton
bdb026db90 package.bbclass: fetch PRIVATE_LIBS twice as we iterate twice
The shlibs detection/handling iterates the package list twice, but PRIVATE_LIBS
is only fetched in the first loop which means the second loop only considers the
value set.

(From OE-Core rev: 8c90c0081c38b33c99655f806cbe668600c170cc)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-01 22:18:46 +00:00
Joshua Watt
6497ebc0d6 icecc.bbclass: Ignore more icecream vars in hashes
Changing ICECC_ENV_VERSION or select variables that the user can set to
control the behavior of icecc should not cause recipes to rebuild

(From OE-Core rev: b2c64414bbc357d35c1b076840bfc6ede3c90754)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-01 22:13:55 +00:00
Richard Purdie
3eff72cc1f sstatesig/staging/package_manager: Create common sstate manifest code
Create a common function for locating task manifest files rather than
several implementations with missing pieces.

(From OE-Core rev: 68150bac7444f089f19c789e9f6602d59f605d7a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-01 22:13:55 +00:00
Jason Wessel
4e3d3c122f logging.bbclass: Enclose the tr string in quotes
On some linux hosts image recipes will fail to build as follows:

ERROR: build-essential-0.3-r0 do_image_ext3: Usage: bbdebug [123] "message"
ERROR: build-essential-0.3-r0 do_image_ext3: Function failed: do_image_ext3 (log file is located at /opt/build/tmp/work/intel_corei7_64-wrs-linux/build-essential/0.3-r0/temp/log.do_image_ext3.43744)
ERROR: Logfile of failure stored in: /opt/build/tmp/work/intel_corei7_64-wrs-linux/build-essential/0.3-r0/temp/log.do_image_ext3.43744
ERROR: Task (/opt/layers/meta-overc/meta-build/recipes-core/images/build-essential_0.3.bb:do_image_ext3) failed with exit code '1'

Running with bitbake -v -v -v -D we get in the log file:
+ bbdebug 1 Executing 'dd if=/dev/zero of=/opt/build/tmp/work/intel_corei7_64-wrs-linux/build-essential/0.3-r0/deploy-build-essential-image-complete/build-essential-intel-corei7-64-20180220190510.rootfs.ext3 seek=484486 count=0 bs=1024'
+ USAGE='Usage: bbdebug [123] "message"'
+ '[' 3 -lt 2 ']'
+ DBGLVL=1
+ shift
++ echo 1

++ echo 1
++ tr -d t

++ tr -d t
+ NONDIGITS=1
+ '[' 1 ']'
+ bbfatal 'Usage: bbdebug [123] "message"'

The debug output tells us that the NONDIGITS check failed to remove
the digits using the tr expression.  Enclosing the expression in
quotes causes it to work properly.

(From OE-Core rev: 9e6d283aa9c77685f55a62fa220226d9149ecd7a)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-24 10:31:48 +00:00
Peter Kjellerstedt
eaa9356744 meson.bbclass: Add support for nativesdk
We need to use the meson.cross file when building for nativesdk.
Additionally, we need to trick meson's sanity tests, just as it is
done for target builds.

(From OE-Core rev: abcb330c462c2c06d36f8f3681a6bd07d562c1fe)

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>
2018-02-24 10:31:47 +00:00
Denys Dmytriyenko
20e4d309e1 kernel.bbclass: explicitly depend on bison-native for deterministic builds
Explicitly depend on bison-native for deterministic builds, as it is required
for the build:

|   HOSTCC  scripts/basic/fixdep
|   GEN     ./Makefile
|   HOSTCC  scripts/kconfig/conf.o
|   YACC    scripts/kconfig/zconf.tab.c
| /bin/sh: bison: command not found
| scripts/Makefile.lib:217: recipe for target 'scripts/kconfig/zconf.tab.c' failed

In most cases, this dependency comes indirectly via toolchain dependencies,
specifically binutils-cross, which pulls bison-native. Different setups,
such as with external toolchain, would expose this problem, since correct
dependency is not marked explicitly.

(From OE-Core rev: d26b700553fe8fa21c2e42b04e11bb380d94ef36)

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-24 10:31:47 +00:00
Joshua Watt
3294e0e79a icecc.bbclass: Remove icecream from uninative
The icecream native tools should not be included in uninative tarballs
even though it is nativesdk

(From OE-Core rev: fd87ebd7e8906e047620c2d4afa62337b5521e6f)

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>
2018-02-24 10:31:47 +00:00
Joshua Watt
b803bbcad2 icecc.bbclass: Add environment version
Adds a version to the environment which can be used to invalidate any
previous environments on the remote compile nodes

(From OE-Core rev: 9bda79af100293ea3cb986dd501e0be028f2f04c)

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>
2018-02-24 10:31:47 +00:00
Joshua Watt
dbf9346eaf icecc.bbclass: Fix combining with ccache
Fixes the case where ccache is enabled along with Icecream. In these
cases, there is the danger that Icecream will accidentally add the
ccache executable to the toolchain, which prevents it from working. In
particular, Fedora enables ccache by default via symbolic links in PATH.

(From OE-Core rev: 09ba173f56dcd7299a07d4dac3633fe7818f7282)

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>
2018-02-24 10:31:46 +00:00
Konstantin Shemyak
2e07b1c0bb cve-check-tool: correctly exported web proxies
The binary 'cve-check-update' downloads the CVE database from the Internet.
If the system is behind a web proxy, the download fails, as proxy-related
variables are not exported.
In turn, 'cve-check-tool' does not connect to the network and correspondingly
does not need exported proxies.

Exported all proxy-related environment variables to 'cve-check-update' and
removed the unneeded export from 'cve-check-tool'.

(From OE-Core rev: 17db210975c740aff12732c511cf4fb32b507365)

Signed-off-by: Konstantin Shemyak <konstantin.shemyak@ge.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-24 10:31:46 +00:00
Armin Kuster
20ba50bc8c siteinfo: add aarch64_illp32 decode
(From OE-Core rev: 8f9d6f92edb5682a7f2012af6466dbcd19e2e422)

Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-24 10:31:46 +00:00
Armin Kuster
ed551d23d7 update-rc.d: QA regression.
I noticed many new QA warning with arm64 mulitlib
suspicious values 'initd-functions-dev' in RRECOMMENDS [multilib]

I believe this is a regression via commit
http://cgit.openembedded.org/openembedded-core/commit/meta/classes/update-rc.d.bbclass?id=cdcebd81c872cb7386c658998e27cf24e1d0447c

(From OE-Core rev: 223119dc96d2e37e3788df630d1995bf56dc156a)

Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-24 10:31:46 +00:00
Alexander Kanavin
d594496190 image-live.bbclass: drop support for compressed ISO images
While modern Linux kernels still support it, the userspace tools
haven't been updated in over a decade. Also, squashfs provides
both better performance, and better compression ratio:

https://elinux.org/Squash_Fs_Comparisons

(From OE-Core rev: 9443981d3934b366e39404719486d2b34d8a9d73)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-24 10:31:45 +00:00
Joe Slater
bb5a8acd65 make-mod-scripts: change how some kernel module tools are built
Remove do_make_scripts() from module-base.bbclass and put
functionality in a recipe.  This will build the scripts only
once instead of each time an external module is built.

[YOCTO #12228]

(From OE-Core rev: ea12c46fe8748fb6606c603d463075a8624e6563)

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-24 10:31:44 +00:00
Randy MacLeod
81b5154aaf package.bbclass: fix typos
All typos were in comments but some of these comments end up in run/log files.
The typos can be annoying when searching the log files so they're worth
fixing with ispell.

(From OE-Core rev: defffa3ba772d1643649591f6de96a4263570200)

Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16 18:05:40 +00:00
Joshua Watt
96a87ced10 externalsrc.bbclass: Suppress git errors
Suppress any warnings git might generate when searching for a valid git
directory, as there are use cases where the directory is expected to not
exist and the warning is superfluous

(From OE-Core rev: 66011996e1a8b738b31466fccad9973f8b48f71d)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16 18:05:40 +00:00
Joshua Watt
feded5fe27 utils.py: add parallel make helpers
The code to extract the integer number of parallel build threads and
construct a new argument from them has started to be copied in multiple
locations, so create two new helper utilities to aid recipes.

The first helper (parallel_make()) extracts the integer number of
parallel build threads from PARALLEL_MAKE. The second
(parallel_make_argument()) does the same and then puts the result back
into a format string, optionally clamping it to some maximum value.

Additionally, rework the oe-core recipes that were manually doing this
to use the new helper utilities.

(From OE-Core rev: ccd1142d22b31ed85d8823b1bc9e11ccfd72b61f)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16 18:05:40 +00:00
Ross Burton
4ae1f081a5 classes: don't scan for CVEs in images or packagegroups
There's no point even looking in the database for these, so unset CVE_PRODUCT.

(From OE-Core rev: f47da3e91541d75e1213dd9cf1f89ed16f21141a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16 18:05:40 +00:00
Ross Burton
325096cd2a cve-check: short-circuit checking if CVE_PRODUCT isn't set
For some recipes is is meaningless to do a CVE check, for example packagegroups
or images.  Check that CVE_PRODUCT is set and short-circuit the scan if it
isn't.

(From OE-Core rev: d1e7cb5c9e0d5d253b6bb5c968fa58944ea42d06)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16 18:05:40 +00:00
Ross Burton
4873716c0c cve-check: allow recipes to override their version
For reasons which I don't understand, the Berkeley DB tarball is version 5.3.28
but in CVE reports the version is 11.2.5.3.28.

To handle this allow recipes to override their version as well as their name.

(From OE-Core rev: 36fbf96cf284acbc810ff3bf00702f1f82bc0da9)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16 18:05:40 +00:00
Ross Burton
ccd664d8d0 cve-check: put log in T so it doesn't get deleted by rm_work
This is where the other task logs go, so it's a sensible place to put it.

(From OE-Core rev: 4bbb8cd5f3943231ab5be0448d1b0d4a08341249)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16 18:05:40 +00:00
Ross Burton
dc62837cac distrodata: remove redudant *all tasks now that --runall works correctly
(From OE-Core rev: 120dc59ad4a9ca232176c8a09bb3e43a9d1e24ac)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16 18:05:40 +00:00
Ross Burton
4239d9d2db archiver: remove deploy_all_archives task as --runall replaces it
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16 18:05:40 +00:00
He Zhe
c2f72f6cb7 kernel: Fix QA buildpaths warning for kernel modules
CFLAGS is unset during kernel_do_compile and thus the default build
path substitutions in DEBUG_PREFIX_MAP are missing.

To enhance reproducible build for kernel modules, such as lttng-modules
and cryptodev-module, this patch appends them, plus substitution of
STAGING_KERNEL_DIR, to KERNEL_CC.

(From OE-Core rev: ef7dac8511fc1647bc481c0e2ffa19e08e06f007)

Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16 18:05:39 +00:00
Joshua Watt
02c4f3a484 icecc.bbclass: Disable caret workaround by default
Icecream has a behavior that causes it to recompile files locally if gcc
generates any warnings or errors. The reason for this is that GCC tries
to re-read the input file in order to display the offending line with a
caret below it, which doesn't work in the remote chroot.

Default to disabling this this workaround and add
-fno-diagnostics-show-caret to the GCC flags so that errors and warnings
generated by GCC do not show erroneous results.

(From OE-Core rev: a1488291c5733a113c28475352eded61bf52bfe8)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16 18:05:38 +00:00
Joshua Watt
502ee8e863 icecc.bbclass: Add Icecream support to SDK
If icecc is inherited, generated SDKs will automatically have optional
support for compiling using the Icecream distributed compiler

(From OE-Core rev: dea45ac88251b22b0b74dc4b3ba6ca13fe0b86d6)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16 18:05:38 +00:00
Joshua Watt
cf85c5a490 toolchain-shar-extract: Add post-relocate scripts
Recipes can now install post-relocation scripts which will be run when
the SDK is installed.

(From OE-Core rev: 93ec145f421a45077b40ae99ee6a96bc11f91f18)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16 18:05:38 +00:00
Joshua Watt
f1dfc8bbe1 icecc.bbclass: Skip canadian-cross compiles
icecc.bbclass will no longer attempt to distribute cross-canadian
compiles. While it is technically possible to generate a toolchain that runs
on the build system and generates executables for the host system, this
is not the normal way that icecc operates. There are so few of these
recipes that it is probably not worth maintaining a distinct code path
for them.

(From OE-Core rev: b8a39cf5884d4ab85e82c4437b81b5fbba06137e)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-15 13:28:54 +00:00
Joshua Watt
b20373e72d icecc.bbclass: Fix STAGING_BINDIR_TOOLCHAIN usage
STAGING_BINDIR_TOOLCHAIN is actually a path list, not a single path. Fix
icecc.bbclass to try all the paths in the variable instead of treating
it as a single path.

(From OE-Core rev: 8db0d3c14c166265b740030c208e0e19a0b2a1c6)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-15 13:28:54 +00:00
Joshua Watt
6d0d577767 icecc.bbclass: Move to shared work directory
Generate the icecc toolchains in a shared work directory. This class was
already setup to correctly synchronize creating the toolchains in a
shared location before the RSS changes, so return to that behavior
instead of generated the toolchains in each recipe's sysroot.
Additionally, it makes no sense for each recipe to generate a toolchain,
only to find it was already generated and uploaded to the compile server
by another recipe.

(From OE-Core rev: 20a53ac7818f268d4a4c86c8f35ca982baf96acf)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-15 13:28:54 +00:00
Richard Purdie
9726b66a1b package: Add INHIBIT_PACKAGE_STRIP_FILES to allow files to remain unstripped
There are cases where its useful to allow only a select few files
to be excluded from the package stripping mechanism. Currently
this isn't possible so add a variable to allow this.

This is to be used sparingly as in general the core code should be
doing the right thing. This is better than the alternative of leaving the whole
package unstripped.

(From OE-Core rev: 92845c65f8801de7dfa34c87b22ca2e66f18557a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-15 11:23:11 +00:00
Vineeth Chowdary Karumanchi
be15c2fefd kernel-fitimage.bbclass: Fix 64 bit ENTRYPOINT
64 bit entry point should be passed in 2 literals ( "0x1 0x00008000"
).ENTRYPOINT is assigned with first half only and erroring out as
'command not found' for the second half. Adding quotes while assignment fixes the
issue.

(From OE-Core rev: e886c9c5e1a8ab28388a2e8bbb936ad5eea78615)

Signed-off-by: Vineeth Chowdary Karumanchi <vineethchowz.chowdary@xilinx.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-15 11:23:11 +00:00
Richard Purdie
daf59ef368 utility-tasks: Drop fetchall and checkuriall tasks
The same thing can now be done with "bitbake <target> --runall=fetch"
or "bitbake <target> --runall=checkuri".

Dropping the tasks takes "bitbake core-image-sato -g" from 22s to 8s
since it no longer has to resolve the recursive dependencies (it
doesn't know if any given target will touch them or not until it
computes them). That is a significant enough win that its worth any
impact this may have on the small number of users using the tasks.

(From OE-Core rev: 8bbb43e948af45d0fa5ab31b456147f691fa2ec3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-15 11:23:10 +00:00
Böszörményi Zoltán
fa9c077068 npm.bbclass: Node module name and recipe name can be different
Some NPM modules have the same name as their low level dependencies.
To prevent recipe naming conflicts, allow node module recipe names
to start with the "node-" prefix.

(From OE-Core rev: 6b417c7c3a38463c64756beae9817fa2a80fd09e)

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-06 11:06:27 +00:00
Böszörményi Zoltán
d38e1e2c2e npm.bbclass: Fix building node modules with npm@5
npm cache clear throws an error with npm@5 and suggests to
use npm cache verify instead. But our cache is actually empty,
so use npm cache clear --force.

npm install in the source directory creates symlinks with npm@5.

Use a combination of npm pack and npm install module-version.tgz
that works the same way with older and new npm versions and is
guaranteed to create actual copies instead of directory symlinks.

This change allows using nodejs 8.x LTS, tested with 8.9.4.

(From OE-Core rev: 2d7d2a460842c8747df17990970f22f4a11f36f6)

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-06 11:06:27 +00:00
Joshua Watt
bb40162b2b waf.bbclass: cd to ${S} before checking version
waf requires that the current working directory be the project root (in
this case ${S} when it is invoked. The check to get the waf version was
being executed as a prefunc for do_configure, which meant it was
executed before the current working directory was switched to ${S}, and
thus would fail with some recipes. Fix this by changing to ${S} before
executing "waf --version"

(From OE-Core rev: aa168ee7f785ff007ca645db57698883922b5eb3)

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>
2018-02-06 11:06:27 +00:00
Max Krummenacher
8a8c31db1a image_types: tar with --numeric-owner
If --numeric-owner is neither used when creating or extracting the archive
containing the rootfs then tar tries to change the numeric uid/gid of the
files based on user/group names of the host used to extract the archive.

Create the archive with --numeric-owner to remove the burden of having to
use --numeric-owner when extracting.

(From OE-Core rev: 061e04cb6335a10f560e57255b7335b8c9891207)

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-06 11:06:27 +00:00
Juro Bystricky
0da28271bf sanity.bbclass: modified error message
(From OE-Core rev: ed41167521ccae14952e500d7432cb776636f4e9)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-06 11:06:27 +00:00
Alexander Kanavin
a2b7260f79 package_rpm.bbclass: run pre/post installation scriptlets using sh -e
This allows catching errors in the scriptlets which would otherwise
go unnoticed, e.g. this sequence:

====
bogus_command
proper_command
====

would work just fine. Note that this patch needs all of the preceding
patches, as otherwise running failing scriptlets with -e would defer
them to first boot, instead of properly reporting failure and aborting
the package installation.

(From OE-Core rev: 3cd8a55d5298ce9cc176e402fdb727abb26a1a4c)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-30 11:50:12 +00:00
Alexander Kanavin
6ca669105f package.bbclass: add support for pkg_postinst_ontarget()
This function is a convenient and more readable shortcut for situations
when the postinst code always needs to run on target. All commands that
cannot be executed during cross-install and can only be run on target
should go into this function. They will only be executed on first boot
(if package was cross-installed) or immediately during package installation
on target.

Plain pkg_postinst() works as before: it is run during cross-install time,
it can contain a request to defer to first boot, and it is also run
during package installation on target.

Also fix the oeqa test for this functionality to use the new function
where appropriate.

(From OE-Core rev: 229f4e975fb6957f44b5c56735fd6d58564098d7)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-30 11:50:12 +00:00
Ross Burton
58449f0e9c classes/utils: remove compatibility functions
These base_* functions were moved into meta/lib/oe back in 2010 and wrappers
left in utils.bbclass for compatibility.  It's been eight years, so I think it's
time to remove them.

(From OE-Core rev: 0391fcad9103abca0796a068f957d0df63ab4776)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-30 11:50:11 +00:00
Ross Burton
563a020870 meta: don't use deprecated functions from utils.bbclass
These functions were moved to meta/lib/oe in 2010 and the base_* functions in
utils.bbclass were intended to be a short-term compatibility layer.  They're
still used in a few places, so update the callers to use the new functions.

(From OE-Core rev: c97acbd034532895ce57c6717ed1b3ccc7900b0d)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-30 11:50:11 +00:00
Ross Burton
0c537554fc testimage: enable gi test suite
(From OE-Core rev: d8243c4588d4f1bb057fd917bfea130c4907e24c)

(From OE-Core rev: 1c896b34d2d9fdf941941bd29257a4714795da5a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-29 10:31:58 +00:00
Khem Raj
e13b6f76c7 meson: Adjust for clang compiler
Remove hardcoding c/c++ compiler to be gcc alone, its
possible to use clang as replacement for cross compilers
from meta-clang, therefore set clang/clang++ if
TOOLCHAIN = "clang"

(From OE-Core rev: 05789489d25a5ceac0403613ad789d78198be6ee)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-29 08:49:50 +00:00
Juro Bystricky
fb8087ab07 package_rpm.bbclass: improve reproducibility of RPM packages
The RPM packages contain BUILDHOST based on the current build host.
This breaks reproducibility if the same package is build on two different hosts.
To improve reproducible builds, we always set BUILDHOST as "reproducible".

(From OE-Core rev: f3beb683380ec0d9efa0d6af83205350afd1b2de)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-29 08:49:50 +00:00
Ross Burton
ffa0eb5fdc archiver: don't require that images are built using RPM to build SRPMs
The requirement for images being built using RPM is too strict to have access to
the RPM functions, simply checking that package_rpm is in PACKAGE_CLASSES is
sufficient.

Also fail if SRPMs are requested but package_rpm isn't enabled, instead of
silently not doing what we were asked.

(From OE-Core rev: cdae5c41e4f67a8757efc5ce1ef11d730edc3af1)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-29 08:49:50 +00:00
Otavio Salvador
add548491a package_rpm.bbclass: Fix matching of architecture independent packages
OE-Core changes the architecture independent RPM packages to use
"noarch" instead of "all". This change has been included in the commit
below:

,----
| commit 341810aff923ace6b1cc1e15e19383c4f8773b51
| Author: Alexander Kanavin <alexander.kanavin@linux.intel.com>
| Date:   Mon Jan 9 16:37:28 2017 +0200
|
|     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.
|
|     Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
`----

This is causing problems with machines that has "all" inside the
machine name.

Reported-by: Alexandru Palalau <ioan-alexandru.palalau@nxp.com>
(From OE-Core rev: 3e4ddeab65d4d2e4aaf03d442c2a1a8c7a2ce8a2)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-29 08:49:50 +00:00
Bruce Ashfield
be29a95bee kernel-yocto: make SRC_URI defconfig removal more specific
commit 7e98c295c1bb511e [kernel-yocto: ensure that only a single
defconfig is processed] has an overly broad replacement strategy
for 'defconfig' and hence will chop up any fragment name that
happens to contain that string.

If we change the processing to split on whitespace and drop
any full work 'defconfig' fragments, we'll get the behaviour
we want (no duplicate defconfigs, but fragments with defconfig
in their name are fine).

[YOCTO #12487]

(From OE-Core rev: fd2678190db6575dc909104b60c284d0c41f605f)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-27 13:15:28 +00:00
Ross Burton
c6459ca494 package_rpm: correctly handle LICENSE_${PN}
RPM spec files don't distinguish between spec-level license and the primary
package license, so always output the License for every package (defaulting to
the recipe-wide license) and use LICENSE_${PN} if set for the primary package.

As the primary use of package_rpm is to generate built packages, this fixes the
license fields in the generated packages.

[ YOCTO #12057 ]

(From OE-Core rev: 8c333e592fa7a3a887c792ac14e5cde2141b5d35)

(From OE-Core rev: 42e0de37d18f072dc5dcf5dc45cb441e4c2110d8)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-26 13:09:09 +00:00
Richard Purdie
8146e929e2 classes/recipes: Convert SkipPackage -> SkipRecipe
The new name is much more consistent with what this actually means. We put
the pieces in place to rename everything a while back but looks like we
forgot to actually do it! Fix that now.

(From OE-Core rev: af9612f5d6b848fceea22d10ee964437299be776)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-26 13:09:09 +00:00
Saul Wold
c44980abaf image_types: add support for modern f2fs flash filesystem
The f2fs filesystem is a newer flash filesystem that is available in
meta-filesystems. This needs a minimum sized blank space to operate
in correctly.

The f2fs has overprovision functionality and when building smaller
filesystems, you actually need more space, therefore under 500M (or so)
double the amount of space needed in order to handle the overprovision
functions in f2fs.

(From OE-Core rev: dec029686a47b574edfce4472fe2167db54398fb)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-23 23:43:46 +00:00
Ross Burton
a576c133e3 package_ipg: use xz when building packages
Add a dependency on xz-native and pass '-Z xz' to opkg-build to use xz instead
of gzip when building packages.

(From OE-Core rev: b95b6ba1a2959e2294a8848fa35f20163388eb06)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-23 23:43:45 +00:00
Zumeng Chen
1aa417df60 kernel-uboot: support Image kernel type for arm64
Image will be generated for arm64, and no compression for Image in u-boot as
well. So we just put the file into the right place for the rest of the build
to find it.

(From OE-Core rev: ce6337ab4b415ee18360dfe4443a71ab75a60254)

Signed-off-by: Zumeng Chen <zumeng.chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-23 23:43:45 +00:00
Richard Purdie
902b77bf91 lib/oe/package_manager/sdk: Ensure do_populate_sdk_ext and do_populate_sdk repos don't conflict
The repository indexes updated during do_populate_sdk_ext and do_populate_sdk
can conflcit. Add the missing lockfile calls for deb/ipk and in the rpm case,
ensure different directories are used for the index for the two sdk cases.

(From OE-Core rev: 5e5569c962c9ebc898eeb5044214e95117b190e1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-22 10:39:10 +00:00
Richard Purdie
63c8c8fb60 populate_sdk_ext: Set cleandirs correctly
The current conflicting use of SDKDEPLOYDIR causes a race between do_populate_sdk
and do_populate_sdk_ext potentially causing the SDK to either go missing or the
build to fail.

(From OE-Core rev: 792cfbab488782a7bd610fc2078077d5497be4d1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-22 10:39:09 +00:00
Robert Yang
e153efde97 multilib.bbclass: deltask populate_sdk and populate_sdk_ext
The "bitbake image -cpopulate_sdk/ext" generates SDK/eSDK for all multilib
variants, so "bitbake lib32-image -cpopulate_sdk/ext" is not needed, and it
doesn't work well, for example:

MACHINE ?= "qemux86-64"
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "x86"

$ bitbake lib32-core-image-minimal -cpopulate_sdk_ext
[snip]
Exception: FileExistsError: [Errno 17] File exists: '/buildarea/lyang1/test_q64/tmp/sysroots-components/core2-64/openssl/sysroot-providers/openssl10' -> '/buildarea/lyang1/test_q64/tmp/work/qemux86_64-pokymllib32-linux/lib32-core-image-minimal/1.0-r0/lib32-recipe-sysroot/sysroot-providers/openssl10'
[snip]

The problem is populate_sdk_ext installs all multilib variants, and
extend_recipe_sysroot() handles foo-image depends lib32-foo-image, but doesn't
handle lib32-foo-image depends foo-image, we can use a lot of trick ways to make
it work:
1) Get foo-image's RECIPE_SYSROOT when build lib32-foo-image
2) Handle conflicts with foo-image.do_rootfs
3) Handle conflicts when "bitbake lib32-foo-image foo-image -cpopulate_sdk_ext"

And maybe other potential problems, this looks painful, so just delete the task.

[YOCTO #12210]

(From OE-Core rev: 77144bc808be02deb3351c9c1bf5b4f2b8c3a6ec)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-19 12:37:14 +00:00
Ross Burton
66d783ca67 cmake: use Ninja by default
This changes the cmake class to use Ninja instead of Make by default.

If a recipe is broken with Ninja then the recipe can set OECMAKE_GENERATOR="Unix
Makefiles" to change back to Make.

(From OE-Core rev: bacaa26decb8a1e3fa672e1923954793fde48766)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-19 12:37:14 +00:00
Ross Burton
59879f31e1 cmake: allow the generator to be changed
Add OECMAKE_GENERATOR variable to control which generator is used by CMake,
defaulting to the upstream default of Unix Makefiles for now.  The other
supported option is Ninja, which is faster than Make for large projects (for
example, using Ninja takes three minutes off webkitgtk:do_compile for me).

(From OE-Core rev: 6e3f719076cab469f56cd1555bd219a5c3fd135d)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-19 12:37:14 +00:00
Martin Kelly
9ce6fa9a8f meson.bbclass: add MESON_LINK_ARGS to vardeps
Currently, we include MESON_C_ARGS in write_config[vardeps], but we
don't include MESON_LINK_ARGS, which also affects meson.cross. In
addition, we include TOOLCHAIN_OPTIONS, from which both are derived.

Add MESON_LINK_ARGS, and remove TOOLCHAIN_OPTIONS, which does not
directly appear in meson.cross and should be pulled in indirectly by
MESON_C_ARGS and MESON_LINK_ARGS.

(From OE-Core rev: 4db37cc8d9139076682e2528d29e92fad2eb1c90)

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-19 12:37:14 +00:00
Martin Kelly
ff5634ad88 meson.bbclass: include C{, XX}FLAGS in cross args
Currently, CFLAGS and CXXFLAGS are not making it into the compile line.
This is because meson appends CFLAGS/CXXFLAGS from the environment only
for native but not for cross builds (probably to keep cross-builds more
isolated). As a result, we need to make sure these vars goes into
meson.cross. This is similar to what cmake.bbclass does with
OECMAKE_C_FLAGS and OECMAKE_CXX_FLAGS.

Change c_args and cpp_args in meson.cross to include these vars, and
update write_config[vardeps] accordingly.

(From OE-Core rev: f435d1b75d3775f6ec0df6027766008b40209fd7)

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-19 12:37:14 +00:00
Martin Kelly
b895d11862 meson.bbclass: compile with --buildtype plain
OE manages all the compile flags, so we don't want meson to inject its
own flags. Currently, it's injecting -O0 and causing build breaks when
security flags are enabled (because _FORTIFY_SOURCE requires an
optimized build and meson defaults to a debug -O0 build).

Add --buildtype plain so meson will not add its own optimization flags.

(From OE-Core rev: 73ff85986d82c8da601d7c7cf9a02961f2f66a09)

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-19 12:37:14 +00:00
Otavio Salvador
b96f5db544 cmake: upgrade 3.9.5 -> 3.10.1
The 3.10.1 version has been in Dec 13, 2017, and has a great set of
features and improvements since the last upgrade.

The release notes of 3.10 release is available at:

https://cmake.org/cmake/help/v3.10/release/3.10.html

Patches updates:

 - cmake-Prevent-the-detection-of-Qt5.patch: so it replaces the sed
   command calls inside the cmake.inc

 - 0001-FindCUDA-Use-find_program-if-find_host_program-is-no.patch:
   merged upstream, so it has been removed.

 - support-oe-qt4-tools-names.patch: rebased.

License-checksum-change: added new contributors
(From OE-Core rev: 9e58926f1cea9d5cb18cb923855d1ae98f88a8ac)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-19 12:37:13 +00:00
Thomas Perrot
2acedd5632 kernel: Use KERNEL_IMAGETYPE_FOR_MAKE in do_bundle_initramfs
In the case of a fitImage the this step should be done on the
image use to assemble the fitImage.

(From OE-Core rev: a061c6bfd3a049a2c8d14bcfafd6e1837afb95e5)

Signed-off-by: Thomas Perrot <thomas.perrot@tupi.fr>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-19 12:37:13 +00:00
Andre McCurdy
f2d7b5b2ee kernel: drop unnecessary True options from calls to getVar
The older style calls (plus a bashism in kernel.bbclass, fixed
separately) were introduced via the recent change to add support for
multiple kernel packages:

  http://git.openembedded.org/openembedded-core/commit/?id=6c8c899849d101fd1b86aad0b8eed05c7c785924

(From OE-Core rev: e660ef68de3b3891a26ed6e10d96dc4efaf03ffc)

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>
2018-01-19 12:37:13 +00:00
Andre McCurdy
f4fb8ecb8a kernel.bbclass: drop legacy fallback to yes '' | make oldconfig
The "oldnoconfig" target has been supported since Linux 2.6.36.

According to OLDEST_KERNEL, the oldest kernel currently supported by
OE is 3.2.0, so the fallback to yes '' | make oldconfig is no longer
required.

(From OE-Core rev: 6abee5468e05333fbd9bd5ac8fc203a749ae3b3e)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-18 12:50:36 +00:00
Ross Burton
e23298ca85 classes/debian: clean up process spawning
This code is old and was of it's time, rewrite it to use modernish (we support
Python 3.4, so can't use subprocess.run()) subprocess and re idioms instead.

(From OE-Core rev: 8f7fdab41b8d6aced6753920bb5deed147c9baa8)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-18 12:50:36 +00:00
Ross Burton
eaf2636f6c classes/debian: fix library path handling
The existing code is looking for libraries in all paths which end in ${libdir}.
This caused false-positives for recipes such as lz4 which had files called
/usr/lib/lz4/ptest/usr/lib/liblz4.so, and resulted in lz4-ptest being
incorrectly renamed to liblz4.

Solve this by explicitly looking for ${libdir} etc under the packages-split
directory.

(From OE-Core rev: 7b1896f6f5367010b54c6a8b300db84037734533)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-18 12:50:36 +00:00
Ross Burton
0c0a239011 cmake: allow target names to be overridden
Don't hardcode the targets used in do_compile and do_install, instead build
"all" and "install" by default but respect OECMAKE_TARGET_COMPILE and
OECMAKE_TARGET_INSTALL variables.

(From OE-Core rev: 806765ec466597d38231d4be303cb48c26e21466)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-18 12:50:36 +00:00
Dariusz Pelowski
ad51bba5a9 base.bbclass: add automatic dependency on xz-native for .deb SRC_URI
FetchMethod.unpack requires xz for unpacking of embedded
data.tar.xz

(From OE-Core rev: 57f0a4ee29b9fc15749a9d42fdf01718a7099c2d)

Signed-off-by: Dariusz Pelowski <dariusz.pelowski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-14 09:11:58 +00:00
Richard Purdie
3c14bb4de2 cross-canadian/gettext: Drop unneeded nativesdk-gettext dependency
In line with the other gettext cleanups, drop the nativesdk-gettext dependency
as it isn't needed (similarly to the previous target gettext dependencies).

This then means we can drop DEPENDS_GETTEXT as there are no other users.

(From OE-Core rev: c43c054cb778e0c5c082996cd6e6c45f5fc9e1bf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-14 09:11:58 +00:00
Ricardo Salveti
ef4caecccb kernel.bbclass: remove bashism in kernel_do_install
possible bashism in run.do_install line 163 (should be 'b = a'):
if [ "kernel" == "kernel" ]; then

Fixes "[: kernel: unexpected operator" when not using bash by default,
which causes the default kernel image link to not be created.

(From OE-Core rev: 9d82fffd24742a5eb40bcb9b9ecea01a42be0be6)

Signed-off-by: Ricardo Salveti <ricardo@opensourcefoundries.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-14 09:11:57 +00:00
Ross Burton
8418f5555d autotools: don't wipe gettext macros from gettext
We usually forcibly delete any gettext macros we come across to ensure that the
latest versions we ship are used, but if we're building gettext then it's a bad
idea to delete the gettext macros.

Historically this hasn't been a problem as the top-level gettext configure
doesn't use AM_GNU_GETTEXT so the deletion was never done, but this may change.

(From OE-Core rev: f16657df977e54210774812d4e616403c76eb060)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-14 09:11:57 +00:00
Christopher Larson
ac18f28e22 meson.bbclass: use HOST_CC_ARCH, not TARGET_CC_ARCH
Using TARGET_CC_ARCH is inconsistent with CC, which uses HOST_CC_ARCH, and the
rest of meson.bbclass, which uses HOST_PREFIX, HOST_OS, etc.

(From OE-Core rev: 8a61e0c0c53275ebc623296f46676d920b11eb3b)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-13 10:15:20 +00:00
Andre McCurdy
746a534e1e base.bbclass: drop legacy armv7a-vfp-neon TUNE_PKGARCH renaming
ARM specific TUNE_PKGARCH renaming was adding in 2011 handle the
transition from armv7a -> armv7a-vfp-neon:

  http://git.openembedded.org/openembedded-core/commit/?id=08c0b7060009113e8dffdef51ff6b9b4b7f28894

Active package feeds should now have long since updated to the new
naming. For example, Angstrom stopped using on the legacy naming in
2012:

  2e33fb5bd0

(From OE-Core rev: 0341a3c44e511d3246096edd3009432805e57b89)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-13 10:15:20 +00:00
Chang Rebecca Swee Fun
52c25b03ec classes/populate_sdk_ext: support wic in eSDK
Make 'wic' image creation tool/command available in eSDK
environment. This would allow eSDK users to manipulate
images within eSDK environment.

[YOCTO #12177]

(From OE-Core rev: 90df6758a9f8753c646b129aa912e3849bf4c987)

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-13 10:15:20 +00:00
Alexander Kanavin
0f49d9182f gnupg: use native version for signing, rather than one provided by host
Using host gpg has been problematic, and particularly this removes
the need to serialize package creation, as long as --auto-expand-secmem
is passed to gpg-agent, and gnupg >= 2.2.4 is in use
(https://dev.gnupg.org/T3530).

Sadly, gpg-agent itself is single-threaded, so in the longer run
we might want to seek alternatives:
https://lwn.net/Articles/742542/

(a smaller issue is that rpm itself runs the gpg fronted in a serial
fashion, which slows down the build in cases of recipes with very
large amount of packages, e.g. glibc-locale)

Note that sstate signing and verification continues to use host
gpg, as depending on native gpg would create circular dependencies.

[YOCTO #12022]

(From OE-Core rev: 08fef6198122fe79d4c1213f9a64b862162ed6cd)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-11 10:26:07 +00:00
Richard Purdie
9e18114927 image: Expand PV to avoid AUTOREV parsing failures
Currently, setting PV to include SRCPV for build-appliance results in:

bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was
${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher
failure: Fetch command export ftp_proxy="http://proxy.yocto.io:5187/"; export
FTP_PROXY="http://proxy.yocto.io:5187/"; export PATH="${TMPDIR}/work/
qemux86_64-poky-linux/build-appliance-image/fetcheravoidrecurse-r0/
recipe-sysroot-native/usr/bin/python3-native:${TMPDIR}/work/
qemux86_64-poky-linux/build-appliance-image/fetcheravoidrecurse-r0/
recipe-sysroot-native/usr/bin/python3-native:${TMPDIR}/work/
qemux86_64-poky-linux/build-appliance-image/fetcheravoidrecurse-r0/
recipe-sysroot-native/usr/bin/python3-native:/home/pokybuild/
yocto-autobuilder/yocto-worker/buildtools/build/scripts:${TMPDIR}/
work/qemux86_64-poky-linux/build-appliance-image/fetcheravoidrecurse-r0/
recipe-sysroot-native/usr/bin/x86_64-poky-linux:${TMPDIR}/work/
qemux86_64-poky-linux/build-appliance-image/fetcheravoidrecurse-r0/
recipe-sysroot/usr/bin/crossscripts:${TMPDIR}/work/qemux86_64-poky-linux/
build-appliance-image/fetcheravoidrecurse-r0/recipe-sysroot-native/usr/sbin:
${TMPDIR}/work/qemux86_64-poky-linux/build-appliance-image/
fetcheravoidrecurse-r0/recipe-sysroot-native/usr/bin:${TMPDIR}/work/
qemux86_64-poky-linux/build-appliance-image/fetcheravoidrecurse-r0/
recipe-sysroot-native/sbin:${TMPDIR}/work/qemux86_64-poky-linux/
build-appliance-image/fetcheravoidrecurse-r0/recipe-sysroot-native/bin:/home/
pokybuild/yocto-autobuilder/yocto-worker/buildtools/build/bitbake/bin:${TMPDIR}
/hosttools"; export HOME="/home/pokybuild"; git -c core.fsyncobjectfiles=0
ls-remote git://git.yoctoproject.org/poky  failed with exit code 127, output:
/bin/sh: 1: git: not found

This is because PV is being expanded when TMPDIR is unset.

Expand PV in advance to avoid this problem.

(From OE-Core rev: 9ca2fad2e569597f460e6bcbbd96077c8b8cfce9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-11 10:26:07 +00:00
Robert Yang
e80d3b6b47 multilib.bbclass: remove invalid PACKAGE_INSTALL
The PACKAGE_INSTALL is only used by image recipe, the previous code had
handled it in "if bb.data.inherits_class('image', d)", handle it again
doesn't make any sense (there is no PACKAGE_INSTALL for non-image
recipe), so remove it.

(From OE-Core rev: 6b25c76da51180da7c97308d5f8f5558c68cdca3)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-11 10:26:07 +00:00
Robert Yang
0ad91af406 sstate.bbclass: sstate_hardcode_path(): fix for multilib
It only substituted staging_target for target recipe which didn't work
for multilib, for example, postinst-useradd-lib32-polkit:

* No multilib:
  PATH=/path/to/tmp-glibc/work/core2-64-wrs-linux/polkit/0.113-r0/recipe-sysroot-native/bin
  staging_target=/path/to/tmp-glibc/work/core2-64-wrs-linux/polkit/0.113-r0/recipe-sysroot
  The PATH would be substituted to:
  FIXMESTAGINGDIRTARGET-native/bin
  Not the funny "-native/bin", this works well.

* When multilib:
  PATH=/path/to/tmp-glibc/work/core2-32-wrsmllib32-linux/lib32-polkit/0.113-r0/recipe-sysroot-native/bin
  staging_target=/path/to/tmp-glibc/work/core2-32-wrsmllib32-linux/lib32-polkit/0.113-r0/lib32-recipe-sysroot
  Now staging_target endswith "/lib32-recipe-sysroot", so it can't
  replace '/recipe-sysroot-native' in PATH , so PATH can't be fixed, and
  there would be build errors when building multilib + rm_work, for
  example:
  chown: invalid user: ‘polkitd:root’

Substitute staging_host for target recipe can fix the problem, now all
of native, cross and target need substitute staging_host, so we can
simply the code a little.

(From OE-Core rev: 087510795331fa21ff52f103269087c06b1660fa)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-11 10:26:06 +00:00
Richard Purdie
0d0984e1e6 nativesdk/sdk: Update sdk dummy providers
When we migrated rpm v5 -> v4, we lost the ability to drop "per file"
dependencies from the rpm backend for things like "/bin/bash" and
"/usr/bin/env" which meant the sdks were becomming 'bloated'.

This restores the functionality using a dummy package, similarly to
the way the buildtools perl issue was addressed. It also removes
the non-functional old code so as not to confuse people in future.

I ran into this problem trying to filter dependencies to only rpms
a build directly depends upon and it turns out we have some determinism issues
in this area so this is something key to fix.

(From OE-Core rev: 9d490dc01dcedb216129b22cbe17a6c99efc4f5c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-11 10:26:06 +00:00
Richard Purdie
1117f74385 package_deb: Handle / in dependency name
We can end up with / in dependency names from file dependencies but the
deb format doesn't allow this. Filter the names to allow such dependencies
to work. Names have to start with an alphanumeric digit so also handle this.

This allows for future handling of "per file" dependencies similarly to
the rpm backend, bring parity to the functionality of the backends.

(From OE-Core rev: fc08972688d784f561c8be88d3100d6baaf22070)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-11 10:26:06 +00:00
Ross Burton
b0df543737 native/cross: remove redundant DEPENDS_GETTEXT assignment
DEPENDS_GETTEXT defaults to gettext-native, so there's no need to set it again
in these classes.

(From OE-Core rev: 5e4b1915e7a5a94d410c5292b5ed2f447c82b18a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-11 10:26:06 +00:00
Mike Crowe
7389cb451c cmake: Always put cmake package files in -dev packages
Various recipes that inherit cmake contain FILES_${PN}-dev magic to add the
generated package files to their -dev packages. Since this is a standard
feature of cmake, we might as well teach cmake.bbclass to do this itself so
those recipes can be simpler.

(From OE-Core rev: d91dc4666683a96e9d03cbbd21b8a546f9069c93)

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-07 14:05:38 +00:00
Robert Yang
fe32db3ae0 multilib.bbclass: remove unneeded bb.data.inherits_class()
It is duplicated to previous.

(From OE-Core rev: 1309b800fbc48bc6a3b7864eb7827b24f855ddac)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-06 22:32:22 +00:00
Robert Yang
4bcfd80383 multilib.bbclass: remove obsolete DEFAULTTUNE_ML_
It had been dropped by:
commit 65581c68d130fa74d703f6c3c92560e053857ac7
Author: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Date:   Mon Feb 13 16:44:48 2017 +0200

    rootfs_rpm.bbclass: migrate image creation to dnf

(From OE-Core rev: 38df1653da65a8a4e5f84b369b699307d5b4fc4f)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-06 22:32:22 +00:00
Robert Yang
f0b518784d multilib_global.bbclass: fix indent
(From OE-Core rev: 52f121a726da573c90e5857caff95e50b01ea02a)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-06 22:32:22 +00:00
Robert Yang
eaad759ac8 populate_sdk_ext.bbclass: don't rename layers when failed
The previous code:
os.rename(sdkbasepath, temp_sdkbasepath)
try:
    foo
finally:
    os.rename(temp_sdkbasepath, sdkbasepath)

always renamed the path, it made the debug harder when error happened.
drop the "try: finally" makes the debug easier.

(From OE-Core rev: 32126512349d65f0dbc31196c4ec6e1a1147cf5e)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-06 22:32:22 +00:00
Robert Yang
b27342d233 testsdk.bbclass: add a newline after own-mirrors
Otherwise it would generate lines like the following when multilib:
INHERIT += "own-mirrors"SSTATE_MIRRORS += " \n file://.* file:///path/to/../share/sstate-cache/PATH"

(From OE-Core rev: 65b2a0e1ba7e176f3e405ed8968665660fc414d3)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-06 22:32:22 +00:00
Robert Yang
d0bed31189 staging.bbclass: make subprocess.check_output() capture stderr
This is very useful for debugging. The similar to testsdk.bbclass.

(From OE-Core rev: de30b61b87047f61de4629f8e5bd87598de7fd0c)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-06 22:32:22 +00:00
Ross Burton
ccdc770fcb debian.bbclass: add a note when a package is renamed
To make it easier to debug problems with renaming caused by debian.bbclass,
explicitly log when packages are renamed.

(From OE-Core rev: 2c27df943035b4df7c5d0be1ab8d0f4f3a31f4d2)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-06 22:32:22 +00:00
Martin Kelly
f437138784 meson: export native env only for native build
Although the meson crossfile should take care of setting the right cross
environment for a target build, meson slurps any set CFLAGS, CXXFLAGS,
LDFLAGS, and CPPFLAGS from the environment and injects them into the
build (see mesonbuild/environment.py:get_args_from_envvars for details).

This means that we are seeing native CFLAGS, CXXFLAGS, LDFLAGS, and
CPPFLAGS in the target build, which is wrong and causes build failures
when target and native have libraries in common (the linker gets
confused and bails).

That said, we *do* need to set certain vars for all builds so that meson
can find the right build tools. Without this, meson will fail during its
sanity checking step because it will determine the build tools to be
unrunnable since they output target instead of native artifacts.

The solution to all of this is to set CC, CXX, LD, and AR globally to
the native tools while setting the other native vars *only* for the
native build. For target builds, these vars will get overridden by the
cross file as we expect.

(From OE-Core rev: de7ae028c65a978969b2e06fdc1a2d08bc141a5b)

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-05 12:02:37 +00:00
Alexander Kanavin
0131136504 gnomebase.bbclass: allow a meson-specific version
gnomebase.bbclass hardcodes the autotools inherit, so make it
configurable and allow meson to be specified instead.

(From OE-Core rev: 32c2faf394ba7bf75a7273fb9f5e58cc4ee3f3ad)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
[RP: patches tweaked to only need the one class]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-05 12:02:36 +00:00
Juro Bystricky
528ea78fb2 package_rpm.bbclass: clamp timestamps
Improve binary reproducibility of RPM packages.
Ensure timestamps in RPM packages are not later than the value
of SOURCE_DATE_EPOCH. If SOURCE_DATE_EPOCH is not set,
timestamps are not clamped.

(From OE-Core rev: 225a7156d1fb2fbffadf38e4f4e491f053358082)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-05 11:55:35 +00:00
Alexander Kanavin
9b32b8516a testimage.bbclass: add ptest to the list of runtime tests whenever possible
If no ptest packages are installed in the image, the test does nothing;
if ptest packages are installed in the image, then they should be
run without user having to enable that manually.

(From OE-Core rev: f57feab2727dca916744deb64825f3beaf07961d)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-05 11:55:35 +00:00
Alexander Kanavin
0d2020fcff meson: add a recipe and class from meta-oe
The original recipe has been provided and improved by:

Ross Burton <ross.burton@intel.com>
Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Adam C. Foltzer <acfoltzer@galois.com>
Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Linus Svensson <linussn@axis.com>

I have added  patches to fix up gtk-doc and
gobject-introspection in cross-compilation environments,
and also change the order of linker arguments to replicate
autotools more closely (and fix linking errors in some corner
cases).

(From OE-Core rev: 1f8dea686cdfd6d360ba4a97f62d274c39eaeb8e)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-05 11:55:35 +00:00
Richard Purdie
41ea1be73c utils: Make get_multilib_datastore available from lib/oe
Currently we can't access this function from lib/oe as its a class function.
Move it to allow such access.

(From OE-Core rev: b241a666f2867ffa425f6d43763d7c3c17941dcf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-04 12:57:43 +00:00
Robert Yang
a1cc0e3d6e image_types.bbclass: use stat to get sparse file's size
The "ls -s sparse_file"'s result is 0, use stat to replace of it.

(From OE-Core rev: 1b2ec7a04069a0af2d4164c24109a5fa2fd0b1f6)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-04 12:57:42 +00:00
Manjukumar Matha
c9b64a1123 kernel-fitimage.bbclass: Fix bad image type replacement for microblaze
When using kernel-fitimage class with microblaze, the image type has to be
linux.bin not zImage. This patch fixes the bad image type replacement
for microblaze

(From OE-Core rev: 4e0903e2f71658d595ccb1fa9dddf0f73b373f7e)

Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-04 12:57:42 +00:00
Daniel Díaz
183be315b1 insane: add support for ARM64 ILP32
Add aarch64 32-bits (ILP32) ELF header into dictionary and
check binaries for 32-bitness.

(From OE-Core rev: 4b4a1295b8476d2820935eb5661b2d24a49b29b2)

Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-03 09:26:37 +00:00
Daniel Díaz
6e7463fb92 siteinfo: add support for ARM64 ILP32
More information about ARM64 ILP32 can be found here:
* https://wiki.debian.org/Arm64ilp32Port
* https://wiki.linaro.org/Platform/arm64-ilp32

(From OE-Core rev: 4e8840aa7adf91f04da2a1947b8d1dff7f88df50)

Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-03 09:26:37 +00:00
Daniel Díaz
31e7628656 cross-canadian: update GNU name for ILP32 triplet
As discussed and agreed in Linaro Connect Budapest 2017 [1],
the GNU name for ARM64 with 32-bit ABI has been changed, e.g.,
from:
  aarch64_ilp32-linux-gnu
to:
  aarch64-linux-gnu_ilp32

The current code has "ilp32" as an OS variant; this change
updates that variant to include the underscore in order to
match the agreed convention.

More information about ARM64 ILP32 can be found here:
* https://wiki.debian.org/Arm64ilp32Port
* https://wiki.linaro.org/Platform/arm64-ilp32

[1] https://lists.linaro.org/pipermail/cross-distro/2017-March/000864.html

(From OE-Core rev: 3a599e9d9df4aee25b6aa887563ef833559d96f8)

Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-03 09:26:37 +00:00
Ross Burton
f6154c96f4 rm_work: remove debugging statements
(From OE-Core rev: e7da9a3adc1ed430fff7afae4233e62313759b65)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-02 17:24:38 +00:00
Thomas Perrot
a14916daaa kernel-fitimage: Fix bad image type replacement for aarch64
When using kernel-fitimage class with aarch64, the image type has to be
Image not zImage.  This patch fixes the bad image type replacement for
aarch64

(From OE-Core rev: d14adead5861007ac7e95c32396491f907ab9f8f)

Signed-off-by: Thomas Perrot <thomas.perrot@tupi.fr>
Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-02 17:24:38 +00:00
Robert Yang
e18b7e77ed image-live.bbclass: add MLPREFIX to core-image-minimal-initramfs
The 32bit core-image-minimal-initramfs should be built when build lib32-iso, e.g.:
MACHINE = "qemux86-64"
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
IMAGE_FSTYPES += "iso"

$ bitbake lib32-core-image-minimal
Exception: FileExistsError: [Errno 17] File exists: '/path/to/tmp/sysroots-components/core2-64/qemuwrapper-cross/usr/bin/crossscripts/qemuwrapper' -> '/path/to/tmp/work/qemux86_64-pokymllib32-linux/lib32-core-image-minimal/1.0-r0/lib32-recipe-sysroot/usr/bin/crossscripts/qemuwrapper'

This was because:
lib32-core-image-minimal -> core-image-minimal-initramfs
core-image-minimal-initramfs -> qemuwrapper-cross
lib32-core-image-minimal -> lib32-qemuwrapper-cross

So we got the error, build lib32-core-image-minimal-initramfs can fix the problem.

(From OE-Core rev: eee3ec805cf150f1c701427a2d182a537a67e8f5)

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>
2018-01-02 17:24:37 +00:00
Joshua Watt
31fae5fa7b waf.bbclass: Add compile progress
(From OE-Core rev: c81e6386d6cf24eb6825ddd551d71a4660242fde)

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>
2018-01-02 17:24:37 +00:00
Robert Yang
c8ed2e0947 image-live.bbclass: print warn when initramfs is invalid
It's a problem when initramfs is invalid, so print warn rather than note.

(From OE-Core rev: e164f931c8b3046a8b6736166f8dd6d92f727d1c)

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>
2018-01-02 17:24:37 +00:00
Haris Okanovic
5b4aab6b40 kernel: Add support for multiple kernel packages
Some distros may want to provide alternate kernel "flavors" via feeds or
within bootable images. For example, readily available builds which
provide certain diagnostic features can enable developers and testers to
more quickly resolve issues by avoiding lengthy kernel builds.

This change allows for building multiple flavors of the kernel and
module packages by templatizing kernel package names via a new
KERNEL_PACKAGE_NAME variable in kernel.bbclass. It defaults to the old
name of "kernel", but can be overridden by certain recipes providing
alternate kernel flavors.

To maintain compatibility, recipes providing alternate kernel flavors
cannot be the "preferred provider" for virtual/kernel. This is because
OE puts the preferred provider's build and source at
"tmp-glibc/work-shared/$MACHINE/kernel-build-artifacts/" and
"tmp-glibc/work-shared/$MACHINE/kernel-source/" instead of
"tmp-glibc/work/*/$PN/" like other recipes. Therefore, recipes using the
default KERNEL_PACKAGE_NAME="kernel" follows the old semantics -- build
in the old location and may be preferred provider -- while recipes using
all other KERNEL_PACKAGE_NAME's build from the normal WORKDIR and don't
provide "virtual/kernel".

Testing:
 1. Add `KERNEL_PACKAGE_NAME_pn-linux-yocto-tiny = "tiny-linux"`
    to local.conf so that linux-yocto-tiny may build alongside
    the main kernel (linux-yocto).
 2. `bitbake linux-yocto linux-yocto-tiny` to build both kernel flavors.
 3. Verified image and modules IPKs exist for both:
    tmp-glibc/deploy/ipk/qemux86/kernel-* for linux-yocto
    tmp-glibc/deploy/ipk/qemux86/tiny-linux* for linux-yocto-tiny
 4. Verified linux-yocto is the "preferred provider", and was built in
    shared directory: tmp-glibc/work-shared/qemux86/kernel-*
 5. Add `CORE_IMAGE_BASE_INSTALL_append_pn-core-image-base = "tiny-linux"`
    to local.conf to install both kernel flavors in core-image-base.
 6. `bitbake core-image-base` to build an image.
 7. Verified image contains two bzImage's under /boot/, with
    "yocto-standard" (linux-yocto recipe) selected to boot via symlink.

Discussion threads:
http://lists.openembedded.org/pipermail/openembedded-core/2015-December/thread.html#114122
http://lists.openembedded.org/pipermail/openembedded-core/2017-July/thread.html#139130

[YOCTO #11363]

(From OE-Core rev: 6c8c899849d101fd1b86aad0b8eed05c7c785924)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Gratian Crisan <gratian.crisan@ni.com>
Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
Coauthored-by: Gratian Crisan <gratian.crisan@ni.com>
Coauthored-by: Haris Okanovic <haris.okanovic@ni.com>
Coauthored-by: Josh Hernstrom <josh.hernstrom@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-02 17:24:37 +00:00
Stefan Agner
2362b78887 waf.bbclass: explicitly pass bindir and libdir if supported
On some build hosts distros (e.g. Fedora 26) waf tries to be
smart about libdir detection and defaults to [EXEC_PREFIX/lib64].
This obviously is not what we want for 32-bit targets and usually
fails in the do_package phase:
  WARNING: gstreamer1.0-plugins-imx-0.13.0-r0 do_package: QA Issue: gstreamer1.0-plugins-imx: Files/directories were installed but not shipped in any package:
    /usr/lib64/libgstimxcommon.so.0
    ...

Depending on version, waf knows prefix or prefix, bindir and
libdir as default options. Explicitly pass the right set of
arguments.

(From OE-Core rev: 923f91d8d8606141ce218927bc943f4f4f34bcdd)

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-02 17:24:37 +00:00
Mike Crowe
bbef2327f8 kernel.bbclass: Fix do_sizecheck behaviour
During the introduction of support for multiple kernel image types in
849b67b2e4820564b5e5c9bd4bb293c44351c5f3, do_sizecheck was changed to only
warn if any kernel was bigger than ${KERNEL_IMAGE_MAXSIZE}. (Well, it tried
to warn - it turns out that there's no function called "warn", it should be
"bbwarn".) The previous behaviour had been to fail the build if the single
kernel image did not fit.

It seems possible that people might be generating both compressed and
uncompressed kernels and only really care whether the compressed one fits.
This means that we shouldn't just always fail if any of the images are too
large. So, let's warn (correctly this time) on every image that is too
large, but only ultimately fail if no image will fit. The build will also
fail if ${KERNEL_IMAGETYPES} is empty, but I hope that no-one needs to do
that.

While we're here correct a typo in the KERNEL_IMAGE_MAXSIZE validity check.

(From OE-Core rev: 59f1ee104d1a6c04b0690b7c8ce481449da174d6)

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>
2018-01-02 17:24:37 +00:00
Saul Wold
233be75803 image_types: Remove ELF type
As warned in a proir commit, it's time to remove the elf image type,
it is not long used anywhere (that I am aware of) and the mkelfimage
tool has been removed from the upstream coreboot code base.

(From OE-Core rev: 2781e8d608c0fd2108aeab294f982e9249793852)

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>
2018-01-02 17:24:37 +00:00
Alexander Kanavin
0d5475a3b2 package.bbclass: replace rpm/debugedit with dwarfsrcfiles
Debugedit provided by rpm 4.14 is rewriting binaries in-place, and was
found to produce broken output at least for grub:
http://lists.openembedded.org/pipermail/openembedded-core/2017-November/143989.html

A replacement utility was suggested via private mail:
https://lists.fedorahosted.org/archives/list/elfutils-devel@lists.fedorahosted.org/message/VZP4G5N2ELYZEDAB3QYLXYHDGX4WMCUF/

(From OE-Core rev: f2e6e1d3bfd4c92ef0f5ed4721fd9050c59dafca)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-02 17:24:36 +00:00
Otavio Salvador
88918c9efe image_types_wic.bbclass: Ensure '-c image_wic' works
The 'wic' image may use files which has been deployed (e.g in
do_deploy) for some partitions that may need to be copied in a
specific partition or filesystem (e.g a bootloader).

When using 'bitbake <image> -c image_wic', from a clean build, the
contents of do_deploy must also be available so we need to ensure all
do_deploy of the image dependencies has been complete.

Reported-by: Fabio Berton <fabio.berton@ossystems.com.br>
(From OE-Core rev: f387c28640cbb209b8a8ed5734b21c754d9f7663)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-21 10:21:00 +00:00
Richard Purdie
19b61c8cc6 rm_work: Handle race with -inital tasks
There is a race with rm_work when tasks run deltask do_build since
do_rm_work becomes a floating task. Handle this by injecting
the populate_sysroot/lic dependencies manually if the tasks returned
are empty. This depends on a change to fix bb.build.preceedtask() in
bitbake too.

[YOCTO #12365]

(From OE-Core rev: 0f537d985b7b17af508a511fca8a4ec4b5804580)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-21 10:21:00 +00:00
Saul Wold
370483fce1 image.bbclass: Add additional bb.debug to help track 12304
We actually caught the ext4 size issue in the wild with the debug
output in the oe_mkext234fs() code, but it did not help.  What that
showed was that the get_rootfs_size was returning a default size of
8192, where as the actual rootfs was more like 10572, thus too large
to fit in the created sparse file.

This additional temporary debug code should help us determine where
the failure might be.

More debug for
[YOCTO #12304]

(From OE-Core rev: 978472c58629d1448399207873bbead96b27102e)

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-12-18 18:03:58 +00:00
Saul Wold
cc30969e98 image_types: btrfs use sparse file creation
This will speed up file creation and still allow the btrfs tools to
create a full btrfs image.  This is similar to what we do for ext234
FS types.

(From OE-Core rev: de2f2fc9e8e6d874a11e69adc2f438975a5c1359)

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-12-18 18:03:58 +00:00
Robert Yang
60ceabb922 targetcontrol.py: use oe.types.boolean for QEMU_USE_KVM
So that both QEMU_USE_KVM = "True" and "1" will work.

[YOCTO #12343]

(From OE-Core rev: f28890ae2eb8a9cb2da39588e696a4b0c501bdf0)

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-12-18 18:03:56 +00:00
Tim Orling
7d950b99bd pypi.bbclass: bring in from meta-python
The pypi.bbclass has usefullness in many meta layers, not
just meta-python. Add it to oe-core for the benefit of
everyone.

Documentation strings for PYPI_PACKAGE, PYPI_PACKAGE_EXT and
PYPI_SRC_URI added to meta/conf/documentation.conf

(From OE-Core rev: c350812523017f113f63e0b863fd526b4d6331b9)

Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-13 14:00:51 +00:00
Richard Purdie
6c664a9713 populate_sdk_ext: Use prebuilt uninative tarball
For uninative to work, it relies on it being updated to new versions as
newer glibcs are built. This means the uninative generated by the current
build may not be as recent as the uninative that is being downloaded by
uninative.bbclass.

If this occurs, we can get symbol mismatch errors.

Ultimately, the sstate and the uninative versions need to match so we
should use the same tarball as uninative.bbclass is using, not the one
we built.

[YOCTO #12405]

(From OE-Core rev: a24c10b7bdab8aa960fdd3a58d2009f24344e579)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-11 21:46:38 +00:00
Richard Purdie
4137923598 multilib_global: Handle PREFERRED_RPROVIDER
Running:

$ oe-selftest -r sstatetests.SStateTests.test_sstate_sametune_samesigs

after commit cdcebd81c872cb7386c658998e27cf24e1d0447c results in:

NOTE: Resolving any missing task queue dependencies
NOTE: Multiple providers are available for runtime lib32-initd-functions (lib32-initscripts, lib32-lsbinitscripts)
Consider defining a PREFERRED_RPROVIDER entry to match lib32-initd-functions

and will occasionally pick a different value on the second stamps run
causing a test failure. Update the multilib code to handle
PREFERRED_RPROVIDER too.

There is a bigger worry here which is why the builds aren't deterministic. This is
caused by a bug in bitbake's providers.py and a separate fix will be sent for that
which would cause this test to always pass or always fail.

(From OE-Core rev: ced4ac760926ce43a937dad2be3b873b1beec6aa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-10 22:45:21 +00:00
Bruce Ashfield
2a7a02c513 kernel-yocto: ensure that only a single defconfig is processed
As a follow up to the changes to ensure that KBUILD_DEFCONFIG will
always get its defconfig into the processing, we also should ensure that
we don't get both a KBUILD_DEFCONFIG and a SRC_URI defconfig in the
configuration queue. If both are in the configuration queue, we end up
with competing values and a potentially long running check of 5000+
options x 2 against the final .config.

By removing the defconfig found from the SRC_URI when one is found
via KBUILD_DEFCONFIG, we ensure that only one will be processed.

(From OE-Core rev: 7e98c295c1bb511ece51b5f8c97f26c173ddaf76)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-10 22:45:21 +00:00
Saul Wold
f727f04248 kernel-yocto: Stop the build if defconfig is missing
The bberror does not stop the build correctly, this should be a
bbfatal_log to ensure the failure correctly stops the build and logs
the failure.

Part of
[YOCTO #12162]

(From OE-Core rev: 44ff06635e7f575e67b7ebba5d6900b8ddbc4a06)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-10 22:45:21 +00:00
Saul Wold
adb9d45f5d kernel-yocto: ensure sccs variable is set when using KBUILD_DEFCONFIG
When using KBUILD_DEFCONFIG, $sccs should be set to the $WORKDIR/defconfig
regardless if it compares or is copied. Otherwise $sccs is not set and the
defconfig is not found correctly.

Part of
[YOCTO #12162]

(From OE-Core rev: b63cc051f1eb58c768f49db2c04843336e62d3df)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-10 22:45:21 +00:00
Peter Kjellerstedt
75538b54d9 sstate.bbclass: Add progress bars when removing from the sysroots
If there are many recipes that should be cleaned out from the
sysroots, it can actually take some time. This adds a progress bar to
give a visual clue that the clean up is actually progressing.

(From OE-Core rev: d9b59df1230a20c7a5c9f4fb0325bb9216025a16)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-10 22:45:20 +00:00
Mark Hatle
2ff88ae0e0 uninative.bbclass: Fix broken symlink issue
If two builds are sharing the same DL_DIR, and the uninative file is local
to a layer.  When the first build gets to uninative it creates the link local
to itself, and subsequent users can use the same link.  However if that first
build then is deleted from the disk, the symlink is no longer valid (broken).

We need to update the system to detect this case, and use the model
implemented by the bitbke fetch2 code.  Look for a broken link, remove it,
then try to create the link and ignore an exception if it already exists
(since we just unlinked any bad one).

(From OE-Core rev: bfd9664edad7044b5da53fc33b8d0f6508f00950)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-10 22:45:20 +00:00
Ross Burton
0b9be27113 classes/sanity: check we don't have an ancient GNU patch
We depend on the host GNU patch, but patch < 2.7 can't handle git-style patches.
This results in patches that fail to apply, or worse apply incorrectly.

(From OE-Core rev: ddda57ab1dee989dce8754350471807c916a6f47)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-10 22:45:20 +00:00
Ross Burton
daa509f9e4 sanity: getstatusoutput returns an int, not a string
This code is an error path so nobody noticed that oe.utils.getstatusoutput() is
just a wrapper around subprocess.getstatusoutput() which returns an (int,
string) pair not (string, string).

(From OE-Core rev: 33bf6e05af0a68da32f0484460b1de5f7f4eea98)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-10 22:45:20 +00:00
Paul Eggleton
86ab56b551 classes/patch: when PATCHTOOL = "git" double-check the repository
If a bug is present or the user has set PATCHTOOL = "git" on a source
tree that isn't git, if we try to perform git operations (such as
committing or changing branches) when extracting source, then we might
in fact be running those operations on the metadata repository if the
build directory is underneath, say, poky or OE-Core, and that could
make a mess. Check if the source tree is a git repository and refuse
to continue if it isn't.

(From OE-Core rev: 59ae5b7cbfeedb216a57c3f77fe52527b6c918cc)

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-12-10 22:45:20 +00:00
Paul Eggleton
c2b0259d90 classes/patch: remove unused variable
(From OE-Core rev: 5bc987fb1818ffb9748645bd6e0d80cf5914bad0)

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-12-10 22:45:20 +00:00
Saul Wold
f295c1e944 kernel.bbclass: Add cleandirs for do_shared_workdir
We add the kernel-build-artifacts to the cleandirs list to ensure
that there are no remaining artificats in the kernel-build-artifacts
directory which is STAGING_KERNEL_BUILDDIR. Without this change
multiple System.map files are visiable in the STAGING_KERNEL_BUILDDIR,
which could cause problems for some tools.

[YOCTO #11880]

(From OE-Core rev: d52a65d3d8512eeb5081d9fb5f18805428358241)

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-12-10 22:45:18 +00:00
Patrick Ohly
10865f77b9 rootfs-postcommands.bbclass: ensure that rootfs gets mounted ro
When read-only-rootfs is active, we need to ensure that the rootfs
does not get mounted read/write by the kernel or initramfs. Adding
"ro" to the boot parameters achieves that.

(From OE-Core rev: cfc09de06ecc12bb42181004689e881c75072665)

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-12-10 22:45:18 +00:00
Martin Hundebøll
8592a02f49 systemd: allow dots in arguments to template units
When installing systemd template units with an argument, the current code
removes characters between the '@' and the '.' from service names in
SYSTEMD_SERVICE_${PN}, e.g.:

  getty@tty1.service -> getty@.service

This fails for services with dots in the argument (which is perfectly
legal in systemd), since the code searches only until the first dot.
E.g.:

  vlan@eth0.1.service -> vlan@1.service

This is obviously wrong, and fails in systemd_populate_packages(), where
it fails to find the unit file.

Fix this by reworking the removal of the argument part of the service
name, so that parts before '@' and after teh last '.' are used as base
name.

(From OE-Core rev: 4704bd91458a728f28cbdc57dcf78f5d04cfd0cd)

Signed-off-by: Martin Hundebøll <mnhu@prevas.dk>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-10 22:45:18 +00:00
Markus Lehtonen
4958d810aa update-alternatives.bbclass: refuse to manage SysV init scripts
Sanity check for future packages.

[YOCTO #10944]

(From OE-Core rev: 061fa614cec49deb0374ccadf3013e5cc8ad2c51)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-02 11:25:33 +00:00
Markus Lehtonen
a779b1d9fb Revert "classes: Fix alternatives and rc.d ordering"
This kludge is not needed anymore, now that syslog packages (or any
other package) don't use update-alternatives for managing SysV init
scripts.

This reverts commit fc89a3f739.

[YOCTO #10944]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-02 11:25:33 +00:00
Markus Lehtonen
6ceac4eabf initscripts: don't use update-alternatives
Stop using update-alternatives for managing /etc/init.d/functions. Also,
make the initscripts-functions subpackage to (runtime) conflict with
lsbinitscripts.

[YOCTO #10944]

(From OE-Core rev: cdcebd81c872cb7386c658998e27cf24e1d0447c)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-02 11:25:33 +00:00
Ross Burton
6ef494c13b bin_package: fail if ${S} doesn't actually contain anything
If the user is trying to use bin_package but the SRC_URI hasn't extracted
anything into ${S}, which is easily done when writing a recipe by hand, instead
of silently shippping an empty package abort the build.

(From OE-Core rev: bf5627ddbe5371eba62f73c33735fb1cf35c2194)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-02 11:25:32 +00:00
Alexander Kanavin
c599921025 distrodata.bbclass: make upstream version check more useful for git upstreams
Specifically:

1) remove +git${SRCPV} stuff from comparison and output; it's just
unnecessary clutter;

2) write the commit id of the latest version tag into the output;
this saves quite a bit of trouble of manually checking what that
commit id is when doing version updates;

3) when UPSTREAM_CHECK_COMMITS is set, ignore the tags altogether;
instead check if the latest commit is different to the one we use,
and if so, report that the recipe can be updated to said commit
(which is also written into the output, as in 2). Multiple
recipes are failing the upstream check because they never
issue tags, now we can fix them.

(From OE-Core rev: 591d57877d3d3e659d78c0ed33f4c515e3f6f8fb)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-30 10:49:22 +00:00
Saul Wold
66a34a7bdb image_types: Add debugging code to ext4 fs creation
We have seen a small number of issues with ROOTFS_SIZE not getting
computed correctly, resulting in a failure in the mke2fs processing
and populating the resulting new filesystem.

This information should help us to reproduce [YOCTO #12304]

(From OE-Core rev: 3a72f6783e142d53d19b37811a854d08d32485ab)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-21 17:37:15 +00:00
Richard Purdie
0c2ba71468 qemuboot: Improve relative path handling
qemuconf files are currently written relative to TOPDIR. What
makes more sense is to write paths relative to the location of the
file. This makes moving them around and decoding the end paths in
runqemu much easier.

The effect of this should allow less use of bitbake to determine
variables and allow us to simplify runqemu.

(From OE-Core rev: 55a0028a961c0ad3c2e5729a9e3919cbbf256fe1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-21 13:11:03 +00:00
Richard Purdie
3acd0bf832 classes/cross: Add addto_recipe_sysroot task to cross recipes
This is particularly useful if you want to use gdb-cross as there
is no other good way to access it now with RSS.

(From OE-Core rev: e8648a022c93175d84baf3852d4d364b19d8d795)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-21 13:11:03 +00:00
André Draszik
f811a37401 base: add automatic dependency on xz-native for .txz SRC_URI
.txz is .tar.xz, so add it, as this can actually be found in the
wild.

(From OE-Core rev: 58af8c2e4bd17692274fc5a6ac8f8af84319fec6)

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-21 13:06:13 +00:00
Nathan Rossi
6dabd7c478 siteinfo.bbclass: Add microblaze(eb/el) linux site info targets
Add mappings for the microblaze(eb/el) linux and linux-musl variants to
use architecture common linux site data.

(From OE-Core rev: 634d1ed2cd89b8ac28b918be3561b135f7418b25)

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-11-21 13:06:12 +00:00
Nathan Rossi
ab34abd833 insane.bbclass: add microblaze-*-elf to machine dictionary
Add the definitions for microblaze-*-elf targets to the machine
dictionary.

(From OE-Core rev: a0104e47217e3a46d319a76929aec5b45c3ea6f9)

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-11-21 13:06:12 +00:00
Andre McCurdy
e4ee5e3021 package_ipk.bbclass: handle only whitespace in PACKAGE_EXCLUDE
If PACKAGE_EXCLUDE is constructed using _append then it's possible
that the final value will contain only a space. Currently that
results in build failures due to an invalid opkg command line.

(From OE-Core rev: f832f57ba9f6babb946fbde580004acfd85667e1)

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-11-11 12:14:28 +00:00
Andre McCurdy
72f7b9f84a base.bbclass: increase indent in get_layers_branch_rev() and buildcfg_vars()
Although it may not appeal so much to users to prefer 80x24 consoles,
the general trend is for screens to get bigger and the current output
has started to look a little cramped on a modern HD display.

Increasing from 17 to 20 is obviously arbitrary, but does give enough
space to cleanly display layers such as "meta-nodejs-contrib" and
"meta-virtualization" while still keeping the output fairly compact.

(From OE-Core rev: e556b85a452a4ebf34a0c9581608f135bbad2e2c)

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-11-11 12:14:28 +00:00
Paul Eggleton
125e0b72b7 devtool: implement conditional patch handling
If you have a recipe that uses overrides to conditionally extend
SRC_URI to add additional patches, then you will often need to update
those patches if you're making other changes to the source tree (for
example if you're upgrading the underlying source). Make this possible
with devtool by creating devtool-override-* branches for each override
that conditionally appends/prepends SRC_URI, and have devtool
update-recipe / finish check each branch out in turn and update the
corresponding patches.

A current example of a recipe that does this is the quota recipe - it
applies an additional patch if musl is the selected C library (i.e.
libc-musl is in OVERRIDES).

Note that use of this functionality does require some care - in
particular, updates to patches that appear on the main branch (named
"devtool" by default) should be made there and not only on one of the
specific devtool-override-* branches that are created for each override.
The recommended procedure is to make the changes you want to make to the
main branch first, then check out and rebase each devtool-override-*
branch, testing each one by activating the corresponding configuration,
and then finally run devtool finish.

Fixes [YOCTO #11516].

(From OE-Core rev: aa87603d1ffd695027847f4df75c0406cf4e14d8)

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-11-11 12:14:27 +00:00
Richard Purdie
702f4692a2 testimage: Ensure full logs are shown for failures
Currently, the fact an error message is shown means the rest of the
task logs are suppressed. In this case we don't want that as it hides
the real errors and useful information. Therefore override this behaviour.

(From OE-Core rev: 7058ac23c5ce32fbdc4be6c05f85550e1fd9fe77)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-10 14:44:41 +00:00
Alexander Kanavin
5a5971bbab gtk-doc.bbclass: correctly make the list of directories with shared libraries
Previously it was working only if only one shared library was found, and
broke when there were several.

(From OE-Core rev: a4da3957f4577f9826c73e1d23bcffe9ee96a7d4)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09 12:33:16 +00:00
Richard Purdie
7608f33f0f testimage: Pass the logger into OERuntimeTestContextExecutor.getTarget()
I have no idea why we didn't do this but it means the code has nowhere
to log to unless we do this. This means we can then use the logger
to log data to the task logs.

(From OE-Core rev: e241fb128840889acff79dbf3fae7bfaafcb5357)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09 12:24:24 +00:00
Ming Liu
ae1a9a87b5 image.bbclass: let do_image depend on do_populate_lic of EXTRA_IMAGEDEPENDS
The licenses of EXTRA_IMAGEDEPENDS recipes are being referenced in
image postcommand write_deploy_manifest, but a dependency is missing
between do_image and do_populate_lic of EXTRA_IMAGEDEPENDS recipes,
this leads some license files not present when write_deploy_manifest
runs, hence will cause build errors.

Fixed by letting do_image depend on do_populate_lic of
EXTRA_IMAGEDEPENDS recipes.

(From OE-Core rev: 276ff1f22d00edd6c9728e44ed5d6692a6c9e04f)

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-08 22:24:03 +00:00
Luca Ceresoli
ab6ebff5c4 externalsrc: fix ExpansionError if the source dir does not exist yet
The externalsrc class code assumes that the source directory
(EXTERNALSRC) exists before bitbake is called. Otherwise do_configure
will fail obviously since externalsrc does not fetch anything.

Commit 3ca6085729 ("externalsrc: Handle .git not being a directory")
changed this behaviour. Now on a missing EXTERNALSRC directory we get
a bb.data_smart.ExpansionError during _parsing_, way before
do_configure can be run.

This new behaviour creates two problems:

 * First, there error message is very cryptic (and it's hard to
   provide a better message since no task is ever run):

     ERROR: ExpansionError during parsing /<...>/<...>.bb
     Traceback (most recent call last):
     bb.data_smart.ExpansionError: Failure expanding variable do_compile[file-checksums], expression was ${@srctree_hash_files(d)} which triggered exception FileNotFoundError: [Errno 2] No such file or directory: '<...>'

 * Second, this prevents creating a class based on externalsrc that
   automatically fetches the code in EXTERNALSRC before do_compile
   runs.

Fix both problems by simply calling git with '-C ${EXTERNALSRC}'
instead of calling git inside the non-existing directory. This changes
from a bb.data_smart.ExpansionError to a
subprocess.CalledProcessError, which is in line with what's actually
going on: git is telling us it can't find the git dir.

Also remove a comment that does not apply anymore.

(From OE-Core rev: 8e8251582e977d7c6ab525ac1b493fbbe3af38b2)

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Joshua Watt <jpewhacker@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-08 22:24:03 +00:00
Igor Romanov
3e5cf0c92f image.bbclass: Fix 'vardepsexclude' mechanism for image_cmd_${FSTYPE}
Current mechanism doesn't allow to use any non-determenistic variable, except 'DATE' and 'DATETIME', inside IMAGE_CMD_${FSTYPE} prototype.

Passing 'vardepsexclude' values from IMAGE_CMD_${FSTYPE}, so users will be able to avoid taskhash mismatch problems.

(From OE-Core rev: cb19166c540969f56959e25c1068934bdc40b013)

Signed-off-by: Igor Romanov <i.romanov@inango-systems.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-08 22:24:03 +00:00
Leonardo Sandoval
0877fb2fd3 base.bbclass: use d instead on e.data
According to the bitbake documentation, the "d" global datastore should be
used instead of "e.data" because the latter is deprecated.

(From OE-Core rev: 43820fe158cbc34c9fd67e84238931331153f127)

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-11-08 22:24:03 +00:00
Patrick Ohly
5b93ab596a useradd-staticids: explain how to fix the the problem
When a distro uses useradd-staticids.bbclass and some developer
unfamiliar with the static ID mechanism tries to add a recipe which
needs new IDs, the resulting error or warning is typically not
something that the developer will understand.

Even experienced developers do not get enough information. They first
must find out whether the missing ID is for a system user or group,
then locate the file(s) in which the ID could be added. Both of this
is now part of the message:

ERROR: .../meta/recipes-extended/cronie/cronie_1.5.1.bb: cronie -
cronie: system groupname crontab does not have a static ID defined.
Add crontab to one of these files: /.../conf/distro/include/my-distro-group

The case that no file was found is also handled:

ERROR: .../meta/recipes-extended/cronie/cronie_1.5.1.bb: cronie -
cronie: system groupname crontab does not have a static ID defined.
USERADD_GID_TABLES file(s) not found in BBPATH: files/group

It would be nice if the error message could also list the range in
which a new ID needs to be allocated, but /etc/login.defs isn't
available at the time of creating the message, so that part is still
something that a developer needs to know.

(From OE-Core rev: 883bfc2bbb4d2120dbad6b0f2056503b012b1a2b)

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-11-08 22:24:03 +00:00
Patrick Ohly
9c22707122 useradd-staticids: skip recipes without static IDs
When enabling useradd-staticids.bbclass, one has to define static IDs
for all recipes in a world build, otherwise those without static IDs
generate parse errors or warnings, depending on USERADD_ERROR_DYNAMIC.

Defining unused IDs is a lot of work and clutters the passwd/group
file of a distro.

Distros which want to avoid this can now set USERADD_ERROR_DYNAMIC =
"skip" and recipes which would have triggered a message then silently
get disabled. Only trying to build them shows the error message:

$ bitbake apt
...
ERROR: Nothing PROVIDES 'apt'
ERROR: apt was skipped: apt - apt: username _apt does not have a static ID defined.

(From OE-Core rev: 9113928cea88c2187e8640ac489671cb81f58103)

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-11-08 22:24:03 +00:00
Robert Yang
2c3d5968d9 useradd.bbclass: print a warn when useradd not found
Exit quietly makes it very hard for debugging when user is not added as
expected, print a warning helps a lot.

(From OE-Core rev: 057885ed6f22781960bce4e082e3aa96e126764c)

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-11-07 13:30:22 +00:00
Paul Eggleton
397abe3acd buildhistory: enable committing history by default
The most common usage for buildhistory is with commits enabled so that
you actually collect history, rather than just keeping a snapshot of the
most recent build state, therefore default BUILDHISTORY_COMMIT to "1".
This really ought to have been the default in the beginning, I can't
really explain why it wasn't.

(From OE-Core rev: 8018a2349b7ad5ab27731c93a49603adf5f72fc2)

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-11-05 22:33:23 +00:00
Joe Slater
5b6bb4fcb5 goarch: There is no GOARCH defined for mips64-n32
Defeat building for mipsarchn32 because there is no corresponding
GOARCH.  Neither "mips" nor "mips64" allows go-runtime to compile.
Existing mips32 code assumes the o32 ABI.

(From OE-Core rev: fe72090a30d1fc810de3dd07350e5e6afba745de)

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-05 22:33:23 +00:00
Khem Raj
0bdf5c949f kernel-arch.bbclass: Add riscv to kernel arch map
(From OE-Core rev: ac254fcc57cb044974445d89ce28a412c656e527)

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-11-05 22:33:21 +00:00
Khem Raj
4178905d6b siteinfo: Define data for riscv32 and riscv64
(From OE-Core rev: 603bcb3e2bb4e9f641a935aaccd56a393379bad9)

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-11-05 22:33:21 +00:00
Khem Raj
3cbc720c97 insane: Add entries for riscv 32bit/64bit
(From OE-Core rev: 0e0d0adac1d9303340d7e992cdb02ed7a8127350)

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-11-05 22:33:21 +00:00
Paul Barker
68e77cfb8a goarch.bbclass: Define HOST_GO386 and TARGET_GO386
These variables are used to control the floating-point instructions emitted by
the go compiler for x86 architectures.

The default is '387' which disables the use of sse/sse2 instructions and is safe
to use on all x86 processors from the i486 onwards.

If TUNE_FEATURES contains a feature set which is known to support sse/sse2
instructions then they are set to 'sse2' to enable the use of these
instructions. This is suitable for most processors from Pentium 4 onwards.

Only the 'core2' and 'corei7' TUNE_FEATURES are defined in the oe-core layer and
are known to support ss2 instructions. Other layers may introduce additional
tunings which support sse2 instructions and for these layers, TARGET_GO386
or go_map_386 should be overridden as needed.

(From OE-Core rev: 7e96cf3c9850dc34d53af73a9ac22b1624994484)

Signed-off-by: Paul Barker <pbarker@toganlabs.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-16 23:52:44 +01:00
Chen Qi
aff0179aab own-mirrors.bbclass: allow other settings of PREMIRRORS have effect
If we inherit own-mirrors.bbclass, other settings of PREMIRRORS in
our project would have no effect.

This patch modifies the setting in own-mirrors.bbclass to allow other
settings of PREMIRRORS to still have effect.

(From OE-Core rev: a3e9e7a38b3d9caed49380ebc05651a97f613c7c)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-16 23:52:44 +01:00
Hongxu Jia
75f3ce2d47 archiver: preserve sysroot paths in configured mode for multilib
In the following commit, the archiver expanded RECIPE_SYSROOT
to preserve sysroot paths in configured mode:
...
commit aa2240657b015d46e9ba4bcb6264709a82313d83
Author: Ross Burton <ross.burton@intel.com>
Date:   Tue Jun 6 15:23:18 2017 +0100

    archiver: preserve sysroot paths in configured mode
...

In meta/conf/multilib.conf, it overrides the variables
of STAGING_DIR_HOST, STAGING_DIR_TARGET and RECIPE_SYSROOT
with "${WORKDIR}/${MLPREFIX}recipe-sysroot".

So the archiver should also expand STAGING_DIR_HOST and
STAGING_DIR_TARGET to preserve sysroot paths in configured mode for
multilib.

[YOCTO #11584]

(From OE-Core rev: b129af957a9fd8f603d1aebb9fca3adcb4e6b341)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-16 23:52:43 +01:00
Maxin B. John
06178f64ee sstate.bbclass: provide an exception for useradd scenario
Packages, which depend on users/groups created from other packages,
needs "shadow-native" as a build time dependency. So, add an exception
to the "shadow-native" from otherwise discarded native/cross tools
dependency.

Fixes [YOCTO #11960]

(From OE-Core rev: 979699b55214933e0f11727a2fb9bfda8a3a3870)

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-10-16 23:52:43 +01:00
Nikolay Merinov
e824e09375 cross.bbclass: Remove usage of host flags for cross-compilation
BUILD_* flags can't be used as TARGET_* flags even for "cross" packages.

gcc-cross buils leaks config.log's through "gcc-stashed-builddir" and
TARGET_* flags to libgcc cross-build through "gcc/libgcc.mvars" file
on "gcc-stashed-builddir". This means that if BUILD_CFLAGS contains
host-specific flags like "-isystem/usr/include" libgcc build will
fail "do_qa_configure" and "do_package_qa" checks.

Remove host-related flags from TARGET_* flags for gcc-cross build.

(From OE-Core rev: 4b936cde58ca0a6f34092ce82640a02859110411)

Signed-off-by: Nikolay Merinov <n.merinov@inango-systems.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-16 23:52:43 +01:00
Nikolay Merinov
9f20263b50 utils.bbclass: Support applications with arguments in check_app_exist()
check_app_exist function must support cases when "app" variable defined
as "progname --args". For example BUILD_CC="gcc -march=x86-64" must
pass sanity check.

(From OE-Core rev: 5193ebca0ca8864404fc750def0e738417d104c7)

Signed-off-by: Nikolay Merinov <n.merinov@inango-systems.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-07 23:20:40 +01:00
Mikko Ylinen
5b28fe163a staging.bbclass: handle postinst-useradd-* fixmes
After 02457ef7f600ce954874e2d11e74b1c6daaa3bfc, PSEUDO for
postinst-useradd-* scripts get to use only one PSEUDO_LOCALSTATEDIR
which is set under recipes ${WORKDIR}.

When the those scripts are run in a clean build environment that
is built from the sstate (populate_sysroot_setscene run for
postinst-useradd-* providers), pseudo fails to run because it cannot
access the PSEUDO_LOCALSTATEDIR (recipe ${WORKDIR}s do not exist).
This triggers a sysroot staging error.

Previously, the PSEUDO_LOCALSTATEDIR setting in useradd.bbclass
worked because the RSS sstate/staging logic automagically processed
${STAGING_DIR_TARGET} in postinst-useradd-* scripts to point under
the sysroot being built.

The fix uses the same fixme processing by adding PSEUDO_LOCALSTATEDIR
variable to it. Furthermore, LOGFIFO is added to be able to use
the logging fifo of the recipe that actually runs postinst-useradd-*.

(From OE-Core rev: b28374cfad37db161b5ac5953b4a4638912f3f27)

Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-07 23:20:40 +01:00
Tom Rini
d4adc02989 image_types: Fix bmaptool support for RSS
With RSS we need to ensure that when making a bmap image that the
python3 that we created is found via /usr/bin/env rather than the host
python3.  Otherwise we're relying on the build host to have bmaptool
support installed.

(From OE-Core rev: a93c5869cb716cba5e05bbe4fc2e1c11adb9e30f)

Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-07 23:20:40 +01:00
Matt Madison
b2646b5cf7 goarch.bbclass: rework mips architecture checks
Remove the TUNE_FEATURES references from go_map_arch,
to avoid an unwanted variable dependency.  Direct
comparisons of the architecture name are sufficient
for covering what Go currently supports, and using
TUNE_CCARGS_remove adequately handles the conflict
with the cgo-supplied flags for mips.

(From OE-Core rev: 1bc4c1d880096083d1891a74024fb225a6340b9b)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-10-07 23:20:39 +01:00
Bruce Ashfield
748356ff34 cml1: remove diffconfig return code checking
The following commit:

[
  commit 578c8205fd14c48c6d30ef2889d86f1b4aee060a
  Author: Mikko Rapeli <mikko.rapeli@bmw.de>
  Date:   Thu Jun 22 16:23:14 2017 +0300

      meta: Fix return value checks from subprocess.call()'s

      Python function subprocess.call() returns the return value of the
      executed process. If return values are not checked, errors may
      go unnoticed and bad things can happen.

      Change all callers of subprocess.call() which do not check for
      the return value to use subprocess.check_call() which raises
      CalledProcessError if the subprocess returns with non-zero value.

      https://docs.python.org/2/library/subprocess.html#using-the-subprocess-module

      All users of the function were found with:

      $ git grep "subprocess\.call" | \
            egrep -v 'if.*subprocess\.call|=\
            +subprocess\.call|return.*subprocess\.call'

      Tested similar patch on top of yocto jethro. Only compile tested
      core-image-minimal on poky master branch.

      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>
]

Added return code checking to do_diffconfig. Although the change is
well intentioned, it isn't correct in this instance since 'diff' returns
'1' to indicate that there are differences in the files .. and not as
an error code.

subprocess.check_call() flags this as an error and the routine aborts.

We are already checking the inputs, and in fact already know there's a
diff in the files before we even make the call, so there's no need to
look for an error in this case.

Putting back subprocess.call() restores the routine to working order.

[YOCTO #12132]

(From OE-Core rev: ec48b8fd79181978f90b4b0ab00fbe78ddbd416e)

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-10-07 23:20:39 +01:00
Saul Wold
f0f2b2369e wic: remove systemd-boot for x32
Currently systemd-boot actually incorporates libgcc, since the
systemd-boot needs to be built with 64bit instructions it can not
use the x32 based libgcc.

Use the new override to ensure it gets overriden, linux-gnux32 could
not be used because x86-64 has higher priority.

(From OE-Core rev: 6046b9a3d76738c459ad76f5296e7b0a54c0b2e0)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-26 11:05:01 +01:00
Leonardo Sandoval
043d9ac0ae sign_rpm.bbclass: force rpm serial signing
Newer versions of gpg (at least 2.1.5 and 2.2.1) have issues when signing occurs in parallel
so (unfortunately) the signing must be done serially. Once the upstream problem is fixed,
this patch must be reverted, otherwise we loose all the intrinsic parallelism from
bitbake.

[YOCTO #12022]

(From OE-Core rev: 5301712f9735fcf8d3dec756772668de930e53fe)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-26 11:05:01 +01:00
Ming Liu
307f25c23e meta: drop True option to getVar calls
Search made with the following regex: getVar ?\((.*), True\).

(From OE-Core rev: dbc0eaf478feb3f752ae22fd184984494fc85d0a)

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-26 11:05:01 +01:00
Matt Madison
af1ee398b3 go: disable PIE flags for cgo
If the security_flags.inc file is included, gcc
will do PIE builds by default.  These flags need
to be disabled for go packages that use cgo.

(From OE-Core rev: 5d84042852380fc88b9be8df0e4eeac612c2a6da)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-26 11:05:00 +01:00
Matt Madison
988e253f47 goarch.bbclass: fixups for Go mips32 support
* Fix the regular expression in the mips test

* Flag as incompatible any mips32 tunes for n32 ABI
  or soft-float, as go does not support them.

* Replace mips32r2 tune with mips32r1. Go only supports
  mips32r1, which is a strict subset of r2.  Adjusting
  this tune is not ideal, but is hopefully a temporary
  measure until more complete mips32 ISA coverage
  arrives upstream.

[YOCTO #12108]

(From OE-Core rev: bdd20c296048937737da0f10bd1a3b63843c5bf4)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-26 11:05:00 +01:00
Paul Eggleton
5532c4d72e classes: drop image dependencies on TOPDIR variable
We don't need a dependency on this variable changing, and having one
causes locked signature warnings during eSDK installation if you have
INITRAMFS_IMAGE_* set (since TOPDIR will always be different between
the eSDK and the environment in which it was built).

Relates to [YOCTO #12102].

(From OE-Core rev: 073610af04be326f9245ca91714526b390fb72cd)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-25 14:15:15 +01:00
André Draszik
1b00c47aca useradd-staticids: don't create username-group if gid is specified
Adding distcc to an image, and having staticids enabled,
doesn't work as it causes a a superfluous 'distcc' group
being added using a conflicting  GID, thus failing the
build:
 | ERROR: distcc-3.2-r0 do_prepare_recipe_sysroot: distcc: groupadd command did not succeed.

Compared to other recipes, the distcc recipe only
specifies --gid for the primary group, and doesn't specify
--no-user-group, but when --gid is given, it doesn't make
sense to create a matching username-group in addition,
even if --no-user-group was not specified, and 'useradd'
actually complains if --gid and --user-group are given
both.

If only --gid is given, the current code in here
effectively behaves as if --user-group was specified,
taking the group-id of the username-group from the
--gid parameter. This causes the error above, as we try
to add a new group (distcc) with an existing group-id
(nogroup).

This is contrary to the comment in this file just above,
contrary to what useradd can do, contrary to behaviour
without the useradd-staticids bbclass, and non-intuitive.

Change the code such that a username-group is only created
- if a primary group using --gid was not specified, or
- if --no-user-group was not specified

To be in line with useradd, if gid is not given, and
--no-user-group is given, we add the user to the group
'users', which mimics useradd's behaviour.

(From OE-Core rev: fc3a86ae68919cec72c1a8ae0f9ba1f98ae13f0d)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-25 14:14:17 +01:00
Richard Purdie
2d948eec2d staging: Reduce verbosity of log messages
The staging changes were very verbose in their logging and whilst this is useful
when staging issues occur, those thankfully seem rare now and we can tune down
the logging to a sane level. This improves the readability of error messages from
functions that fail.

The code is still verbose when its replacing things in the sysroot.

(From OE-Core rev: a22d44c6bef7ea1be90aeb32ccd7502d3135a266)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-25 14:14:17 +01:00
André Draszik
6ef40f4d1e uboot-extlinux: fix extlinux creation race (take 2)
Alternative solution to original commit
60c90398580998b2379bb438f0f75b29285135a5 ("u-boot: fix extlinux
creation race")

(Untested)

(From OE-Core rev: e44b72ab45c757cc83c7856c118588f1af299790)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-25 14:14:17 +01:00
Otavio Salvador
64c4d72b3a kernel-devicetree.bbclass: Add support to generate append to kernel
The are use cases where the Device Tree appended to the kernel is
convinient, so we generate the bundle concatenating the kernel (and
potentionally the initramfs) and the Device Tree binaries.

To enable it, set KERNEL_DEVICETREE_BUNDLE variable to '1'

(From OE-Core rev: f044567326988e84e5d72040e9387c3240836ddb)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-25 14:14:17 +01:00
André Draszik
4c87270fee kernel-fitimage: support MIPS (compressed)
On MIPS, the compressed kernel image target is vmlinuz.bin

(From OE-Core rev: 74d97569aa4e0f82e094a539dec302076103affa)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-25 14:14:17 +01:00
André Draszik
0dff25481f kernel-uboot: support compressed kernel on MIPS
MIPS generates vmlinuz.bin when compression in the kernel build is
enabled, including any necessary objcopy so we can leverage that
and skip our manual invocation of objcopy here. We just have to
put the file into the right place for the rest of the build to
find it.

(From OE-Core rev: 00bc7682473c2558d72ba42c182f8e3bd445f8af)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-25 14:14:17 +01:00
André Draszik
4fec14feac kernel-uimage: optimise UBOOT_ENTRYSYMBOL support
This is the remaining local change to a fix similar to
commit e0b4f018d1c2 ("kernel-uimage.bbclass: Fix up
generation of uImage from vmlinux"):

Make awk exit on match to save a few CPU cycles so as
to make this similar to kernel-fitimage.bbclass

(From OE-Core rev: 614e8be7a89a2f2113fa40b11e7a05b9e8155f6a)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-25 14:14:17 +01:00
André Draszik
c3ba13c44b kernel-fitimage: unbreak UBOOT_ENTRYSYMBOL support
- vmlinux is located in ${B}, not ${S}.
- parsing of nm output got broken completely in commit
  b406a89935f148779569fa3770776e009dd51f13 ("kernel-fitimage: add
  initramfs support"), commit ec755d2524
  in yocto

While at it, make awk exit on match to save a few CPU cycles.

(From OE-Core rev: 9d2ec9c046c4a9c6a842d28133d40639f5a65297)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-25 14:14:16 +01:00
André Draszik
34f9bcb8d5 kernel-fitimage: sanitize dtb section name (unbreak MIPS)
We can't build fitImages for MIPS any more:
| Error: fit-image.its:21.27-28 syntax error
| FATAL ERROR: Unable to parse input tree
| uboot-mkimage: Can't read arch/mips/boot/fitImage.tmp: Invalid argument

Since commit cd2ed7f80b555add07795cc0cbaee866e6c193a3
("kernel-fitimage: dtb sections named by their filenames
and one config section for each dtb"), commit
1ec405ef5d in yocto, dtb
sections are named by the DTB filename, but the filename
can legally be in a subdirectory below
arch/$arch/boot/dts/, and on MIPS all DTBs are actually
in a subdirectory.

If so, mkimage fails with the above error message.

Unbreak this by replacing the offending character
(directory separator /)

(From OE-Core rev: 335fc50cf54e47db4e3d5c35a9846484faf0270f)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-25 14:14:16 +01:00
Ross Burton
8e1287867f sanity: check that path variables don't use ~
The core path variables (TMPDIR, DL_DIR, SSTATE_DIR) don't use tilde expansion
but if the user does then the errors are very mysterious, so check on startup.

(From OE-Core rev: 2fb74abbe07b6b82a715ac0fe16449bd8420110e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-22 17:15:29 +01:00
Ross Burton
4b560c9834 sanity: correct Python version sanity check
We now require Python 3.4, not 2.7.

(From OE-Core rev: b12d99dbfbee8c4b3680f453f833410950238bb9)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-22 17:15:29 +01:00
Wenzong Fan
59106e5dce kernel.bbclass: build host programs with native sysroots
Allow to search header files and libs from native sysroots.

For example, an expanded BUILD_CFLAGS includes:
  '-isystem/builddir/to/linux-yocto/recipe-sysroot-native/usr/include'

And an expanded BUILD_LDFLAGS includes:
  '-L/builddir/to/linux-yocto/recipe-sysroot-native/usr/lib
   -Wl,-rpath-link,/builddir/to/linux-yocto/recipe-sysroot-native/usr/lib
   -Wl,-rpath,/builddir/to/linux-yocto/recipe-sysroot-native/usr/lib'

(From OE-Core rev: 37f20f2f7bdc8b964736c09371cd8f2342e4d5cb)

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-21 09:24:25 +01:00
Gerson Fernando Budke
69e97240b3 image.bbclass: Sorted ctypes to avoid basehash error
When selected multiple subimages a similar error could happend:
  Variable do_image_cpio[subimages] value changed \
    from 'cpio.gz.u-boot cpio.gz' to 'cpio.gz cpio.gz.u-boot'
To avoid this, 'ctypes' should be sorted at 'gen_conversion_cmds'.

This garantee that 'CONVERSION_CMD_xxx' are always written in tha same
order and consequently 'do_image_cpio' have the same hash.

(From OE-Core rev: 271f1a5f65b8685a1e3645026876251122ef3974)

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-21 09:24:25 +01:00
Ross Burton
dc6a45889d classes/image: move image_qa to between rootfs and image
It was noticed that do_image_qa is useless when rm_work is enabled as the rootfs
directory is deleted before image_qa is called.

This indicates that image_qa is incorrectly scheduled as it failing should mean
images don't get generated, so move it between do_rootfs and do_image.

Also, add a little bit more documentation to the comments.

(From OE-Core rev: 62ce334e583ecdf1f93619f4131c0fa5d88d5b02)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-21 09:24:25 +01:00
Tomasz Meresiński
beb775ca75 classes/image_live: fix using squashfs as image filesystem
Different squashfs versions have IMAGE_TYPE with hyphen (eg squashfs-lz4).
Tasks on the other hand have names with underscore (eg do_image_squashfs_lz4).

(From OE-Core rev: ab3cdfbd24844506647b75002f531b0b82b87be4)

Signed-off-by: Tomasz Meresiński <tomasz.meresinski@comarch.pl>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-21 09:24:25 +01:00
Ming Liu
7846fc222b cross-canadian.bbclass: drop TARGET_* flags overrides
A regression was introduced by me in commit 767335c9:
[ cross-canadian.bbclass: override TARGET_* flags ]

it causes BUILDSDK_C/CXXFLAGS being exported in environment-setup
script built from meta-environment recipe, which is wrong, restore to
TARGET_C/CXXFLAGS.

(From OE-Core rev: 44160df561a1b10b4c7a74558bdfe6b58ee0a9ec)

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-21 09:24:24 +01:00
Paul Eggleton
14a0736751 classes/externalsrc: delete symlinks at start of do_buildclean
To help users find the work and log directories (especially within the
eSDK) we create symlinks to these from the source tree. However during
do_buildclean we call "make clean", and some project Makefiles which
delete something like "*/*/lib" which will match files underneath the
oe-workdir symlink and fail. do_buildclean is called from do_clean which
is in turn called by devtool reset by default, and thus devtool reset is
blocked. An example of a recipe where this is visible is the openssl-qat
recipe in meta-intel.

In order to fix this, delete the symlinks at the start of do_buildclean
since we shouldn't need them at that point anyway, and thus make clean
won't be able to trip over them.

Fixes [YOCTO #11036].

(From OE-Core rev: 927b3b05a7f6b85967f7375b1942605fe8d37d0c)

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-09-21 09:24:24 +01:00
Matt Madison
e1fd36cd6d go.bbclass: set TMPDIR during compilation
The go build tool creates working directories under
$TMPDIR for all of its processing.  Create a directory
under ${WORKDIR} for this and point TMPDIR at it during
compilation, so that systems that have a relatively
small /tmp filesystems can still compile larger Go
packages.

(From OE-Core rev: 5de3de12c70f01753491c46b5622b0d273c3257b)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-21 09:05:50 +01:00
Matt Madison
975246ffe6 go: fix linking issues for nativesdk builds
Switch to using an external linker for nativesdk
go, go-runtime, and go package builds, which works
more reliably when building 32-bit SDKs.

(From OE-Core rev: f76779f7ef6636355a5aa5741a736f5234a67fdb)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-21 09:05:50 +01:00
Peter Kjellerstedt
1b0e9f8534 useradd.bbclass: Unify writing of script file in useradd_sysroot_sstate()
There were two identical code blocks for writing the
postinst-useradd-${PN} scripts. This combines them into one.

(From OE-Core rev: 0c4259dd3c74d81f20b87417cecb1e636365ce10)

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-09-18 11:07:30 +01:00
Ross Burton
13b9cceabc useradd: don't override pseudo environment
Back in the dark days before recipe-specific-sysroots the paths being passed in
this manual construction of the pseudo environment made sense, but now they're
incorrect and result in pseudo writing to two different databases during a
single build.  The result is that pseudo doesn't follow changes to /etc/passwd
in the sysroot, and warns in the logs.

Remove the PSEUDO_LOCALSTATEDIR assignment and inherit the correct assignment in
FAKEROOTENV.

(From OE-Core rev: 02457ef7f600ce954874e2d11e74b1c6daaa3bfc)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-18 11:07:30 +01:00
Mark Hatle
5a386dcb48 bitbake.conf: Add default FILESYSTEM_PERMS_TABLES
If FILESYSTEM_PERMS_TABLES was not defined, the default was selected by the
packages.bbclass.  This made it difficult for a recipe or layer to 'append'
to the default.

Copy the default into the bitbake.conf, allowing future _append and += style
actions.

Default was remove from package.bbclass.  If a value is not set, only the
built-in perms fixes will be used.

(From OE-Core rev: b65736e1b7161619a0c5972376d3e713ccf53850)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-18 11:07:29 +01:00
Paul Eggleton
3fde63363a devtool: ensure recipes devtool is working on are unlocked within the eSDK
Alongside reworking the way devtool extracts source, we now need to
ensure that within the extensible SDK where task signatures are locked,
the signatures of the tasks for the recipes being worked on get unlocked
at the right time or otherwise we'll now get taskhash mismatches when
running devtool modify on a recipe that was included in the eSDK such as
the kernel (due to a separate bug). The existing mechanism for
auto-unlocking recipes was a little weak and was happening too late, so
I've reimplemented it so that:
(a) it gets triggered immediately when the recipe/append is created
(b) we avoid writing to the unlocked signatures file unnecessarily
    (since it's a global configuration file) and
(c) within the eSDK configuration we whitelist SIGGEN_UNLOCKED_RECIPES
    to avoid unnecessary reparses every time we perform one of the
    devtool operations that does need to change this list.

Fixes [YOCTO #11883] (not the underlying cause, but this manifestation
of the issue).

(From OE-Core rev: 4e9a0be32fc30fb87d65da7cd1a4015c99533aff)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-18 11:07:29 +01:00
Paul Eggleton
10af6d86b3 devtool: rework source extraction so that dependencies are handled
Since it was first implemented, devtool's source extraction (as used by
the devtool modify, extract and upgrade subcommands) ignored other recipe
dependencies - so for example if you ran devtool modify on a recipe that
fetches from svn or is compressed using xz then it would fail if those
dependencies hadn't been built first. Now that we can execute tasks in
the normal way (i.e. tinfoil.build_targets()) then we can rework it to
use that. This is slightly tricky in that the source extraction needs to
insert some logic in between tasks; luckily we can use a helper class
that conditionally adds prefuncs to make that possible.

Some side-effects / aspects of this change worth noting:
* Operations are a little slower because we have to go through the task
  dependency graph generation and other startup processing. There's not
  really any way to avoid this though.
* devtool extract didn't used to require a workspace, now it does
  because it needs to create a temporary bbappend for the recipe. (As
  with other commands the workspace be created on the fly if it doesn't
  already exist.)
* I want any existing sysroot files and stamps to be left alone during
  extraction since we are running the tasks off to the side, and
  especially devtool extract should be able to be used without touching
  these. However, this was hampered by the automatic removal process in
  sstate.bbclass triggered by bb.event.ReachableStamps when the task
  signatures change, thus I had to introduce a way to disable this
  removal on a per-recipe basis (we still want it to function for any
  dependencies that we aren't working on). To implement this I elected
  to use a file written to tmp/sstate-control which gets deleted
  automatically after reading so that there's less chance of stale files
  affecting future sessions. I could have used a variable but this would
  have needed to be whitelisted and I'd have to have poked its value in
  using the setVariable command.

Fixes [YOCTO #11198].

(From OE-Core rev: 830dbd66992cbb9e731b48d56fddf8f220349666)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-18 11:07:29 +01:00
Martin Kelly
7c1fb3073d python*native.bbclass: suppress user site dirs
Currently, $HOME/.local is being added into sys.path for the native
Python, causing subtle host contamination. Suppress this by exporting
PYTHONNOUSERSITE = "1" as documented in PEP 370.

(From OE-Core rev: 8fe9fb4d5a61dcbcb3fc5b9ee0234cc135af873f)

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-14 11:35:46 +01:00
Matt Madison
e6542356b4 goarch.bbclass: set ARM_INSTRUCTION_SET to "arm"
Go does not play well with thumb, so ensure that the
toolchain and any packages use arm, not thumb, instructions.

(From OE-Core rev: 24da8c321831dcc5de00d65d6c5613efee109b57)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-14 11:35:45 +01:00
Otavio Salvador
a9fdf491ca go.bbclass: Add ptest support
This adds ptest support for Go packages so its unittest content is
packaged and integrated onto the test framework.

(From OE-Core rev: 2343cd90b9706589b33510c560ed83a9648fb133)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-14 11:35:45 +01:00
Otavio Salvador
d61d4823a9 go.bbclass: Add "ldflags" to QA skip list
Currently every Go package will end with GNU_HASH in the ELF binary
however adding it to every recipe is cumbersome so instead we handle
that here.

(From OE-Core rev: 6699e668413c10704ffa8094b3dca67a9b88422a)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-14 11:35:45 +01:00
Matt Madison
05c439a325 go.bbclass: add support linking against shared runtime
For architectures that support it, use the -linkshared
build option to build packages against the shared Go
runtime.

(From OE-Core rev: 5624a773e4db3ad2251641e69b04dc380e74a4c7)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-14 11:35:45 +01:00
Matt Madison
e3c693eaea goarch.bbclass: identify archs with Go dynamic linking support
Go only supports shared libraries for some architectures, so
add a variable for use elsewhere that gets a non-null value
only for those architectures.

(From OE-Core rev: 2275712df152b73ce49b36bdf9f8d744c68c9c50)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-14 11:35:45 +01:00
Ross Burton
95698142e1 insane: consider INSANE_SKIP without package-specifier too
(From OE-Core rev: 604939186cc08ab0429ebe00f3e32661847f0cf0)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-13 22:07:43 +01:00
Ross Burton
07a1ca3e81 insane: don't pass skip list to functions which don't respect it
When these functions are being called INSANE_SKIP has already been taken into
account, so don't confuse the code by passing the skip list.

(From OE-Core rev: 0001ceead406b1e8ba4fd16d0ecb5fbf5b55ba66)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-13 22:07:42 +01:00
Otavio Salvador
53067c4a97 kernel: Move Device Tree support to kernel.bbclass
The Device Tree is commonly used but it is still kept as a .inc file
instead of a proper class. Instead now we move the Device Tree code to
a kernel-devicetree class and automatically enable it when the
KERNEL_DEVICETREE variable is set.

To avoid breakage in existing layers, we kept a linux-dtb.inc file
which raises a warning telling the user about the change so in next
release this can be removed.

(From OE-Core rev: 03a00be7f2062aefef0e51ef20a4c9737f6685e7)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-13 22:07:42 +01:00
Enrico Scholz
74afde0058 image_types: support lz4 compressed squashfs
(From OE-Core rev: de70799af1a8bfe2fac22b90401053275d4714ba)

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-12 23:55:29 +01:00
Matt Madison
d7f07283de go.bbclass: enable nativesdk builds for Go packages
Adding the necessary overrides for nativesdk builds.

(From OE-Core rev: 83ad0bdb8a426b0beb3775cfb109ddb3936b7de1)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-12 23:55:29 +01:00
Matt Madison
4c6ce2b647 go.bbclass: clean up CGO_xxx settings
* use conditional assignment for  the CGO_xxx
  variables, so they can be overridden more easily
* remove the TOOLCHAIN_OPTIONS and TARGET_CC_ARCH
  references, since those are already present in
  CC and CXX
* remove the TARGET_ prefix so the values are
  appropriate for native, nativesdk, etc. builds
* move the GOROOT export away from the CGO settings
  and closer to its definition

(From OE-Core rev: 088528021d6979a8e2d6bc33d63a166e300cfde4)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-12 23:55:29 +01:00
Matt Madison
397881ff1b go.bbclass: remove some xxx_FINAL variables
GOROOT_FINAL is used by the Go linker for rewriting
source paths when the build GOROOT is not the same
as the runtime GOROOT, but the other _FINAL variables
aren't really needed.

(From OE-Core rev: 31aa0d8a62be95d093d3c7581efa41f74b9131ad)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-12 23:55:29 +01:00
Matt Madison
2c3e27b71b go.bbclass: remove GO_GCFLAGS nad GO_LDFLAGS
These variables are not used anywhere.

(From OE-Core rev: 2d37f60c2606de216aaa2d593b73b1de0a5c031e)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-12 23:55:29 +01:00
Matt Madison
9060b87711 go: split out go-runtime into separate recipe
Reorganize the Go toolchain build to split out
the Go standard runtime libraries into a separate
recipe.  This simplifies the extension to crosssdk
and cross-canadian builds.

* Adds a patch to the go build tool to prevent it
  from trying to rebuild anything in GOROOT, which
  is now resident in the target sysroot.

* 'go' bb and inc files are now for building the
  compiler for the target only.

* 'go-cross' bb and inc files are now just for
  the cross-compiler.

* Adds virtual/<prefix> PROVIDES for the compiler
  and runtime

* Removes testdata directories from the sysroot
  during staging, as they are unnecessary and
  can cause strip errors (some of the test files
  are ELF files).

* Re-enables pacakage QA checks, adding selective
  INSANE_SKIP settings where needed.

(From OE-Core rev: d2a7af7cd834e218c39d43ee3fa0c14d4f748727)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-12 23:55:29 +01:00
Martin Hundebøll
c9daf6b38b Revert "kernel-module-split: rrecommend kernel-image instead of rdepend"
This reverts commit e0ed52c514.

Commit e0ed52c514 ('kernel-module-split: rrecommend kernel-image instead
of rdepend') changed kernel modules to rrecommend kernel-image instead
of rdepend on kernel. This broke existing setups, where the kernel is
omitted by setting RDEPEND_kernel-base = "".

Revert the patch, as the existing way of omitting kernel-image in images
works just fine.

(From OE-Core rev: c315b1e036b1252f35abda921c49327c950a9570)

Signed-off-by: Martin Hundebøll <mnhu@prevas.dk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-12 23:55:28 +01:00
Ross Burton
e3a69364eb staging: gracefully abort if two recipes conflict in the sysroot
When building the per-recipe sysroot keep track of what files we're installing
and where they came from, so we can detect when a file is installed by two
different recipes and tell the user what these recipes are (instead of just
showing a os.link() stack trace).

[ YOCTO #11631 ]

(From OE-Core rev: 606a8e0ca218f023e362c3678122d36d537f95de)

(From OE-Core rev: 2ebbeb61114e4b847e9164c621ac87b5cf03a299)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:30 +01:00
Matt Madison
245285e3be go.bbclass: add GO_INSTALL_FILTEROUT variable
When using the Go 'vendor' mechanism to bring in
dependencies for a Go package, the default GO_INSTALL
setting, which uses the '...' wildcard, will include
the vendored packages in the build, which produces
incorrect results.

There are also some Go packages that are structured
poorly, so that the '...' wildcard results in building
example or test code that should not be included in
the build, or fail to build.

This patch adds a mechanism for filtering out a
subset of the sources.  It defaults to filtering
out everything under the 'vendor' subdirectory
under package's main directory, which is the
normal location for vendored packages, but can
be overridden by a recipe to filter out other
subdirectories, if needed.

(From OE-Core rev: 9819353726d85780546158428bd97a253705017d)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:30 +01:00
Matt Madison
7149219b76 go.bbclass: add do_unpack function to handle common cases
Go source trees have a particular structure, with all
sources located under ${GOROOT}/src/<import-path>.
The fetcher step implemented by the 'go get' command
automatically follows this structure, so we need
to do the same here.

Since most Go packages are hosted in git repositories,
this adds a custom do_unpack() function that sets
the destsuffix to match the expected directory structure,
for any git SRC_URIs that haven't had a destsuffix
explicitly set in the recipe.

This simplifies recipe writing for the most common
cases.

(From OE-Core rev: efcf6513b71021ea4bfe6fbaa326e6591dee487d)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:30 +01:00
Matt Madison
07ef4dd93d go.bbclass: separate ${S} and ${B}
Add a do_configure task to populate ${B} by symlinking
in the src subdirectory under ${S}, which lets us point
GOPATH at ${B}.  This lets us take advantage of the
automatic directory creation and cleaning for do_configure.

This necessitates a change to do_install to split the
installation of the sources and built artifacts.  Taking
advantage of some additional tar options, we can eliminate
the extra staging area and extra recursive chown command.
So overall efficiency should be improved.

(From OE-Core rev: c62a083306c26b7e4deca1ff41336bb6b33d5b3a)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:30 +01:00
Otavio Salvador
f01000da80 go.bbclass: Use an auxiliary variable to add the build dependencies
This is going to easy the addition of nativesdk and virtual providers
in the future.

This change is based on the meta-golang[1] layer. Thanks to Matt
Madison <matt@madison.systems> for his work on this.

1. https://github.com/madisongh/meta-golang

(From OE-Core rev: 497136297f15858903b5170a8616d0cb427a995d)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:30 +01:00
Matt Madison
2381d15cc6 go.bbclass: exported function cleanup
Since this is a class, it should follow the
class function export mechanism for its task
functions, and should set directory-related
flags for directories they need.

(From OE-Core rev: 0369a99ad1c9e3a9a6394c723461795460dc2c76)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:30 +01:00
Otavio Salvador
6640f4070e go.bbclass: Enable parallel build
The parallel build is based on PARALLEL_MAKE variable but can be
overriden setting the GO_PARALLEL_BUILD one.

This change is based on the meta-golang[1] layer. Thanks to Matt
Madison <matt@madison.systems> for his work on this.

1. https://github.com/madisongh/meta-golang

(From OE-Core rev: 7a40ea8fc358aa134ad86862591329f94d0f3718)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:30 +01:00
Otavio Salvador
7a7f0e846f go.bbclass: Use a global Go build flags
We now use a GOBUILDFLAGS to provide a global variable to control the
build flags to be given to Go.

This change is based on the meta-golang[1] layer. Thanks to Matt
Madison <matt@madison.systems> for his work on this.

1. https://github.com/madisongh/meta-golang

(From OE-Core rev: d6b8e7e94ba6dae44907c5a65bc0bdf0ccebdb15)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:30 +01:00
Otavio Salvador
8738f2bfb6 goarch.bbclass: Add support for ARMv5
This adds support to return the proper ARMv5 format.

This change is based on the meta-golang[1] layer. Thanks to Matt
Madison <matt@madison.systems> for his work on this.

1. https://github.com/madisongh/meta-golang

(From OE-Core rev: e242e7c3617ded87582c5d384b15027498b0c1a4)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:30 +01:00
Will Newton
602f786ecd goarch.bbclass: Replace logic for setting GOARM
The previous logic applied a regex to TUNE_FEATURES which could
set the GOARM value to 7 incorrectly, for example when dealing
with an arm1176 core. Simplify to check for the presence of
"armv7" instead. At the same time add a check for "armv6" and
set GOARM to 6 in that case.

(From OE-Core rev: 07b60c15e9ef650940afdde37bf3f3b9c50a336d)

Signed-off-by: Will Newton <willn@resin.io>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:30 +01:00
Otavio Salvador
8a43f94d1d go.bbclass: Fix binary installation path detection
Go toolchain changes the installation path when building for the same
architecture as the build host. This was already been considered in
the GO_BUILD_BINDIR variable but was not being used by the go class.

This fixes following error:

,----
| ERROR: go-dep-0.3.0-r0 do_package: QA Issue: go-dep: Files/directories
| were installed but not shipped in any package:
|   /usr/lib/x86_64-oel-linux/go/bin/dep
| Please set FILES such that these items are packaged. Alternatively if
| they are unneeded, avoid installing them or delete them within
| do_install.
`----

(From OE-Core rev: 56ce355b3d775e801d2ca89ee812571e794311cd)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:30 +01:00
Otavio Salvador
b34479ee9f goarch.bbclass: Stop passing True as second argument of d.getVar
The d.getVar has the second argument as True by default, avoid passing
it here.

(From OE-Core rev: 1a5026db41929d42bece22bd0ae60c13219a98f5)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:30 +01:00