Commit Graph

6348 Commits

Author SHA1 Message Date
Zheng Ruoqin
5ad7d90ee6 sanity: check_perl_modules bug fix
Fix Python3 TypeError error in check_perl_modules:

Executing bitbake, the following error message will be throwed:

  File ".../poky/meta/classes/sanity.bbclass", line
979, in check_sanity_eventhandler
    check_sanity(sanity_data)
  File ".../poky/meta/classes/sanity.bbclass", line
943, in check_sanity
    check_sanity_version_change(status, sanity_data)
  File ".../poky/meta/classes/sanity.bbclass", line
637, in check_sanity_version_change
    status.addresult(check_perl_modules(d))
  File ".../poky/meta/classes/sanity.bbclass", line
563, in check_perl_modules
    errresult += e.output
TypeError: must be str, not bytes

So here, transfer e.output from bytes to str.

(From OE-Core rev: 2c6fff3fe315357d65d082679856615afc367d90)

Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-12 09:29:06 +01:00
Andreas Müller
9f7092416c insane.bbclass: Trigger unrecognzed configure option for meson
Tested with 'unknown-configure-option' in ERROR_QA:

For meson (glib-2.0-native):
1. add 'EXTRA_OEMESON_append = "-Dschnitzel=true -Dwurst=true"'
   | ERROR: glib-2.0-native-1_2.58.3-r0 do_configure: QA Issue: glib-2.0-native: configure was passed unrecognised options: schnitzel wurst [unknown-configure-option]
2. add 'UNKNOWN_CONFIGURE_WHITELIST_append=" schnitzel"'
   | ERROR: glib-2.0-native-1_2.58.3-r0 do_configure: QA Issue: glib-2.0-native: configure was passed unrecognised options: wurst [unknown-configure-option]
3. change to 'UNKNOWN_CONFIGURE_WHITELIST_append=" schnitzel wurst"'
   => builds without issues

For autotools (readline-native):
1. add 'EXTRA_OECONF = "--with-schnitzel --with-wurst"'
   | ERROR: readline-native-8.0-r0 do_configure: QA Issue: readline-native: configure was passed unrecognised options: --with-wurst --with-schnitzel [unknown-configure-option]
2. add 'UNKNOWN_CONFIGURE_WHITELIST_append=" --with-schnitzel"'
   | ERROR: readline-native-8.0-r0 do_configure: QA Issue: readline-native: configure was passed unrecognised options: --with-wurst [unknown-configure-option]
3. add 'UNKNOWN_CONFIGURE_WHITELIST_append=" --with-schnitzel --with-wurst"'
   => builds without issues

(From OE-Core rev: 30c001cdbc6207001b18e093ad9691e606428f0f)

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-11 21:15:57 +01:00
Andreas Müller
5b33b053c1 gobject-introspection: auto-enable/-disable gobject-introspection for meson
* the class sets defaults used most common which can be overriden by recipes
* UNKNOWN_CONFIGURE_WHITELIST was removed for autotools (and not added for meson)
  as suggested by Alexander Kanavin [1]

[1] http://lists.openembedded.org/pipermail/openembedded-core/2019-April/280716.html

(From OE-Core rev: 59589383131df6bc0c8787cd00a16ee59e21d441)

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-11 21:15:56 +01:00
Mariano Lopez
6995ec65e8 ptest.bbclass: Add feature to populate a binary directory
This adds the functionality to create a binary directory within
PTEST_PATH directory. This directory will be populated with
symlinks pointing to the binaries installed by the package and
then renamed by update-alternatives. This way the ptest only needs
to source this binary directory in order to use the expected
binaries.

To enable this feature just add PTEST_BINDIR = "1" to the recipe.

[YOCTO #12597]
[YOCTO #13238]

(From OE-Core rev: bca35319b89ce668927728c4e2094f6e10cef298)

Signed-off-by: Mariano Lopez <just.another.mariano@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-11 21:12:48 +01:00
Mariano Lopez
5feccb430b update-alternatives.bbclass: Add function to get metadata
This adds update_alternatives_alt_targets function to get the metadata
for a package. This is for code reuse because the metadata would help
other classes that needs to be aware of how update-alternatives modify
the final package.

[YOCTO #12597]
[YOCTO #13238]

(From OE-Core rev: 04d966c0a91c5e16555bba827969a0a2fd96bb96)

Signed-off-by: Mariano Lopez <just.another.mariano@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-11 21:12:48 +01:00
Mark Asselstine
a126d23833 goarch.bbclass: use MACHINEOVERRIDES and simplify go_map_arm()
Per https://github.com/golang/go/wiki/GoArm we need to set GOARM when
cross building for ARMv5, ARMv6 and ARMv7. The current approach of
using TUNE_FEATURES can be error prone, as we can see today when
attempting to build for Cortex-A7 which results in GOARM=''.

Since the value of MACHINEOVERRIDES already consolidates the values of
TUNE_FEATURES into something more consistent we can use the overrides
mechanism to set GOARM, leaving just a little bit of logic in
go_map_arm() to trigger off the arch (basically target vs host)
for the setting of GOARM.

(From OE-Core rev: 5f48939e26402b77fc3343f326765137f9570f40)

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-10 13:46:17 +01:00
Mark Asselstine
bb04858ea6 go.bbclass: Export more GO* environment variables
Currently we are not doing a good job of consolidating GO environment
variables used by the go build system in the go.bbclass, instead we
are relying on the individual GO recipe authors to perform the
exports. This can result in inconsistent build results and often
binaries that are not properly cross compiled, resulting in segfaults
when the applications are run on the target.

For example the GO documentation recommends that the environment
include a value assigned to GOARM when cross building for ARMv5, ARMv6
and ARMv7 (https://github.com/golang/go/wiki/GoArm).

In order to avoid polluting the build scripts with unnecessary
exports, such as run.do_compile, we attempt to only export variables
when they apply to a specific arch.

(From OE-Core rev: 6300c4a83f7c8fc88702798ffe25bd6d57091673)

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-10 13:46:17 +01:00
Ross Burton
4d1000a303 insane: fix gettext dependency warning
This message was using %s markers but nothing was being passed in.

(From OE-Core rev: d204398d40cbbea5a6b58a36fc289d569f2eb304)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-10 13:46:17 +01:00
Robert Yang
bd2b7d2213 sstate.bbclass: Use bb.utils.to_boolean() for BB_NO_NETWORK
Make it consistent with bitbake

(From OE-Core rev: 7fb540c3199bc2b82d60fff678b5e588ab4d1ad6)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-10 13:46:17 +01:00
Nikhil Pal Singh
b25ede81df cmake: Support Eclipse and other cmake generators
Support project-file generators such as CodeBlocks, CodeLite,
Eclipse, Sublime, and Kate for both make and Ninja build systems.

The following generators are listed in cmake --help:

  Unix Makefiles               = Generates standard UNIX makefiles.
  Ninja                        = Generates build.ninja files.
  Watcom WMake                 = Generates Watcom WMake makefiles.
  CodeBlocks - Ninja           = Generates CodeBlocks project files.
  CodeBlocks - Unix Makefiles  = Generates CodeBlocks project files.
  CodeLite - Ninja             = Generates CodeLite project files.
  CodeLite - Unix Makefiles    = Generates CodeLite project files.
  Sublime Text 2 - Ninja       = Generates Sublime Text 2 project files.
  Sublime Text 2 - Unix Makefiles
                               = Generates Sublime Text 2 project files.
  Kate - Ninja                 = Generates Kate project files.
  Kate - Unix Makefiles        = Generates Kate project files.
  Eclipse CDT4 - Ninja         = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.

All but one of these contain one of the strings, "Unix Makefiles" or "Ninja".
In each of these cases, cmake generates the Makefiles (or ninja files respectively),
and also the appropriate project files, eg. .project and .cproject for Eclipse.

A user can set OECMAKE_GENERATOR in their local.conf to any
one of these strings, except "Watcom WMake" (not supported).

(From OE-Core rev: 256e8b5deae66b1463c359db12af396702912139)

Signed-off-by: Nikhil Pal Singh <nikhilpal.singh@taitradio.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-10 13:46:17 +01:00
Andreas Müller
b54bff841b patch/insane: Rework patch fuzz handling
Currently there are three issues which can be enhanced:

1. Fuzz warnings cannot be configured as errors for hardening. It happened
   often to me that these warnings were overseen and detected after commits
   were already out.
2. The output is too verbose - particularly when more than one file is
   affected. Meanwhile all users should know why patch fuzz check is performed.
   So move links with background information to insane.bbclass.
3. Reduce copy & paste effort slightly by printing PN (nit: <recipe> was not
   a correct suggestion e.g for native extended recipe - see example below)

To achieve patch.py drops patch-fuzz info encapsulated by a header- and footer-
string into log.do_patch. With this insane.bbclass can drop warnings/errors
depending on 'patch-fuzz' in ERROR_QA or WARN_QA. Default remains unchanged:
Spit out warnings only.

A message for two fuzzed patches and 'pact-fuzz' in ERROR_QA now looks like:

| ERROR: autoconf-native-2.69-r11 do_patch: Fuzz detected:
|
| Applying patch autoreconf-exclude.patch
| patching file bin/autoreconf.in
| Hunk #1 succeeded at 73 with fuzz 1 (offset -3 lines).
| Hunk #2 succeeded at 143 (offset 6 lines).
| Hunk #3 succeeded at 167 (offset 6 lines).
| Hunk #4 succeeded at 177 (offset 6 lines).
| Hunk #5 succeeded at 281 (offset 15 lines).
| Hunk #6 succeeded at 399 (offset 15 lines).
| Hunk #7 succeeded at 571 (offset 20 lines).
| Hunk #8 succeeded at 612 (offset 20 lines).
| Hunk #9 succeeded at 636 (offset 20 lines).
| Hunk #10 succeeded at 656 (offset 20 lines).
| Hunk #11 succeeded at 683 (offset 20 lines).
|
| Applying patch autoreconf-gnuconfigize.patch
| patching file bin/autoreconf.in
| Hunk #1 succeeded at 55 with fuzz 1 (offset -3 lines).
| Hunk #3 succeeded at 663 (offset 18 lines).
|
| The context lines in the patches can be updated with devtool:
|
|     devtool modify autoconf-native
|     devtool finish --force-patch-refresh autoconf-native <layer_path>
|
| Don't forget to review changes done by devtool!
|
| ERROR: autoconf-native-2.69-r11 do_patch: QA Issue: Patch log indicates that patches do not apply cleanly. [patch-fuzz]

(From OE-Core rev: c762c0be43a3854a43cb4b9db559b03126d50706)

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-09 13:44:39 +01:00
Ross Burton
bf7bd734d0 sanity: clarify error message if TMPDIR moves
If TMPDIR is moved the error message says "move it back or rebuild" but the
obvious rebuild method of running 'bitbake [recipe]] -cclean' fails with the
same error.

Make it clear what we mean by adding "delete and".

(From OE-Core rev: 36805a628f8208ff6d7fba9955c5fb1ed6396395)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-09 13:44:39 +01:00
Nathan Rossi
9e685e2591 ccmake.bbclass: Create a cml1 style class for the CMake curses UI
The ccmake bbclass implements two tasks. The first task 'ccmake'
preserves the configured state of CMakeCache.txt (generated from the
configure task) and invokes the 'ccmake' program within a oe_terminal
execution. The user can then review, select and modify configuration
options and once satisfied with the configuration exit ccmake. Once
ccmake has exited the build can be run and the updated configuration
should be reflected in the output build.

The ccmake bbclass has a second task 'ccmake_diffconfig' to compute the
differences in configuration which was modified by ccmake. Since there
are many ways to persist the configuration changes within recipes and
layer configuration, the differences are emitted as a bitbake recipe
fragment (configuration.inc) using EXTRA_OECMAKE as well as a CMake
script file which can be used as a input to cmake via the '-C' argument.
Both files are generated in the WORKDIR of the build and the paths to
the files are written as output from the build. It is then up to the
user to take this configuration and apply it to the desired location.

(From OE-Core rev: 091c46a8ecba6b6b7c44078ae2b567a2ef6e72e9)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-09 13:44:39 +01:00
Ross Burton
ec43872af5 xmlcatalog: new class to update the XML catalogue
This is a new class to handle recipes that need to add/remove entries in the XML
Catalog(ue)[1].  In the future it will handle updating the catalogue on the
target, but the immediate requirement is during the build so currently this only
works with native recipes.

Note that as this is a new class and target use hasn't been implemented yet, it
is possible that the behaviour of this class will change.

[1] https://en.wikipedia.org/wiki/XML_catalog

(From OE-Core rev: 28c58cff76b24cea2745352c6557a81c04d85138)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-05 17:32:50 +01:00
Richard Purdie
bb1940a0d6 base/pixbufcache: Remove obsolete sstatecompletions code
This has been unused in OE-Core since the introduction of recipe specific
sysroots. Its not so useful since it only runs once upon sstate installation,
not per installation per sysroot.

Remove the weird looking comment left behind in pixbufcache too.

(From OE-Core rev: 2af49716504f65be0cb01f609ea9bfa334926589)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-05 17:32:50 +01:00
Nathan Rossi
35bd1759d5 cml1.bbclass: Use POSIX sh instead of var-SHELL
Use the default POSIX sh instead of relying of var-SHELL being set to a
compatible shell. Such that in cases where SHELL is set to a
incompatible shell (e.g. csh, zsh, fish, etc.) the terminal command does
not just silently fail.

(From OE-Core rev: 50d3ec1ac994fb5968d8edf82823a7e3d1d67d21)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-03 14:50:13 +01:00
Nathan Rossi
20ebaff9ee terminal.bbclass: Generate do_terminal as bitbake would
This changes the runfile that is generated to have the same behaviour as
bitbake with regards to emitting the shebang and trap code. The existing
implementation used 'env' with the current var-SHELL. This means that if
the user has configured there system/environment with a alternate shell
(e.g. csh, zsh, fish, etc.) the do_terminal function would attempt to
execute with the wrong/incompatible shell and fail silently.

With this change devshell and other classes that rely on terminal can
now run when the var-SHELL is not set to a sh compatible shell. For
devshell, it will launch the devshell with the users configured shell.

(From OE-Core rev: 53724281eb486847bc3be824aa4513a8688ec296)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-03 14:50:13 +01:00
Peter Kjellerstedt
6334737a78 base.bbclass, staging.bbclass: Move prepare_recipe_sysroot task dependency
Move prepare_recipe_sysroot's task dependency on populate_sysroot from
base.bbclass (where it was specified in the middle of do_configure's
definition) to staging.bbclass (where the rest of
do_prepare_recipe_sysroot is defined). This was a left-over from when
recipe specific sysroots were introduced in commit 809746f5 and the
task dependency on populate_sysroot was moved from do_configure to
do_prepare_recipe_sysroot.

(From OE-Core rev: fe6d020dd609fbde7e4413cef9bbdd4e3962c82c)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-03 14:50:13 +01:00
Alexander Kanavin
259e9a11e1 llvm: fix more places where '8.0' version of llvm was hardcoded
So that it says '8.0.0' to reflect the recent PV change.

(From OE-Core rev: 3b4049157a72bcd984f93405a75946a39c045f2d)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-01 14:48:44 +01:00
Ross Burton
24b9bcf043 insane: improve license checksumming logic
Instead of opening files as bytes and battling decoding to UTF-8 which can throw
exceptions, open directly as strings and replace invalid codepoints.  This
handles licenses in encodings which are not UTF-8 but are based on ASCII much
better.

Also instead of extracting the license lines, writing them to a file, and then
hashing the file, hash the lines directly.

(From OE-Core rev: 63ef9d342277c4ba541b78cbb45ef181f071f495)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-24 17:00:52 +00:00
Alistair Francis
2187d06166 goarch: Add riscv64
Although RISC-V 64-bit doesn't have official golang support there are
forks that now exist with at least some support and work is ongoing in
the upstream tree. In order to be able to use the goarch class add
support for RISC-V.

For more details see here:
https://github.com/golang/go/issues/27532

(From OE-Core rev: 91e3b2a762124bf5cf923654ef3a7c871b84c82f)

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-21 16:19:23 +00:00
Steven Hung (洪于玉)
49ffd2da21 class/sanity: strip the output of get_filesystem_id()
A previous commit 2f44b9b replace oe.utils.getstatusoutput() to
subprocess.check_output(). check_output() don't remove a trailling newline. Add strip()

(From OE-Core rev: 172c3e85c601a61f3c668f83b75f4c1eb31dbd4d)

Signed-off-by: Steven Hung (洪于玉) <Steven.Hung@mediatek.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-18 11:12:26 +00:00
Douglas Royds
7d9b03567d cmake: Reduce verbosity for make invocation
Since the dawn of time, we have set CMAKE_VERBOSE_MAKEFILE=1 in cmake.bbclass.
Back in 2016, we also explicitly set VERBOSE=1 in cmake_do_compile(),
to ensure that make (and ninja) output were verbose in log.do_compile.

Turning off CMAKE_VERBOSE_MAKEFILE=1 means that make (or ninja)
invocations from the command-line are non-verbose,
giving CMake's default human-readable output on the terminal instead.
The user can still invoke VERBOSE=1 make if they do want verbose output.
This has no effect on the verbose output that goes into the logs.

(From OE-Core rev: 75c4b61513d8b089e835fb8d5923d8749fed7880)

Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-12 11:57:41 -07:00
Bruce Ashfield
40c065800f linux-yocto: fix SRC_URI patching with unified repos
As reported by Paul Barker, my attempt to allow the patching
of kernel meta data broke other repository configurations, since
the meta data patch routing was matching too broadly and the
same repo would end up being patched twice.

Using his suggested fix, we are up and running with both types
of repos again.

(From OE-Core rev: 0fd09633e3c2fb4668c7700516d288f8c5356ff6)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-12 11:57:41 -07:00
Khem Raj
e53aa46f43 go: Add recipes for 1.12 release and make it default
- Refresh patches
- Enable GOCACHE required as of Go 1.12

(From OE-Core rev: f559fd6df2978f9093672794420eada2b7452987)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-09 14:43:11 +00:00
Douglas Royds
f1376858b3 icecc: Slightly more verbose log messages in the success case
The path containing the symlinks to icecc itself.
The path to the build env tarball.

(From OE-Core rev: 4b1f421ab5c7e5a3ee7bad5744149d331c6e0511)

Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-09 14:43:11 +00:00
Ming Liu
f52f818cf0 rm_work: sort the value of do_build dependencies
This fixes some 'basehash changed' errors when rm_work is being
inherited.

(From OE-Core rev: e74158b6cc1d683ab14ef5d47ec531f986fc2259)

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-09 14:43:11 +00:00
Jaewon Lee
58dbd3bfb9 device-tree.bbclass: Add support to compile overlays separately
Currently only dts files are considered when looping through files to
compile. Modifying the loop to compile other files that are overlays.
Also surrounding this check with a try block as the function to find
overlays parses the file for a '/plugin/' tag, and there may be files in
the DT_FILES_PATH directory that are not parseable.

(From OE-Core rev: bb1629820443bfedc72378a7c88f0656a2f3f7f1)

Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com>
Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com>
Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-09 14:43:10 +00:00
Robert Yang
09af407145 insane.bbclass: Add configure-unsafe and configure-gettext
So that the errors can be controlled by ERROR_QA or WARN_QA, and make them work
with INSANE_SKIP.

(From OE-Core rev: 4b86ebb6a87f75421a1d12d9d5dde303938c2e9f)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-07 21:55:29 +00:00
Robert Yang
b25608d491 insane.bbclass: Make INSANE_SKIP work for qa pkgconfig and la
The INSANE_SKIP = "pkgconfig" or "la" didn't work, this patch fixes the problem.

[YOCTO #13087]

(From OE-Core rev: 756d6419f10d388c5daa63b7607e580d8b5079f1)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-07 21:55:29 +00:00
Achille Fouilleul
739c9a69ca utils: Fix create_wrapper
Wrappers generated by create_wrapper do not work properly:
python, for example, looks at argv[0] to know if it is
running from a virtualenv. Because the wrapper replaces
argv[0] with python's canonical path, python cannot tell
whether it has been invoked directly or from a virtualenv
symlink.

This change makes the wrapper pass the original argv[0] down
to the real command.

(From OE-Core rev: 791e5bfcb449024f295a4f8f507c1012cff76f9d)

Signed-off-by: Achille Fouilleul <achille.fouilleul@gadz.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-06 23:12:27 +00:00
Joshua Watt
ccc413fd93 Add source package to ${PACKAGES}
Permanently adds the -src source package to ${PACKAGES} instead of
relying on creating it dynamically at packaging time. The source package
is now defined in bitbake.conf, just like -dev and -dbg packages.

For compatibility, the -src package is still added dynamically if it was
missing, since some recipes have a tendency to completely override
PACKAGES and do so without manually adding back the -src package.

This allows RDEPENDS on the -src packages, which wasn't previously
possible.

[YOCTO #13203]

(From OE-Core rev: b25e1edf0204fc2f64aa8d66e09b8e2d67b90e17)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-06 23:12:27 +00:00
Bruce Ashfield
04bfce60c8 kernel-yocto: allow kernel-meta repositories to be patched
For testing purposes, it is often easier to patch a fragment
in a kernel-meta repository versus needing to make a copy or
modify the source repository.

We can allow this sort of patching when a patchdir of kernel-meta
is passed (to indicate the nested kernel-meta repository).

Also note that we must patch the meta data before they are
processed/gathered, since migrated copies to the kernel source
directory will be used later.

(From OE-Core rev: 324f9c8181150c23e3ce1ace4c45794cc8894167)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-06 16:44:37 +00:00
Jaewon Lee
206ca252c6 devtool: Support kmeta directory usage with devtool modify/finish
When using Kmeta directories, devtool finish will add every single file
in the directory to the bbappend. This is because in the current
implementation, the get_recipe_local_files function treats the kmeta
directory like a file. Modifying the function to loop through the
provided directories and return all included files instead of just the
top level directory. This will enable correct file to file comparison
when determing which files are new/changed and need to be added to the
bbappend.

Adding an extra check in devtool-source.bbclass to not copy the cfg file
if its already included somewhere in the kmeta directory

Also during 'modify', when moving necessary files in the kmeta directory
from the workdir to oe-local-files, the dangling parent directories are
left behind.  This in itself is not an issue as the temporary devtool
workspace is automatically deleted, but this causes an incorrect include
directory to be added in kernel-yocto.bbclass.  Changing the order of
the if statements to catch the correct conditional. This is safe to do
as when not in the devtool context, there will be no oe-local-files
directory.

(From OE-Core rev: 4671011b5b02d0989aa0fdcb50e18cb385a0e95e)

Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com>
Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com>
Acked-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-06 10:39:25 +00:00
Matt Madison
d967e6d6f2 uboot-extlinux-config.bbclass: add missing variable dependencies
do_create_extlinux_config performs its own override processing
for several variables, so we have to explicitly add the label-
suffixed variable names to its vardeps to make sure that changes
get detected.

(From OE-Core rev: ad792edf61157f6cd63a2c6aa8e53edc134301d0)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-04 14:27:06 +00:00
Richard Purdie
d22b6e03a5 mcextend: Add helper class useful for multiconfig
This class allows users to easily create multiconfig BBCLASSEXTEND recipes
and is generally useful. It will be used by new tests so add as a general
feature.

(From OE-Core rev: 9ad19eb12c24d1ddc967215af0ebafd2cd2cb665)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-03 15:38:13 +00:00
Justin Bronder
a2938316e3 kernel: add objtool to shared workdir when CONFIG_UNWINDER_ORC is set
Based on: https://patchwork.openembedded.org/patch/148047/

When x86_64 enables CONFIG_UNWINDER_ORC [ORC (Oops Rewind Capability)
unwinder for unwinding kernel stack traces], objtool is required to
generate the required information.

If we don't copy objtool to the shared workdir, out-of-tree modules
cannot generate object files.

For instance, meta-skeleton/hello-mod fails with:
    | make[3]: *** No rule to make target 'tools/objtool/objtool', needed by ...

(From OE-Core rev: 7d4fdd3b95c949277f77df90bb2e8120b8d167ae)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-02 16:49:07 +00:00
Alex Kiernan
55b0f515bf kernel-fitimage: Replace tabs with spaces in python
Fix:

  WARNING: python should use 4 spaces indentation, but found tabs in kernel-fitimage.bbclass, line 33

(From OE-Core rev: 00716a795f10e223150b0f9b214d185d654f4cc1)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-28 17:47:10 +00:00
Khem Raj
9d973d3b4e default-distrovars: Drop DISTRO_FEATURES_LIBC
After eglibc was merged into glibc, Kconfig support was also dropped so
these libc features therefore are not effective anymore and can be
removed

(From OE-Core rev: c62b1cc06613a4cdddf53290e6203559f43fc62d)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-28 13:21:54 +00:00
Alexander Kanavin
48522906a2 qemu: split the native version into usermode and system parts
The rationale is to streamline the overall build.

The system parts are only needed to run target images, and so can be
built towards the end of the build process. At the same time, the
system parts may need gtk+-native and mesa-native which add significantly
to the build time.

On the other hand, the usermode parts have almost no dependencies
and can be built quickly. They are needed at recipes build time to
run target binaries, and so are required quite early in the typical
build process.

(From OE-Core rev: 4a558a5f2db68538e0edad798ddf48eb9510a7d6)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-28 13:21:54 +00:00
Manjukumar Matha
a55784451e kernel-fitimage.bbclass: Introduce a way to provide external dtb
Currently kernel-fitimage gets the dtb from KERNEL_DEVICETREE, however
there are instances when the DTB file can be generated using other
recipes, provide a way to include the DTB instead of inkernel device
tree.

Add support for external device tree during the creation of fitimage.  If
virtual/dtb is set using PREFERRED_PROVIDER_virtual/dtb = "devicetree", which
inherits the devicetree.bbclass then use the path provided in
EXTERNAL_KERNEL_DEVICETREE else use KERNEL_DEVICETREE during fitimage process

(From OE-Core rev: 084f4de4dbaf9821516fc0254d35f4fb04311d27)

Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-26 23:04:31 +00:00
Alexander Kanavin
1525641392 gtk-doc.bbclass: unset LD_LIBRARY_PATH
meson has been found to set it erroneously.

(From OE-Core rev: 920824125eb87928a329a072fa6c5a839efc932b)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-25 12:35:59 +00:00
Richard Purdie
e51d27b86e staging: Fix staging_populate_sysroot_dir native corruption
bitbake gdk-pixbuf gdk-pixbuf-native
bitbake build-sysroots -c build_target_sysroot

can lead to tracebacks as gdk-pixbuf-native is being installed into the
target sysroot. The issue is that the x86_64 (common BUILD_ARCH) sysroot
components directory can contain a mix of native and target artefacts.

Differentiate by the "-native" in the recipe names. Should also trim
down the size of the sysroot used in eSDK.

(From OE-Core rev: 57f32836060bba0eaa6b36f53146dd6fd07b77ed)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-25 10:43:06 +00:00
Manjukumar Matha
5397a7acd8 populate_sdk_ext.bbclass: Fix the derivate sdk build error from an published eSDK
When you install the eSDK in publish mode and then try to build a
derivative sdk using devtool build-sdk, the following error happens

| NOTE: Generating sstate task list...
| NOTE: Generating sstate-cache...
| NOTE: Generating sstate-cache...
| DEBUG: Python function copy_buildsystem finished
| NOTE: Executing install_tools ...
| DEBUG: Executing shell function install_tools
| install: cannot stat /core/meta/files/ext-sdk-prepare.py':
No such file or directory

This patch will fix the error by installing ext-sdk-prepare.py in
publish mode, so that derivative sdk can be generated.

(From OE-Core rev: aab4089a57a655ca5a7792f05eb5d8dcdb934ae1)

Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-25 10:43:06 +00:00
Manjukumar Matha
7bf275b54e devicetree.bbclass: Add virtual provider for dtb
Add virtual provider for dtb. This class can be used to generate dtb
from static devicetree, for reference see meta-xilinx layer
meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb

By providing a virtual provider we can use it to differentiate between
in-kernel dtb or an external one. This can be set in local.conf as
PREFERRED_PROVIDER_virtual/dtb = "devicetree"

(From OE-Core rev: a7d52dbffd0da95de82d910c595a6c27d9b2ad0d)

Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-25 10:43:06 +00:00
Richard Purdie
a5b7c86f23 kernel: Ensure an initramfs is added if configured
If ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.cpio does not exist,
nor any of the compressed variants, nothing is copied to kernel build's
./usr directory.

The code does not fail, but silently proceeds without a bundled initramfs.

Change to fail and tell the user something is wrong.

Also, if an initramfs is found, contrary to the comments, it does not stop
at the first uncompressed/compressed cpio image found. Instead it keeps
processing all so the last is used. Fix this to behave as per the comments.

[YOCTO #12909]

(Patch by Leon Woestenberg)

(From OE-Core rev: 5b5604e288af755eb5553a97d26533445b2cf94b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-25 10:43:06 +00:00
Peter Kjellerstedt
b44bd9fc6b libc-package.bbclass: Add a progress meter for the package task
The package task for glibc-locale takes a very long time to execute,
especially if using qemu. In that case, a progress meter helps a lot to
show the progress of the task.

(From OE-Core rev: bd2f9b2785779ef65c0c3664dae03b01ced59f6d)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-19 16:14:57 +00:00
Peter Kjellerstedt
4c56903824 libc-package.bbclass: Only extract wanted files in prep_locale_tree()
prep_locale_tree() predates the usrmerge DISTRO_FEATURE, which meant it
was not prepared for the case when ${base_libdir} == ${libdir}. This
lead to it extracting files and directories where it shouldn't.

(From OE-Core rev: 0bfc4dd0a9acc305b78fe9d5c2a7fb9afe708684)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-19 16:14:57 +00:00
Peter Kjellerstedt
dc9abea5f0 libc-package.bbclass: Correct a few paths for when usrmerge is used
(From OE-Core rev: a880377cd67b65101bf95e8dbad6221f498e38ef)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-19 16:14:57 +00:00
Alexander Kanavin
85a4d9f53b clutter-gtk-1.0: convert to meson
This required adding an option to control gobject introspection
via a custom patch, and tweaking clutter.bbclass to not enforce
autotools.

(From OE-Core rev: 9b9c12268bf9365101da4a985f70c06740dfeb8f)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-19 16:14:57 +00:00
Manjukumar Matha
c71dc290b0 kernel-fitimage.bbclass: Fix the dependency issue while generating fitimage_initramfs
When building fitimage_initramfs, the correct depedency is to build
after do_bundle_initramfs. We can run into the following dependency
issue

DEBUG: Python function extend_recipe_sysroot finished
DEBUG: Executing shell function do_assemble_fitimage_initramfs
aarch64-xilinx-linux-objcopy: 'vmlinux': No such file

This happens because initramfs renames vmlinux to vmlinux.bak while
generating vmlinux.initramfs, there is a chance that fitimage_initramfs
can also start during this process and create the above issue.

This patch resolve the dependency issue by running fitimage_initramfs
task after do_bundle_initramfs

(From OE-Core rev: 8f0bece39a634fce5bd882cbd9e289ea905a0b17)

Signed-off-by: Varalaxmi Bingi<varalaxm@xilinx.com>
Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-18 10:33:13 +00:00
Richard Purdie
eea86c4f0a native: Enable RDEPENDS handling
Native recipes don't currently honour their RDEPENDS. In the case of
some python scripts this has started causing problems since whilst they're
not needed at build time (DEPENDS), they are needed at runtime.

We put off making this change due to circular dependency issues. I believe
the three such problems in OE-Core are now fixed, as is the dependency loop
identfication code in bitbake so its time to improve this situation.

[YOCTO #10113]

(From OE-Core rev: c62520b63284927e177831c351fafa4d2768cb1f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-17 10:19:59 +00:00
Richard Purdie
050aab7f45 package: Rework debug source file handling
Currently we parallel process the files we install running dwarfsrcfiles over
each one in parallel threads but requiring a lock to write the results to one
file. This is not ideal for performance and means we can't then use per file
data for other purposes such as source code license processing.

Rework the code so that the list of source files is generated per installed
file and is reusable.

The code still generates a null separated debugsources.list file since this
is used by a shell pipeline but it no longer needs locking.

(From OE-Core rev: 95de93988eb725c14102f642ebabff3920ae194f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-17 10:19:59 +00:00
Anuj Mittal
bd5c9ca7c8 meson.bbclass: point to llvm-config
Allow packages using llvm-config to find it using meson's dependency
interface.

(From OE-Core rev: e2e733c813e1eabaaff795a30b82e703dfeecfe7)

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-15 16:05:37 +00:00
Joshua Watt
8d47356ad2 classes/license_image.bbclass: Fix rootfs license file permissions
Fixes up the permissions on the license files when they are put on the
target file system so that they are readable by everyone. Previously,
they would have inherited whatever permissions the file had in the
recipe, which may not have been appropriate.

[YOCTO #13175]

(From OE-Core rev: 8190d192fceb9b0969385507d3d4bca7be75c810)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-15 08:17:49 +00:00
Robert Yang
407a02b057 base.bbclass: Check BuildStarted for HOSTTOOLS
There might be no bb.event.ConfigParsed event if bitbake server is running, so
check bb.event.BuildStarted too to make sure HOSTTOOLS_DIR exists.

Fixed:
$ export BB_SERVER_TIMEOUT=-1
$ bitbake quilt-native
$ rm -fr tmp
$ bitbake quilt-native
ERROR: Error running gcc  --version: /bin/sh: gcc: command not found

This error is caused by enable_uninative(), it runs twice (ConfigParsed and
BuildStarted), the error would happen when there is no ConfigParsed event
(no hosttools is created), but BuildStarted. This patch can fix the problem.

[YOCTO #13022]

(From OE-Core rev: da798db0a48282e3d4f58890a7aec42c3deff0b8)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-15 08:17:49 +00:00
Khem Raj
c6a243dbb2 image_types.bbclass: Set memory usage limit and CPU threads for xz
when building with opkg backend and huge packages e.g. chromium/llvm all
going in parallel, memory pressure causes xz to catapult with

do_package_write_ipk: Failed to create package, opkg-build failed with: xz: (stdin): Cannot allocate memory

since there are many tasks going on in parallel, xz adds to memory pressure
and it wants it all, put an upper limit for memory xz can use

We add a variable XZ_MAXRAM with 30% of RAM limit and can be customized
if builders have more memory one can set it like

XZ_DEFAULTS = "-M 0 -T 0"

(From OE-Core rev: 28b277a93a34bba033d9d0d9f3227c9453efd384)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-14 11:20:55 +00:00
Silvio Fricke
1689d590e5 image_types: add base64 conversion
Sometimes it is useful to have a base64 representation of an image.

(From OE-Core rev: 9d00b146c4125b195fac5a0743fe7d8e59edef7f)

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-12 14:04:31 +00:00
Alexander Kanavin
e2c3247c23 python3: upgrade to 3.7.2
I took the same approach as the recent perl upgrade: write recipe from scratch,
taking the pieces from the old recipe only when they were proven to be necessary.

The pgo, manifest and ptest features are all preserved.

New features:

- native and target recipes are now unified into one recipe

- check_build_completeness.py runs right after do_compile() and verifies that
all optional modules have been built (a notorious source of regressions)

- a new approach to sysconfig.py and distutils/sysconfig.py returning values
appropriate for native or target builds: we copy the configuration file to a
separate folder, add that folder to sys.path (through environment variable
that differs between native and target builds), and point python to the file
through another environment variable.

There were a few other patches where it was difficult to decide if the patch
is still relevant, and how to test that it works correctly; please add those
as-needed by testing the new python.

(From OE-Core rev: 02714c105426b0d687620913c1a7401b386428b6)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-08 10:57:19 +00:00
Richard Purdie
251ded90d4 archiver/package_rpm: Fix the worst src.rpm generation race
The package_rpm code is writing outside the task's sstate directory into
the sstate of do_deploy_archives. This is "out of spec" since if the
task is installed from sstate, the files are not restored. This means
the files may appear/disappear, things are not deterministic and there are
races.

Extend the do_package_write_rpm code to handle writing the src.rpm into
place to avoid these issues. There are other problems but this avoids races
around this file.

(From OE-Core rev: c6e151ba7fe0f14044537cf0ab2cac436f1496e3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-06 08:29:07 +00:00
André Draszik
d05823086d update-alternatives: correctly escape PATHs when updating FILES_${PN}
The recently added support for updating FILES based on the file renames
that are happening here is using a regex replace, but failed to
properly escape the search pattern (the full path). This manifests itself
in FILES not being updated as soon as the full path contains any
character that has a special meaning, e.g. '+'.

In other words an original path (alt_target in the code) like
    /opt/poky/2.6+snapshot/sysroots/i686-pokysdk-linux/sbin/losetup
can't be matched, and hence we fail to update FILES with the new value,
causing packaging errors.

Fix by using re.escape() on the original path before passing into re.sub()

Fixes: 5c23fe378732 ("update-alternatives: try to update FILES_${PN} when
renaming a file"), or bcb3e7b7f8 in poky.git

[YOCTO #13058]

(From OE-Core rev: 126743162397e4145902b3f127f2dafd80a8a49b)

Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-06 08:29:06 +00:00
Richard Purdie
52faf80b7c package_rpm/archiver: Apply bandaid to src.rpm creation
| error: create archive failed on file /media/build1/poky/build/tmp/work/all-poky-linux/xcursor-transparent-theme/0.1.1+gitAUTOINC+23c8af5ba4-r0/deploy-sources/allarch-poky-linux/xcursor-transparent-theme-0.1.1+gitAUTOINC+23c8af5ba4-r0/xcursor-transparent-theme-0.1.1+git0+23c8af5ba4-r0.src.rpm: cpio: read failed - No such file or directory
| Building target platforms: noarch-poky-linux
| Building for target noarch-poky-linux

This is caused by:

$ cat log.task_order

do_cleansstate (24289): log.do_cleansstate.24289
do_deploy_archives_setscene (24395): log.do_deploy_archives_setscene.24395
do_fetch (24407): log.do_fetch.24407
[..]
do_package_write_rpm (25448): log.do_package_write_rpm.25448
do_package_qa (25451): log.do_package_qa.25451

So do_deploy_archives can run from sstate, created a .src.rpm in WORKDIR/deploy-sources,
then it was removed when rpm was running. This leads to a broken Source line in the
spec file as the original file was found by the os.listdir().

This fix is just a bandaid over much more fundamental problems sadly.

(From OE-Core rev: a10020ace4c3cd863c782760f7cbecea557ec6e7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-05 13:53:48 +00:00
André Draszik
bcb3e7b7f8 update-alternatives: try to update FILES_${PN} when renaming a file
When using update-alternatives, FILES_${PN} must be
referencing the new name after update-alternatives has
renamed files.

This is more or less OK when having static lists of files to
be packaged into a package, but makes it quite hard to
dynamically generate FILES_${PN}, e.g. using do_split_packages(),
as in that case we can not easily modify what goes into
FILES_${PN}, because that list is based on filenames as seen
at the time do_split_packages() is executing.

Of couse one could explicitly specify the (renamed) file(s)
in the recipe, but that contradicts the intended usage of
do_split_packages().

Instead, if FILES_${PN} contains the file name as it was pre
renaming, we here modify this to reflect the new name.

This will allow usage of do_split_packages() to populate
FILES_${PN}.

[YOCTO #13058]

(From OE-Core rev: 5c23fe378732038643a450cbf916334d24764b70)

Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-02 11:05:59 +00:00
André Draszik
0b782c39b9 update-alternatives: convert file renames to PACKAGE_PREPROCESS_FUNCS
At the moment, the update-alternatives file renaming is
happening right after copying into PKGD during packaging
time using an _append OVERRIDE to the copy function
perform_packagecopy().

This is not really readable and hard to maintain.

Additionally, this makes it impossible to e.g. populate
PACKAGES dynamically using do_split_packages() and still
do update-alternatives - update-alternatives file renaming
requires the PACKAGES variable to have been fully populated
to work correctly. On the other hand, do_split_packages()
can only execute after perform_packagecopy(), as it needs
PKGD populated; so it's impossible to insert
do_split_packages() early enough in a deterministic way in
this use-case.

As there doesn't seem to be a reason not to, convert
this to a proper function and use PACKAGE_PREPROCESS_FUNCS
instead - after all, that's what this is meant for.

No other classes or recipes in oe-core or meta-openembededd
seem to have a hard requirement on update-alterantives
executing before any other PACKAGE_PREPROCESS_FUNCS, so
this should be perfectly fine.

The only implication is that if compress_doc is inherited,
compressed man-page file names will end up being, e.g.
    eject.1.util-linux.gz
  or
    eject.1.gz.util-linux
based on the include of compress_doc.bbclass vs.
update-alternatives.bbclass order, but the symlink created
(alternative name) will always be correct.

This solves both problems:
* the code is easier to read / follow
* the above described use-case can be accomodated easily

[YOCTO #13058]

(From OE-Core rev: 8c3db2fa735e5933f842f80321bb3ed38753812d)

Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-02 11:05:59 +00:00
Alexander Kanavin
99fc8d54d6 pixbufcache.bbclass: remove a dependency loop introduced by enabling gtk+3-native
(From OE-Core rev: f99921554fddef82eb80568125aa646a27859a4b)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-28 23:14:10 +00:00
Joshua Watt
3c34a844fc classes/icecc: Add ICECC_REMOTE_CPP variable
Newer versions of Icecream (1.2) add support for remotely pre-processing
files, controllable with the ICECC_REMOTE_CPP environment variable.

(From OE-Core rev: 8fe6728536bbee814c421afbbaa2022e0da0f65c)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-28 23:14:10 +00:00
Joshua Watt
ba3aa53112 Change default debug split to make separate source packages
Changes the default PACKAGE_DEBUG_SPLIT_STYLE to generate separate
source and debug packages. SDKIMAGE_FEATURES is updated to include the
source packages so that there is not change for the SDK contents.

[YOCTO #12931]

(From OE-Core rev: 8df14b678e44cc749b361224af05ccbcfa9ae9b5)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-28 23:14:09 +00:00
Richard Purdie
55ab45436d package: Add pkg_postinst_ontarget to PACKAGEVARS
Changes to pkg_postinst_ontarget were not triggering rebuilds, this fixes
that.

[YOCTO #13127]

(From OE-Core rev: 432d5a5481bd8efb848b95fbe6500a72fba9ac65)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-26 13:39:37 +00:00
Robert Yang
043d6ac1f6 native.bbclass/cross.bbclass: No strip sysroot when DEBUG_BUILD
This makes dbg work for native tools, and makes debug native tools problem
easier, otherwise, there is no symbol since trippped.

(From OE-Core rev: 1d903485da26fec991b4a940182e32934220e19b)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-26 13:39:37 +00:00
Alexander Kanavin
f7718fa8ae testimage.bbclass: add support for passing runqemu params
This is particularly useful when setting up GL tests.

(From OE-Core rev: 167a46775059b782c6f82ce8c5a47b27262e95d4)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-26 13:39:37 +00:00
Alexander Kanavin
b8473eb822 fontcache: fix postinst for nativesdk case
Both installing the binary into the correct place, and passing that place
to postinst_intercept were missing.

(From OE-Core rev: 9ac7415464b7817aa5cc0c2167ff61f4344660dd)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-26 13:39:37 +00:00
Robert Yang
62dd6c2eff packagegroup.bbclass: Set INHIBIT_DEFAULT_DEPS
It doesn't need them since no compile happens.

(From OE-Core rev: c08478c06d541086bd358c318fce213910c7312d)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-24 17:45:25 +00:00
Alexander Kanavin
cc4e883a54 sstate.bbclass: make sure changes to SSTATE_SCAN_FILES are not ignored
When changing the SSTATE_SCAN_FILES variable in a recipe it doesn't cause a rebuild,
so if there's a sstate-cache available with "bad" sstate data in it that will still
be used even though the recipe is updated to address this.

[YOCTO #13144]

(From OE-Core rev: ea3526961920a229e0bb5fb459952be89fce2255)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-24 17:45:25 +00:00
Andreas Müller
ba0b32ebc3 remove unused distutils-tools.bbclass
* As far as I can see nothing uses it
* From commit history it seems distutils-tools came in accidentally

(From OE-Core rev: a4edfa4cf451bf412525887b5b24b9db6486ae97)

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-23 07:57:07 +00:00
Joshua Watt
24ff4ee9fe classes/populate_sdk_base: Add src-pkgs to COMPLEMENTARY_GLOB
Add a COMPLEMENTARY_GLOB for source packages (*-src) so that they can be
included when PACKAGE_DEBUG_SPLIT_STYLE is "debug-with-srcpkg"

[YOCTO #12931]

(From OE-Core rev: d6d2175032c6c950a0d8d63dad0734e1a9f80e12)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-22 14:35:58 +00:00
Joshua Watt
1d86f65ff5 classes/sstate: Update output hash
Updates the output hash calculation for determining if tasks are
equivalent. The new algorithm does the following based on feedback:
 1) The output hash function was moved to the OE library.
 2) All files are printed in a single line tabular format
 3) Prints the file type and mode in a user-friendly ls-like format
 4) Includes the file owner and group (by name, not ID). These are only
    included if the task is run under pseudo since that is the only time
    they can be consistently determined.
 5) File size is included for regular files

(From OE-Core rev: 4bd297dfe92851f3b44f6b5560bac9d8f9ccf9f2)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-22 14:35:58 +00:00
Khem Raj
d5edd81f89 musl,glibc,newlib: Drop redundant STAGINGCC
We do not have initial phase of bootstrapping toolchains anymore

(From OE-Core rev: 75a2c15bbabf4df14631c822b20ce6d31098a5c8)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-21 23:44:22 +00:00
Peter Kjellerstedt
0ac56322d9 extrausers.bbclass: Suggest to use IMAGE_CLASSES rather than INHERIT
Since this class is only useful for image recipes, it is better to
suggest adding it via IMAGE_CLASSES instead of INHERIT in the example.

Also make the example a bit more readable by indenting the variable
values.

(From OE-Core rev: ee91a464f2cad6b3801e18fee28e639e1c957d41)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-18 16:24:40 +00:00
Robert Yang
024b5af548 sstate.bbclass: remove dependencies of SSTATE_EXTRAPATHWILDCARD
There might be do_cleansstate errors sometimes:
ERROR: When reparsing
/path/to/meta/recipes-devtools/quilt/quilt-native_0.65.bb.do_cleansstate,
the basehash value changed from
b4dbcb956a32ed4c3f58b7971717907bfc03bb21f3b140fa97f7765ee695f4d0 to
c8307418a671686349b73efbd51c5c82c897a88707a759ddb22fd95baa5df2ba. The metadata
is not deterministic and this needs to be fixed.

The stable reproducer is:
- Initial a fresh build, this is a must, otherwise we may can't reproduce it
  $ . oe-init-build-env build
  $ bitbake quilt-native -ccleansstate

This is because uninative.bbclass resets NATIVELSBSTRING from distro (e.g.,
ubuntu) to universal, remove dependencies of SSTATE_EXTRAPATHWILDCARD as
SSTATE_EXTRAPATH did can fix the problem.

(From OE-Core rev: 781117f9f02c0080dadc8797a8f8f9377a99b164)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-16 15:35:07 +00:00
André Draszik
46bd059869 classes/compress_doc: add missing import subprocess
Enabling compress_doc gives the following stack trace:

File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:package_do_compress_doc(d)
     0003:
File: '/scratch/yocto/swupd.bb/poky/meta/classes/compress_doc.bbclass', lineno: 50, function: package_do_compress_doc
     0046:    mandir = os.path.abspath(dvar + os.sep + d.getVar("mandir"))
     0047:    if os.path.exists(mandir):
     0048:        # Decompress doc files which format is not compress_mode
     0049:        decompress_doc(mandir, compress_mode, decompress_cmds)
 *** 0050:        compress_doc(mandir, compress_mode, compress_cmds)
     0051:
     0052:    infodir = os.path.abspath(dvar + os.sep + d.getVar("infodir"))
     0053:    if os.path.exists(infodir):
     0054:        # Decompress doc files which format is not compress_mode
File: '/scratch/yocto/swupd.bb/poky/meta/classes/compress_doc.bbclass', lineno: 180, function: compress_doc
     0176:                    _collect_hardlink(hardlink_dict, file)
     0177:                # Normal file
     0178:                elif os.path.isfile(file):
     0179:                    cmd = "%s %s" % (compress_cmds[compress_mode], file)
 *** 0180:                    (retval, output) = subprocess.getstatusoutput(cmd)
     0181:                    if retval:
     0182:                        bb.warn("compress failed %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
     0183:                        continue
     0184:                    bb.note('compress file %s' % file)
Exception: NameError: name 'subprocess' is not defined

Fix by adding the missing import in two places.

(From OE-Core rev: 539f65d2533a277233d83d085cb78bdf56a6e16c)

Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-16 15:35:07 +00:00
Richard Purdie
e1b639bd5e meta: Fix python code quoting issues
python 3.8 will be stricter about python quoting. Fix up several misquoted
expressions and fix Deprecation warnings like:

Var <do_compile>:1: DeprecationWarning: invalid escape sequence \$

(From OE-Core rev: 3ba6cee84de89f8eb200e4c93d446f6cdeeaa4be)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-16 15:35:07 +00:00
Richard Purdie
cd4b8a8553 meta: Fix Deprecated warnings from regexs
Fix handling of escape characters in regexs and hence fix python
Deprecation warnings which will be problematic in python 3.8.

Note that some show up as:

"""
meta/classes/package.bbclass:1293: DeprecationWarning: invalid escape sequence \.  

"""

where the problem isn't on 1293 in package.bbclass but in some _prepend to a
package.bbclass function in a different file like mesa.inc, often from
do_package_split() calls.

(From OE-Core rev: 4b1c0c7d5525fc4cea9e0f02ec54e92a6fbc6199)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-16 15:35:07 +00:00
André Draszik
181e3a8446 classes/buildhistory: display modified git branches
When collecting the git revision of repositories, also take
note of whether or not that repository has uncommited
changes.

This makes it a bit clearer what went on when looking at
diffs.

(From OE-Core rev: b9d780c7eeda0fefb13edde8bdba4f1d91e7823c)

Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-14 17:38:24 +00:00
André Draszik
dfd833725d meta: remove True option to getVar calls (again)
A couple have still been missed in the past despite multiple
attempts at doing so (or simply have re-appeared?).

Search & replace made using the following command:
    sed -e 's|\(d\.getVar \?\)( \?\([^,()]*\), \?True)|\1(\2)|g' \
        -i $(git grep -E 'getVar ?\( ?([^,()]*), ?True\)' \
             | cut -d':' -f1 \
             | sort -u)

(From OE-Core rev: 9f551d588693328e4d99d33be94f26684eafcaba)

Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-14 11:35:56 +00:00
Jacob Kroon
889d9e037f package.bbclass: Make package output files more deterministic
Observing depsig.do_package for packages inbetween rebuilds indicated
that the following variables/files content was changing order randomly.
Make them deterministic by sorting the output:

 RDEPENDS_<pkg>
 RRECOMMENDS_<pkg>
 FILERDEPENDSFLIST_<pkg>

 packages-split/<pkg>.shlibdeps

The following variable was not observed to change, but it is
assumed that the same situation can occur, so do the same
sorting for consistency:

 FILERPROVIDESFLIST_<pkg>

(From OE-Core rev: c99cb0bbb78089d1d15c4c8563a71db0df1cb0da)

Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-14 11:35:56 +00:00
Robert Yang
3be36b0d27 cmake.bbclass: Make it work with ccache
This can make the following recipes work with cmake:
cmake libdnf libcomps librepo createrepo-c llvm dnf libsolv assimp waffle
libjpeg-turbo taglib libproxy libical

And the following 3 recipes don't:
webkitgtk vulkan piglit
Now cmake.bbclass doesn't disble ccache any more, disable it in the recipes if
needed.

(From OE-Core rev: d014c8c11fb663f131d3a860ddeda17d604b2dd3)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-14 11:35:55 +00:00
Robert Yang
7a713b0fbf goarch.bbclass: Set CCACHE_DISABLE
Go can't be built with ccache.

(From OE-Core rev: cf64c9413a2264aa67e26c6302342ff4aa99a575)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-14 11:35:55 +00:00
Robert Yang
e96d0200ca ccache.bbclass: Set CCACHE_CONFIGPATH to fix race issues
Fixed race issues when parallel build:
ccache: error: /path/to/ccache/i586-poky-linux/mmc-utils/ccache.conf: No such file or directory
ccache: error: /path/to/ccache/i586-poky-linux/mmc-utils/ccache.conf: No such file or directory

This is because we set CCACHE_DIR for earch recipe, and ccache will create a
ccache.conf for each CCACHE_DIR when CCACHE_CONFIGPATH is not set, but there
might be a race issue in parallel build:

ccache gcc file1.c
ccache gcc file2.c

If the two ccache processes use fopen(path, "w") to create ccache.conf at the
same time, the error would happen. Set CCACHE_CONFIGPATH to
meta/conf/ccache.conf can fix the problem, and we can add other configs to the
file when needed.

And also set cache_dir_levels to 1 (default is 2) since each recipe has a cache
dir, thus we don't have too many files in one dir.

(From OE-Core rev: 2abbc4d0cd571e82ed6188d3b2d84b4cd6be25e8)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-14 11:35:55 +00:00
Robert Yang
7953d6a8bc ccache.bbclass: Add task do_cleanccache
(From OE-Core rev: 36cead66fbadd8c3827aec4b67ea124ee3c2ff94)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-14 11:35:55 +00:00
Robert Yang
e1cad77fa7 ccache.bbclass: Make it can be shared between different builds
CCACHE_BASEDIR: ccache removes this from file path, so that hashes will be
                the same in different build dirs.

CCACHE_TOP_DIR: Set it to a shared location for different builds.

(From OE-Core rev: 35d7fe73bba15de16d2eb0a4b12ef03b57b23306)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-14 11:35:55 +00:00
Robert Yang
0c98ff2c31 ccache.bbclass: Refactor it to make it more reliable
The previous ccache.bbclass has the following problems:
- It uses host's ccache for native recipes, but this may not work on some
  hosts, for example, it nerver works on my Ubuntu 14.04.4, there are always
  build failures (m4-native failed at do_configure, and others will also be
  failed if I disable CCACHE for m4-native)

- native/nativesdk/cross/crosssdk recipes use host's ccache, but target uses
  ccache-native, this may confuse user.

- The target recipes may use both host's ccache and ccache-native, this may
  cause unexpected problems and be hard to debug. This is because ccache-native is
  in SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS, so ccache-native may not be present when
  rebuild target recipes, and then it would use hosttools/ccache, but the
  previous ccache files were generated by ccache-native.

- Target recipes can't use ccache when no ccache is installed on the host:
  CCACHE = "${@bb.utils.which(d.getVar('PATH'), 'ccache') and 'ccache '}"

After refactored:
All types recipes (native, target and others) will use ccache-native except
ccache-native itself, host's cache won't be used any more. It is more
reliable now, which will work everywhere when ccache-native can be built.

And now we need use "CCACHE_DISABLE = '1'" to disable ccache for the recipe
rather than "CCACHE = ''" since we set CCACHE in anonymous function, and
d.getVar('CCACHE') works after "CCACHE ??=" which is set in bitbake.conf, so we
can't check whether CCACHE is set or not in anonymous function since it is
always set. Use CCACHE_DISABLE to disable it would be more clear.

(From OE-Core rev: b25271b65262f70d849a4861da216c9be6c54d53)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-14 11:35:55 +00:00
Ross Burton
c62ad6939f gsettings: allow the schemas to be in any package
Instead of assuming that the schemas are located in ${PN}, add a
GSETTINGS_PACKAGE variable for the package name and default it to ${PN}.

For recipe that can conditionally ship schemas, support GSETTINGS_PACKAGE being
empty gracefully by doing nothing.

(From OE-Core rev: c2b9c34ce4af151cc0422e14af775c6c962de051)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-11 10:39:09 +00:00
Robert Yang
c856ed29df oeqa: make it work for multiple users
There are failures when multiple users run oe-selftest on the same
host:

PermissionError: [Errno 13] Permission denied: '/tmp/oe-saved-
tests/201812250324_qemu'

This is because /tmp/oe-saved-tests was created by user A, while user B tries
to write data in it, then the error will happen. This patch can fix the
problem.

Move the dumped data to ${LOG_DIR}/runtime-hostdump/ rather than
/tmp/oe-saved-tests/ to fix the problem.

(From OE-Core rev: e219fe5329599cd6c3682f521eaee3852a2c8980)

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>
2019-01-11 10:39:09 +00:00
Joshua Watt
14800d7361 classes/icecc: Remove trailing whitespace
(From OE-Core rev: d065c592977ad742515121e07ed3b7698db55f25)

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>
2019-01-11 10:39:09 +00:00
Joshua Watt
f5cc622aab classes/icecc: Check blacklist for BPN
If a given PN is listed in the icecream blacklist, there is a very good
chance that the native, nativesdk, and multilib variants should also be
skipped. Check the blacklist entries against BPN to cover them.

[YOCTO #13128]

(From OE-Core rev: 1863f695a1411e95e7e547a3eb3e7ef6604a93bf)

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>
2019-01-11 10:39:09 +00:00
Jacob Kroon
18c1b63cb2 buildhistory: simplify buildhistory_list_files()
Avoid duplicating shell code for the two cases, fakeroot/non-fakeroot.

(From OE-Core rev: c4a931df28f45f95f19a13062b8dc38db60da342)

Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-11 10:39:09 +00:00
Robert Yang
f476905b9c package.bbclass: Do not hide cpio's error
We use subprocess.check_output() to run the command, which means that we need care
about the error, so the 2>/dev/null should not be used, otherwise it is hard to
debug when the error happens.

I guess it was copied from previous lines, but that command's error can be
ignored (excpet: pass):
   try:
       subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
   except subprocess.CalledProcessError:
       # Can "fail" if internal headers/transient sources are attempted
       pass

But we don't do this in the current location, so remove "2>/dev/null"

(From OE-Core rev: 017a53d2743be2b5d4965a39b4e126fb74f700ad)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-11 10:39:09 +00:00
Alex Kiernan
1c0473fe4b uboot-sign.bbclass: silence warnings when UBOOT_DTB_BINARY is empty
When UBOOT_DTB_BINARY is set to "", the keys for signed booting are
expected to be already present in U-Boot's DTB, so don't issue warnings
for this.

(From OE-Core rev: 04656f5df326a72747fc5878ce201b636a2a419c)

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>
2019-01-11 10:39:09 +00:00
Kai Kang
24d8aa6ec2 distro_features_check.bbclass: show all error info at one time
In distro_features_check.bbclass it checks whether items in
REQUIRED_DISTRO_FEATURES and CONFLICT_DISTRO_FEATURES exist in
DISTRO_FEATURES. But it only shows one required or conflict distro
feature when error occurs. Update to show them all at one time.

(From OE-Core rev: d0441c40afdba119a65189d6a5aca5c533f68279)

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>
2019-01-11 10:39:09 +00:00
Jacob Kroon
348f6b0b61 package.bbclass: Sort FILES_INFO by key
Observing depsig.do_package for a package inbetween rebuilds indicated
that FILES_INFO was changing content order randomly. Force it to be
deterministic by sorting with respect to the keys when serializing.

Suggested-by: Joshua Watt <jpewhacker@gmail.com>
(From OE-Core rev: b0364be65bf0b3dee44f81379f4062e9f707c128)

Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-11 10:39:09 +00:00
Alexander Kanavin
d460892f32 meta/classes: adjust perl-related classes to the new recipes
This mostly means tweaking the paths to match upstream defaults.

get_perl_arch() functions are taken from the patch by Jens Rehsack:
http://lists.openembedded.org/pipermail/openembedded-core/2018-November/276546.html

(From OE-Core rev: d6b36b1babb4d3e8d41278111e71c71fde9af39e)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-11 10:39:09 +00:00
Douglas Royds
c3a244b792 patch: reproducibility: Fix host umask leakage
Some patch files create entirely new files, so their permissions are subject to
the host umask. If such a file is later installed into a package with no change
in permissions, it breaks the reproducibility of the package.

This was observed on libpam, for instance: The patch file
pam-security-abstract-securetty-handling.patch creates a new file
(tty_secure.c). This file is later copied into the -dbg package with no change
in permissions.

(From OE-Core rev: 2a2bbd755b330cd63f7f6e2f2b374a3ae065b37a)

Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-11 10:39:08 +00:00
Ross Burton
3085647e0c toolchain-scripts: run post-relocate scripts for every environment
SDKs for multilib configurations have multiple environment scripts, so
re-arrange the post-relocate hook invocation so that it runs the post-relocate
hooks after sourcing each environment script.

(From OE-Core rev: c4897001cb3eeda1f4f11197b28c09c950bdcf02)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-08 11:16:44 +00:00
Robert Yang
dda8084d7a oeqa: Fix for QEMU_USE_KVM
Fixed:
MACHINE = "qemux86"
QEMU_USE_KVM = "qemux86"
IMAGE_CLASSES += "testimage"

$ oe-selftest -r runqemu.RunqemuTests.test_boot_rootfs

[snip]
  File "/buildarea1/lyang1/poky/meta/lib/oe/types.py", line 122, in boolean
    raise ValueError("Invalid boolean value '%s'" % value)
ValueError: Invalid boolean value 'qemux86'

Now QEMU_USE_KVM can only be boolean, can not contain MACHINE any more, kvm
will be enabled if target_arch == build_arch or both of them are x86 archs.

(From OE-Core rev: 7c1a8a624cad8d967635c6cb5f99cf655bde3d44)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-08 11:16:44 +00:00
Joshua Watt
adc37721a8 sstate: Implement hash equivalence sstate
Converts sstate so that it can use a hash equivalence server to
determine if a task really needs to be rebuilt, or if it can be restored
from a different (equivalent) sstate object.

The unique hashes are cached persistently using persist_data. This has
a number of advantages:
 1) Unique hashes can be cached between invocations of bitbake to
    prevent needing to contact the server every time (which is slow)
 2) The value of each tasks unique hash can easily be synchronized
    between different threads, which will be useful if bitbake is
    updated to do on the fly task re-hashing.

[YOCTO #13030]

(From OE-Core rev: d889acb4f8f06f09cece80fa12661725e6e5f037)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-08 11:16:44 +00:00
Joshua Watt
cbdfa37663 classes/sstate: Handle unihash in hash check
Handles the argument that passes task unique hash in the hash check
function, as it is now required by bitbake

[YOCTO #13030]

(From OE-Core rev: 1c14b6969e58b51a325c1c1acf9c96e55675035c)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-08 11:16:44 +00:00
Manjukumar Matha
6a080d90e5 kernel.bbclass: Fix incorrect deploying of fitimage.initramfs
When kernel-fitimage and initramfs is enabled using
INITRAMFS_IMAGE_BUNDLE = "1", kernel do_deploy tries to deploy
fitImage.initramfs with following error

| install: cannot stat 'arch/arm64/boot/fitImage.initramfs': No such
file or directory

Skip deploying fitimage.initramfs, since fitimage does not
create fitimage.initramfs

(From OE-Core rev: 0f87f8522a2c1b5a7042738887952b98060fbd9d)

Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-07 10:54:13 +00:00
Clemens Lang
caf55cf9b4 update-alternatives.bbclass: Stabilize iteration order
The use of a dictionary for link_rename causes problems for higher-order
alternatives, i.e. when an alternative link points to another
alternative link, since these links must be processed in the order in
which they were originally added for symlink correction to work.

Switch from a dict to a list of tuples to ensure processing happens in
the original order.

(From OE-Core rev: 326220267ffc43ec1f507ad0cc47ac59caafd5b7)

Signed-off-by: Clemens Lang <clemens.lang@bmw-carit.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-07 10:54:13 +00:00
Jacob Kroon
2b9c40e56b classes/buildhistory: avoid git diff churn by sorting more dictionaries
Sort 'srcrevs' and 'tag_srcrevs' before iterating over them in order
to avoid unnecessary changes in the build history.

(From OE-Core rev: 031d708aedda11d65ba9746af4f01b91264a1f86)

Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-07 10:54:13 +00:00
Chen Qi
ea915ed419 package.bbclass: fix python unclosed file ResourceWarning
Fix the following warning.

  ResourceWarning: unclosed file <_io.TextIOWrapper name='/.../systemd/1_239-r0/debugsources.list' mode='a' encoding='UTF-8'>

(From OE-Core rev: 91810a57f0edd8b37c5f3f989a5aca69d9a40b37)

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>
2019-01-03 21:16:00 +00:00
Michael Ho
aa83cb5264 sstate: add support for caching shared workdir tasks
The sstate bbclass uses workdir as a hardcoded string in path
manipulations. This means that the sstate caching mechanism does
not work for the work-shared directory which the kernel uses to
share its build configuration and source files for out of tree
kernel modules.

This commit modifies the path manipulation mechanism to use the
work-shared directory if detected in the paths when handling the
sstate cache packages.

(From OE-Core rev: 27642449f95e38598f9c83948ce109c5891e5877)

Signed-off-by: Michael Ho <Michael.Ho@bmw.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-03 21:16:00 +00:00
Aníbal Limón
fed984dc8e meta/classes/testimage.bbclass: Only validate IMAGE_FSTYPES when is QEMU
When use simpleremote target the flash/boot process is executed
manually, the IMAGE_FSTYPES validation is only needed when execute
testimage against qemu.

The supported_fstypes comes from oeqa.core.target.qemu module.

(From OE-Core rev: e7dc5963adbacc091fe8943119262166977623ad)

Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-03 12:35:54 +00:00
Lei Maohui
d7d492af8e Added armeb into meson.bbclass.
(From OE-Core rev: b0021e3d33ba0fb60a340d4553267b18d296b2be)

Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-03 12:35:53 +00:00
Martin Jansa
08eb8565b6 sstate.bbclass: catch ValueError from incorrectly written sstate manifests
* in some rare cases the file format might be broken, e.g. when you run
  out of disk space while writing to it (hint: make sure to use
  BB_DISKMON_DIRS on _all_ the builds, to make sure that they can stop
  gracefully before this happens).

* will show error like this:
  ERROR: Invalid line '/OE/build/luneos-thud/webos-ports' in sstate manifest '/OE/build/luneos-thud/webos-ports/tmp-glibc/sstate-control/index-allarch'
  when the file isn't complete, like in my case:
  $ tail -n 2 /OE/build/luneos-thud/webos-ports/tmp-glibc/sstate-control/index-allarch
  /OE/build/luneos-thud/webos-ports/tmp-glibc/stamps/all-webos-linux/org.webosports.app.calculator/0.1.1+gitrAUTOINC+9e9eb67c28-r0 /OE/build/luneos-thud/webos-ports/tmp-glibc/sstate-control/manifest-allarch-org.webosports.app.calculator /OE/build/luneos-thud/webos-ports/tmp-glibc/work/all-webos-linux/org.webosports.app.calculator/0.1.1+gitrAUTOINC+9e9eb67c28-r0
  /OE/build/luneos-thud/webos-ports

* instead of much longer exception which doesn't really show what's
  wrong to selectively fix that (other than removing while TMPDIR):

  ERROR: Command execution failed: Traceback (most recent call last):
  File "/OE/build/luneos-thud/webos-ports/bitbake/lib/bb/command.py", line 113, in runAsyncCommand
    self.cooker.updateCache()
  File "/OE/build/luneos-thud/webos-ports/bitbake/lib/bb/cooker.py", line 1562, in updateCache
    bb.event.fire(event, self.databuilder.mcdata[mc])
  File "/OE/build/luneos-thud/webos-ports/bitbake/lib/bb/event.py", line 225, in fire
    fire_class_handlers(event, d)
  File "/OE/build/luneos-thud/webos-ports/bitbake/lib/bb/event.py", line 134, in fire_class_handlers
    execute_handler(name, handler, event, d)
  File "/OE/build/luneos-thud/webos-ports/bitbake/lib/bb/event.py", line 106, in execute_handler
    ret = handler(event)
  File "/OE/build/luneos-thud/webos-ports/openembedded-core/meta/classes/sstate.bbclass", line 1083, in sstate_eventhandler2
    (stamp, manifest, workdir) = l.split()
  ValueError: not enough values to unpack (expected 3, got 1)

(From OE-Core rev: 870ba5d80e76e0f989971532fc2adc0ebe811ab6)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-03 12:35:53 +00:00
Pau Espin Pedrol
48c0ed2aec kernel-module-split.bbclass: Fix modinfo decoding in old kernels
Before linux commit d36b691077dc59c74efec0d54ed21b86f7a2a21a, some
strings contained invalid utf-8 character which made
split_kernel_module_packages unhappy when parsing ums-isd200.ko:

Exception: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 21: invalid start byte

(From OE-Core rev: 503b977acf6984120818cbc5cfd35ff2cffb39cd)

Signed-off-by: Pau Espin Pedrol <pespin@sysmocom.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-03 12:35:53 +00:00
Kai Kang
a32c80e6f0 testimage.bbclass: remove boot parameter systemd.log_target
Boot parameter systemd.log_target=console affects command journalctl's
output and causes oe selftest case test_systemd_boot_time fail to pass.

| Error at obtaining the boot time from journalctl
| RESULTS:
| RESULTS - systemd.SystemdJournalTests.test_systemd_boot_time - Testcase -1: SKIPPED (0.74s)

systemd.log_target=console was introduced by oe-core commit a0bb649 and
work with parameter systemd.log_level to enable systemd debug.
systemd.log_level has been removed already, so remove systemd.log_target
too to make case test_systemd_boot_time pass.

(From OE-Core rev: caa776bdcf8ea34c857f45970370bf771075f4bc)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-27 22:52:58 +00:00
Alejandro del Castillo
46c9a32230 package_ip.bbclass: add xz threading
Before, threading was enabled via a patch to opkg-build. Now that
opkg-build provides a hook for extra arguments, use that.

(From OE-Core rev: b288f4e825a036b9cc15b27301d264fe695dba65)

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-27 22:52:58 +00:00
Khem Raj
dc07845321 base.bbclass, classextend.py: Drop catering to gcc-initial
(From OE-Core rev: 5d0307fbefbc8e6667edfa93d527166059a30100)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-26 11:19:54 +00:00
Richard Purdie
46cb012491 crosssdk/cross-canadian: Set LIBCOVERRIDE correctly
(From OE-Core rev: 94bece16c23c9ec8850fd497aea37e6a265da30a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-26 11:12:12 +00:00
Khem Raj
801745d918 populate_sdk_ext.bbclass: Include site.conf in parsing for contents for local.conf
Some distros use site.conf to emit certain variables which are important
for eSDK e.g. DISTRO with out which eSDK will not be able to ger right
metadata when it tries to build

(From OE-Core rev: 95659bed3f6f3216b346f70cfc9ffae9788c0fc1)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-20 14:53:55 +00:00
Douglas Royds
4f2414afd0 icecc: patchelf is needed by icecc-create-env
Although we could potentially build patchelf and all its dependencies,
they would all have to be blacklisted to avoid trying to build them with
icecc. We use the host patchelf instead.

(From OE-Core rev: 0860216a81092fba084d29696db6d0c65a226c85)

Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-20 14:53:55 +00:00
Douglas Royds
f6c639f578 icecc: Don't generate recipe-sysroot symlinks at recipe-parsing time
The python function icecc_path() was being invoked inline by set_icecc_env(),
meaning that it was being invoked at recipe-parsing time.
As a side-effect, icecc_path() was creating the recipe-sysroot directory and
symlinking icecc into it. Because this was done at parsing time (rather than
configure time), we were generating otherwise-empty WORKDIRs for *all* parsed
recipes, and for all virtual classes (-native, -nativesdk).
In my build, this generated more than 800 of these otherwise-empty WORKDIRs.

I have simplified icecc_path() to return only the intended path to the icecc
symlinks in the recipe-sysroot, with no side-effect.
We then create the directory and the icecc symlinks at configure time.

Because get_cross_kernel_cc() is still invoked at parse-time,
it needs a guard-clause for the non-kernel case.
We are now finding the host icecc at do_configure time,
so icecc needs to be in the HOSTTOOLS. I have made this non-fatal,
so that we can still inherit icecc without icecc installed.

(From OE-Core rev: d2fcaeb153fdc3f8d7143ea823139f1537055ff1)

Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-20 14:53:55 +00:00
Douglas Royds
45a59ffbd6 icecc: Syntax error meant that we weren't waiting for tarball generation
If two bitbake processes try to generate the ICECC_VERSION tarball at the same
time, the thread that fails to get the lock will wait 30 sec for the first to
finish. A syntax error meant that this was not happening, and in particular, if
tarball generation failed (eg. for lack of patchelf), it did so silently.

(From OE-Core rev: 4455c46bf7f49c2b44f250aa89b63b342368e2e3)

Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-20 14:53:55 +00:00
Douglas Royds
7e80de311c icecc: Trivial simplification
(From OE-Core rev: fa6bae80bc3392bf99ce53bbe19a0e05dbd0c4ee)

Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-20 14:53:55 +00:00
Douglas Royds
40fd208847 icecc: readlink -f on the recipe-sysroot gcc/g++
We were accidentally doing a readlink -f on simply 'gcc', for instance

(From OE-Core rev: 6d6788a3ea45d9693743d9b3319fb0368a4d5d33)

Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-20 14:53:55 +00:00
Richard Purdie
739c420caa distrodata: Remove
The code in the tasks within this class are old and there are much better
ways to do these things now such as through tinfoil rather than writing csv
files incrementally with start/stop events and lock files.

Existing users of the code (mainly the do_checkpkg task) have been ported
over to tinfoil. Drop the class, any other users should also make use
of the tinfoil functionality.

(From OE-Core rev: 6e2a488f01e5e8bc6f06b6fac1d336bf5372a82b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-18 16:19:34 +00:00
Richard Purdie
42cc9e6c99 upstream-tracking.inc: Remove the long deprecated file
(From OE-Core rev: 22447eba250656489a6ed636fe58cb304d74e975)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-18 16:19:34 +00:00
Richard Purdie
be4d74c509 defaultsetup: Include maintainers.inc by default
There is little harm in including this file rather than having a
rather obscure and soon to be obsolete bbclass adding this information.

(From OE-Core rev: 98536be8d1a5dcf620ee6d07135f23126a09d98f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-18 16:19:34 +00:00
Robert Yang
2e8f8d7eb3 base.bbclass: Add comments for gcc links to ccache
(From OE-Core rev: ce6bf125aba7344d56368885605949e373b06393)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-15 17:10:52 +00:00
Erik Botö
217035f098 testimage: Add possibility to pass parmeters to qemu
Add a variable called TEST_QEMUPARAMS in testimage.bbclass to make it
possible to pass parameters to qemu. This can be useful for e.g.
increasing the amount of RAM available during testimage runs.

(From OE-Core rev: 1a9163f5779d233c884c8fd50e0812eabab4fdf3)

Signed-off-by: Erik Botö <erik.boto@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-15 17:10:51 +00:00
Michael Ho
bc25bb645e insane.bbclass: add package specific skips to sstate hash
The bbclass currently adds INSANE_SKIP to the sstate hash dependencies
however the package specific skips such as INSANE_SKIP_${PN} are
not added automatically because of how the class references them.

This causes the problem that modifying INSANE_SKIP_${PN} does not
invalidate the sstate cache and can mask build breaking warnings.

Add an anonymous python snippet to explicitly include these additional
relevant skips to the sstate hash.

Singed-off-by: Michael Ho <Michael.Ho@bmw.de>
(From OE-Core rev: 8690332183f10a5e5689da7ec030567dfd1ac091)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-14 17:10:58 +00:00
Michael Ho
f510f79859 cmake.bbclass: append includedir to implicit include dirs
This resolves issues with paths being marked as system includes that
differ from /usr/include but are considered implicit by the toolchain.
This enables developers to add directories to system includes
to supress compiler compiler warnings from them.

(From OE-Core rev: 9c2227d5d960f93e00791157354f0c920fbecf39)

Signed-off-by: Michael Ho <Michael.Ho@bmw.de>
Cc: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-14 17:10:58 +00:00
Khem Raj
a34555a54d insane.bbclass: BPF objects may mismatch in endianness and bitness too
This ensures that bitness and endianness is ignored for BPF objects
Fixes QA issues like

Bit size did not match (32 to 64) kernel-selftest on
/work/qemumips-yoe-linux/kernel-selftest/1.0-r0/packages-split/kernel-selftest/usr/kernel-selftest/bpf/test_btf_nokv.o

(From OE-Core rev: 26722e59ca5df14bd90fc09306d97ff0fd078f32)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-13 16:32:21 +00:00
Andrea Adami
3c6751ee7a meson.bbclass: map mips64el TARGET_ARCH to mips64 for the cross file
Meson uses 'mips64' for both big- and little-endian MIPS64 machines,
so map mips64el to mips64.

(From OE-Core rev: 8d1023f222f32ef64d37c3cb15b7dcf9c3e5990d)

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08 17:17:02 +00:00
Robert Yang
67628ea66b uboot-sign.bbclass: fix signature and deployment
Fixed:
MACHINE = "beaglebone-yocto"
KERNEL_CLASSES += "kernel-fitimage"
KERNEL_IMAGETYPE_beaglebone-yocto = "fitImage"
UBOOT_MACHINE_beaglebone-yocto = "am335x_boneblack_vboot_config"
UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000"
UBOOT_SIGN_KEYDIR = "${TOPDIR}/conf"
UBOOT_SIGN_KEYNAME = "dev"
UBOOT_SIGN_ENABLE = "1"
IMAGE_INSTALL_remove = "kernel-image-zimage"

$ cd conf
$ openssl genrsa -F4 -out dev.key 2048
$ openssl req -batch -new -x509 -key dev.key -out dev.crt
$ cd ../
$ bitbake u-boot linux-yocto
$ grep signature tmp/deploy/images/beaglebone-yocto/*.dtb
Binary file tmp/deploy/images/beaglebone-yocto/u-boot-beaglebone-yocto-2018.07-r0.dtb matches
Binary file tmp/deploy/images/beaglebone-yocto/u-boot-beaglebone-yocto.dtb matches
Binary file tmp/deploy/images/beaglebone-yocto/u-boot.dtb matches

And there would be no signature info when rebuild from sstate:
$ bitbake u-boot linux-yocto -cclean
$ bitbake u-boot linux-yocto
$ grep signature tmp/deploy/images/beaglebone-yocto/*.dtb
No result

This s because kernel directly edit ${DEPLOY_DIR_IMAGE}/u-boot.dtb, (Note, it
is global ${DEPLOY_DIR_IMAGE}, not recipe's DEPLOYDIR), so that the modified
info is not in sstate, and would be lost when rebuild from sstate.

There are other problems in previouse code:
- The u-boot.dtb is provided by u-boot, but edited by kernel during signing, so
  it should be deployed by kernel rather than u-boot.

- The u-boot.do_concat_dtb directly install files to global ${DEPLOY_DIR_IMAGE},
  this is incorrect, the ${DEPLOY_DIR_IMAGE} should be installed by do_deploy.

- It seems that it assumes do_deploy depends on do_install according the comments,
  but they have no relationships:
  # do_concat_dtb is scheduled _before_ do_install as it overwrite the
  # u-boot.bin in both DEPLOYDIR and DEPLOY_IMAGE_DIR.

- The do_concat_dtb should be run after do_compile, but it doesn't have this
  dependency.

Make u-boot install u-boot.dtb to ${datadir}, kernel copies u-boot.dtb from
${STAGING_DATADIR} to ${B} and deploy it can fix the problem.

[YOCTO #12112]

Reported-by: Christian Andersen <c.andersen@kostal.com>
(From OE-Core rev: 493f70cfb177f1d452a13329647a38642bf2b161)

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-12-08 17:17:01 +00:00
Federico Sauter
6aef6271e1 kernel: don't assign the build user/host
The KBUILD_BUILD_USER and KBUILD_BUILD_HOST variables were
assigned at the kernel class level, which made it impossible
to override them in the local configuration.

By setting only the default values of those variables in the
kernel class, it is now possible to override them as expected.

(From OE-Core rev: a3e8cdf9c3ba966fa4b5a21235540eb0b00fb487)

Signed-off-by: Federico Sauter <federico.sauter@ableton.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08 17:17:01 +00:00
Joshua Watt
0fc667d695 image-buildinfo: Remove unused function argument
Removes the listvars argument to image_buildinfo_outputvars(). It
doesn't appear that this argument ever did anything.

(From OE-Core rev: 66ff9408291f3df98e8a6cb3e6e348d7ec8f401d)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08 17:17:01 +00:00
Alex Kiernan
85bad95a08 kernel-fitimage: Replace tabs with spaces in python
Fix:

  WARNING: python should use 4 spaces indentation, but found tabs in kernel-fitimage.bbclass, line 24

(From OE-Core rev: 4ec42465e9df8cef20a97be11243726aa7dfb8c1)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08 17:17:01 +00:00
Richard Purdie
7843548285 classes: Correctly markup regex strings
There are various escape characters in these stings which python warns
about so use the correct regex markup for them.

(From OE-Core rev: 252b69c9f2abe3258366c540f56b156ed63e5437)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08 17:17:01 +00:00
Kai Kang
3a439047bf image.bbclass: respect PACKAGE_NO_GCONV
It installs locale-base-* packages according to var IMAGE_LINGUAS.
Packages locale-base-* are split in libc-package.bbclass if variable
PACKAGE_NO_GCONV is not set. When none of ditro features libc-charsets
libc-locales and libc-locale-code is set, PACKAGE_NO_GCONV is set. Then
no locale-base-* is created and fails to create image.

Clear IMAGE_LINGUAS in such situation.

(From OE-Core rev: 85240094175a8ea726bfba19c00d4556a62862fc)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05 22:30:19 +00:00
Kai Kang
7291426ed5 glibc-locale: fix installed-vs-shipped qa issue
Variable PACKAGE_NO_GCONV is set in libc-package.bbclass when none of
libc-charsets, libc-locales and libc-locale-code set in DISTRO_FEATURES.
Then it causes installed-vs-shipped qa issue of glibc-locale:

| ERROR: glibc-locale-2.28-r0 do_package: QA Issue: glibc-locale:
| Files/directories were installed but not shipped in any package:
|   /usr/share/i18n
|   /usr/share/i18n/charmaps
|   /usr/share/i18n/locales
|   /usr/share/i18n/charmaps/CP737.gz
|   ...
|   /usr/share/i18n/locales/ru_RU
|   ...
|   /usr/lib64/gconv/gconv-modules
| Please set FILES such that these items are packaged. Alternatively if they
| are unneeded, avoid installing them or delete them within do_install.
| glibc-locale: 843 installed and not shipped files. [installed-vs-shipped]

So check PACKAGE_NO_GCONV during do_install and not copy those files if
PACKAGE_NO_GCONV has been set.

Simplify call of bb.utils.contains() in libc-package.bbclass as well.

(From OE-Core rev: 39840ed10af559bbcc306b378baa4723921668f5)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05 22:30:19 +00:00
Joshua Watt
794a60191b classes/waf: Fix builds when B != S
Waf requires that the current working directory be ${S} (the location of
the wscript) when building. Most of the time, this was true only because
B defaults to S. However, anything that changed that behavior (notably,
using externalsrc) would break the recipe. Remedy this by explicitly
changing cwd to ${S} when running waf commands. As a happy side effect,
B can be set up for "out of tree" builds to keep the source directory
clean.

(From OE-Core rev: 62dffb71ce22222c635bd90eaa47dd01f70f9c0f)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05 22:30:19 +00:00
Robert Yang
eff9942d30 uboot-sign.bbclass: Remove tab indentations in python code
Use 4 spaces to replace a tab.

(From OE-Core rev: 790828a65316fee57cd7659ad8b7544de5d2610c)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05 13:04:23 +00:00
Joshua Watt
645493af37 classes/icecc.bbclass: Fix ccache disable
The ccache disable flag was misspelled, preventing it from being
disabled.

(From OE-Core rev: 33fba601a7365aced9f4b206c1fadda997076d4c)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05 12:37:02 +00:00
Ross Burton
be0b9a3a81 insane: Clarify GNU_HASH warning
We have a fatal error if ELF objects don't have GNU_HASH segments but it
doesn't explain what the problem is.  At least give a hint to users by
suggesting that LDFLAGS wasn't passed to the compiler.

(From OE-Core rev: 5d4da6713b40e10e853eb746f700096307ffe158)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05 12:37:02 +00:00
Alexander Kanavin
185f1d99fd gobject-introspection.bbclass: add libdir to XDG_DATA_DIRS
Otherwise .gir files installed in the sysroot will not be found when multilib is in use
(multilib configurations use libdir rather than datadir).

(From OE-Core rev: cfae171964ba85298d883e70635324a33b8539ac)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05 12:37:02 +00:00
Joshua Watt
9775741a20 classes/update-alternatives: Skip alternatives when disabled
Skips the update alternative steps for recipes that shouldn't have them
enabled.

Fixes errors like:

 nativesdk-bzip2-1.0.6-r5 do_package: bzip2: alternative target
 (/opt/poky/2.5+snapshot/sysroots/i686-pokysdk-mingw32/usr/bin/bunzip2
 or
 /opt/poky/2.5+snapshot/sysroots/i686-pokysdk-mingw32/usr/bin/bunzip2.bzip2)
 does not exist, skipping...

When building mingw SDKs

[YOCTO #12962]

(From OE-Core rev: d11576f569ee618a8e638eee3b1f17bf8a9d4264)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-03 12:20:01 +00:00
Douglas Royds
fa424823b6 ptest: Optionally strip build host tool info from installed files
Several packages (eg. acl, attr, openssl) install Makefiles or other build host
configuration files for ptest so that they can run `make check`, for instance.
These build host files commonly include paths and versions of build host tools,
(eg. rpm or perl) whose presence and version depends on the build host distro.

Optionally strip lines from installed PTEST_BUILD_HOST_FILES using an
extended regex pattern defined in PTEST_BUILD_HOST_PATTERN. This has no
effect on the on-target ptest.

(From OE-Core rev: a3b657470eeea9f1954bc3a3e593a5c4907b6f17)

Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-03 12:20:01 +00:00
Douglas Royds
d3d09bd064 ptest: Reproducibility: Strip build host paths from any installed Makefile
A common pattern for ptest is to install a Makefile that provides a make check
target. These generated Makefiles are normally full of build host paths, to
hosttools, and to files and scripts within the source or build tree. They also
commonly include the CFLAGS and CPPFLAGS. None of these build host paths
can possibly work on-target, so stripping them has no effect on the success of
the resulting ptests.

Stripping the HOSTTOOLS_DIR has this effect, for instance:

    -MKDIR_P = /home/douglas/workspace/upstream/build/tmp/hosttools/mkdir -p
    +MKDIR_P = mkdir -p

The curious WORKDIR/*= pattern avoids non-parseable -fdebug-prefix-map patterns
in the CFLAGS by adding an arbitrary ".", eg:

    -fdebug-prefix-map=.=/usr/src/debug/rsyslog/8.37.0-r0

In all other cases, we simply remove the WORKDIR, eg:

    CPP = arm-tait-linux-gnueabi-gcc -E --sysroot=recipe-sysroot ...

(From OE-Core rev: 137e38dbae42e9d4d413cd2f9460fb707ca77f9c)

Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-03 12:20:01 +00:00
Ross Burton
22fe4e27ec binconfig: only try to mangles files
If a file matches the glob that is an absolute symlink then sed will try to
alter files on the host, so restrict the search to just actual files.

(From OE-Core rev: 5556b5ca9efac132754bd82af52a0f68bc4ce85a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-01 11:38:37 +00:00