Commit Graph

5360 Commits

Author SHA1 Message Date
Jussi Kukkonen 0d637857f2 cve-check.bbclass: Fix dependencies
With recipe-specific sysroots the cve_check task must depend on
cve-check-tool-native:do_populate_sysroot to get the cve-check-tool
binary into the recipe sysroot.

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

(From OE-Core rev: bd60b1018bc0304bc928701e6d1090c8b1223616)

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

(From OE-Core rev: 1dc8010afd71fe46fb28bb86fb7c07a5fbd3d7cf)

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

(From OE-Core rev: 8de0c5d3bd01919e2bf0394f9c485936d6098cec)

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

(From OE-Core rev: cf94de4ddee3e5072da8608c9151301fcec02cd0)

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

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

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

(From OE-Core rev: e478550c8cd889f12e336e268e9e3b30827bf840)

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

(From OE-Core rev: 8a9f249a9166347cc0468191ce130003e3d306e1)

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

(From OE-Core rev: 4aabdddf67859cd8518e5cb672fb391c859817e0)

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

(From OE-Core rev: a667cb9ed2dceb804b85d1a024e2619bc34d2681)

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

(From OE-Core rev: c966dee6208d3b7a9fa3c1b8aa1266058dcb65ff)

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

(From OE-Core rev: 1226e2eb2678407c315befd5700e653602e616a0)

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

(From OE-Core rev: fe8268ede33a8c76492b85da0f41062f47a5279c)

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

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

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

(From OE-Core rev: fc504b6b8538453d2f058d7cc69be098f52f8091)

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

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

(From OE-Core rev: 61591fe2eea588ff92ff7f81f2ed8844617f5307)

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

(From OE-Core rev: af52d878940babb88bc8a2650e8c0115b6ccaf9f)

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

(From OE-Core rev: 4aab1b77d5f9403cbb3fae790069ef54821491fb)

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

(From OE-Core rev: 1003615b866bfe196994bdc25d305ff5eace2715)

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

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

(From OE-Core rev: a0059ebbb52c659282e355664bba1a2fa282170e)

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

Three configurations are compared here:

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

Overall build times:

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

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

However more worryingly:

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

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

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

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

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

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

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

(From OE-Core rev: 680fb343be5d0a7f9abbe9c75ca232abe5871663)

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

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

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

(From OE-Core rev: 3b0af8dc0f796345d1f1ba77ea35bbd090a5feb3)

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

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

(From OE-Core rev: a3f4e9ff55c7d9eba175e83eb6c99cf349a74432)

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

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

(From OE-Core rev: 3e02a7cda0ba70e3f9886c5cce37d71361280b11)

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

[YOCTO #10964]

(From OE-Core rev: 9923e3cdb58c2b3c54ec5fe99b2cec4cdc9fff92)

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

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

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

[YOCTO #10964]

(From OE-Core rev: 42f3026b39519ba98ae3153329622ce670d57c09)

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

(From OE-Core rev: b690b8dc634844b4f6672d524f0e6f1d86dc4e20)

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

(From OE-Core rev: 26dddb7d4a4945abaaefd460a342de6abd609594)

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

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

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

(From OE-Core rev: 87d03ffe03d6f01e360bfd51714be96e62506e0a)

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

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

[YOCTO #10964]

(From OE-Core rev: 26ad5105fc2ce03b7ee8ecc6911fd40a52bd573a)

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

(From OE-Core rev: c11fcd6fbde4a90913960b223451e0ce9e6b4b64)

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

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

(From OE-Core rev: 7d2a2160336413736dd4640f5b84ba4d74bb00f5)

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

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

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

[YOCTO #10881]

(From OE-Core rev: bfb9ea2604557804bd8c16adb57ccdd868a4020f)

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

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

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

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

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

[ YOCTO #10700 ]

(From OE-Core rev: 58a5771f20f7851816b5f39df0ada8f16438065c)

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

[ YOCTO #10960 ]

(From OE-Core rev: e6784ef0d56a1b297001bc59c0da3aecebd1c656)

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

(From OE-Core rev: 860c44435ea7cbbe3517d5ab9146213cc80fd0e7)

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

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

(From OE-Core rev: edf0830412de66eada9ef3f3947ca42e301c5377)

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

(From OE-Core rev: b3ed3a79852f85651c8fa192a8118f9904e88ef8)

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

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

(From OE-Core rev: c672753be60550b15d5d593c251b61776d5b104d)

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

(From OE-Core rev: 786368568a9525212e69f5cbf6da236f0a6be013)

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

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

(From OE-Core rev: 94245144f5cef344d90bc2a7b3267cdae9d192e4)

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

[YOCTO #10783]

(From OE-Core rev: 3983507bf859f6c3c29e9dea06ffe51f42c0759c)

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

(From OE-Core rev: d7d26488f252d60628862ee114a4404e8d6cb6f1)

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

(From OE-Core rev: 46bd7e48cb5ae654d915fa493420534219682e85)

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

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

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

(From OE-Core rev: 7656347c556915dc9acc5a2311ec4e879de6f43d)

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

(From OE-Core rev: 1cb245a99762e21a170b6a9beabb07e558424946)

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

(From OE-Core rev: 71e8c98238d627f9665faee9d7c226b9c07bd256)

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

(From OE-Core rev: 39865fdf3698a130f792d41853f9c9ca1901e335)

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

(From OE-Core rev: d04f0363a1e8ae641da3e80ffbd4c8803cb1c91a)

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

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

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

(From OE-Core rev: 4e6ee37e09c60e83c0dfd844ba9cf8a07507f099)

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

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

(From OE-Core rev: d00b95b18237b276c221b16dfc511a6da150ef06)

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

[YOCTO #10935]

(From OE-Core rev: 2e6ba167bee7c7b42b1e0e96eb5a7be2eb0fd2c0)

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

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

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

(From OE-Core rev: bba1f02cb6d80279c6fed34bb18f010aa921fc1e)

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

(From OE-Core rev: 5b84cc895500c28674d2a7b7c2dd618cf8fb30e9)

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

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

(From OE-Core rev: e47fb403c2cb472d2666ed3ba4b10933467c8c7b)

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

(From OE-Core rev: 57be81156f74666ff2ed2755f5faa48edf00e4dc)

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

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

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

(From OE-Core rev: e20343a90e401bc92167867729076d321081d120)

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

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

(From OE-Core rev: bd7d0314038a4c1a8e8c9ebdb7194f8e17db3fef)

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

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

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

(From OE-Core rev: 525bbfd08dacba84c92da0ab34310a85369526b7)

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

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

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

(From OE-Core rev: b1bab7a6eff6b195824be7d754de58c6e9ee2bfb)

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

(From OE-Core rev: ad750dd1cc9d789abe723daddd098ce41d8547f5)

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

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

(From OE-Core rev: da58e27a0f8fc8200f1953f05888834abd79c9f8)

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

(From OE-Core rev: 842ad404b36e00c89f615a3f7db4a2d30062effa)

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

(From OE-Core rev: 3f3344d1c063b0013a9ae7203bac30ab8f4ea17c)

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

[YOCTO #7887]

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

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

[YOCTO #10686]

(From OE-Core rev: 92cb884c989460563a063b29d2be8b7acd20577e)

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

[YOCTO #10234]

(From OE-Core rev: 077dc19445574457769eb4f231de97e8059cb75e)

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

[YOCTO #10234]

(From OE-Core rev: 8c7335290cb00ed0683241249297ca573ebd353a)

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

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

[YOCTO #10234]

(From OE-Core rev: 8d64ac4208e8dcb8a6fde6ea2959c9b3edfe2172)

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

[YOCTO #10234]

(From OE-Core rev: 2aa5a4954d7610f31875ba7e655f25f8892517b6)

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

[YOCTO #10231]

(From OE-Core rev: f8beaf94e943a8b20d146be47a756af312ef107c)

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

(From OE-Core rev: f099302efe8f222c3e4ae3604429f5ede4fd8c67)

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

classes/testimage: Export proxies before run tests

The TargetBuildProject based tests download archives from network.

(From OE-Core rev: e275f29de500a338a02402ecc570405309963b35)

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

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

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

(From OE-Core rev: 1c9ba4b698bab916d42b58255692a7bf3d773bbc)

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

(From OE-Core rev: 7a1ae3149965b162fb2c71fc7067e07a7a189249)

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

[YOCTO #10231]

(From OE-Core rev: bff1b66c6b88fd2d99d14cecba27ee2f7462711f)

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

[YOCTO #10231]

(From OE-Core rev: 4c0061422df472395ca0caa76ef92adb860f1167)

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

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

(From OE-Core rev: 3797cfd7473d3f9b7c0d999dcf9cd9608c8c7c6c)

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

(From OE-Core rev: 3443ff47374c7e20ea54e838609b991f3f72810e)

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

(From OE-Core rev: 9f547605d2bec282c5679fb35cd5b28a37c5a0d5)

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

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

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

Implementation details:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

(From OE-Core rev: 809746f56df4b91af014bf6a3f28997d6698ac78)

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

(From OE-Core rev: 5ecdab6c2589a83bbbc522074052ff4438782102)

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

(From OE-Core rev: 61390438aec4a1f9beb4d332821cc6cda82e0379)

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

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

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

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

Subprocess output:
<output>

which is much easier to debug from.

(From OE-Core rev: 64c8366a805e9cf0168ea2331c50c8d6a70c6dc4)

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

(From OE-Core rev: f755b07b528e828618141eda402399d791efba4a)

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

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

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

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

Subprocess output:
<output>

which is much easier to debug from.

(From OE-Core rev: 18160442869f56ee71538bc2dc60d7cb6c08c8a2)

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

(From OE-Core rev: b631fe91b3939b7981dbf62cb2fb70f7baebe403)

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

This reverts commit e30f5002c4.

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

(From OE-Core rev: 2a57e1334ff261a7ab45084be0f217e2acfe99af)

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

(From OE-Core rev: e3f5290d8deba9b7cead73b52ac45a37228fece9)

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

(From OE-Core rev: bd20404a78b258bb95df41066f844e08a21e53fa)

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

(From OE-Core rev: d4272e712fe26689f350142426c9893ffe088ddb)

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

(From OE-Core rev: d5361cc25fb7dd749e69063be48275c52462f72c)

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

(From OE-Core rev: e049427e09b51c09b55d7f1299a7b878fe21768a)

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

(From OE-Core rev: 7103447b198a12a30fdee3f789ff9e0d81534d54)

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

(From OE-Core rev: 57d63e8e89980c53f40e12ca670fc3f58f7e4c0f)

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

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

(From OE-Core rev: 0db5328ee2a80152904b9f82b738f92e9e38da55)

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

(From OE-Core rev: f3140f9c9cb8ff7ea29d0b77a9bfac419a216cf4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:50 +00:00
Richard Purdie 94a648f9f5 systemd: Add PACKAGE_WRITE_DEPS for postinst
The postinstall needs systemd-systemctl-native, mark the dependency

(From OE-Core rev: d2fb76e4aed927e9900de2e87e7e1b792bc88651)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:50 +00:00
Richard Purdie f4fb2ed60a pixbufcache: Add PACKAGE_WRITE_DEPS for postinst
The postinstall needs qemu-native and gdk-pixbuf-native, mark these dependencies

(From OE-Core rev: 334a12bb25770dfcd999a7def3612db4b6cd762a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:50 +00:00
Richard Purdie 70f4ad49a7 kernel-module-split: Add PACKAGE_WRITE_DEPS for postinst
The postinstall needs kmod-native and depmodwrapper-cross, mark these dependencies.

(From OE-Core rev: 0e4f5eb4f8443ed98d7c8aaf0b999c5618b7cf25)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:50 +00:00
Richard Purdie eae2dcd574 gtk-icon-cache: Add PACKAGE_WRITE_DEPS for postinst
gdk-pixbuf-native and gtk-icon-utils-native are needed by the postinstall
scripts so mark the dependency. The utils may be needed at icon build
time too so DEPENDS is unchanged.

(From OE-Core rev: d62e9fe21a47f5b38278a9b12b73d617c29d3c4f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:49 +00:00
Richard Purdie efd120e714 sstate: Drop the depchain isPostDep() checks
The dependencies of do_package_write_* tasks are either going to be packaging
tools needed to build the packages, or, native tools needed at postinst
time. Now we've formalised this dependency pattern, drop the hardcoded
list and work based on the rule. The package creation tools are usually
the same tools needed at rootfs/postinst time anyway so the difference is
moot.

(From OE-Core rev: 8082c6aabf838a2cc5253d2bb1bd8867f2e1ba6a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:49 +00:00
Richard Purdie bc7162a46c classes/package*: Add support for PACKAGE_WRITE_DEPS
Add a new variable to allow markup of postinstall (and preinst)
script dependnecies on native/cross tools.

If your postinstall can execute at rootfs creation time rather than on
target but depends on a native tool in order to execute, you need to
list that tool in PACKAGE_WRITE_DEPENDS.

(From OE-Core rev: aff8ca95b8303a4a2a5600c0d8ec0a50ad677258)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:49 +00:00
Jason Wessel 7085148116 Revert "kernel: Modify kernel modules installation path."
This reverts commit 0ccb2efe9837e2915c093341a662dffc1df00866.

The OVS fails to function and the kernel modules cannot be found by
any of the kernel tools such as depmod because they are installed
into the wrong directory in multilib 64bit/32bit bulids.

(From OE-Core rev: 85cec1e3df68e932c7b210956ef5f17b85f3616f)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:49 +00:00
Paul Eggleton e9d3b7dc75 Revert "classes/sstate: add a mode to error if sstate package unavailable"
It turns out that this check cannot work. We don't have the information
to know whether an sstate package is really needed at this point in the
execution, so we check the availability for things that we won't
actually end up needing later on. Thus we can't fail if some of these
aren't found or we'll get needless failures.

This check was intended to give earlier more accurate errors when sstate
artifacts failed to download, but that's not practical so we'll rely
solely on the task execution check that was added within the runqueue.

This reverts most of commit 9e711b54487c3141d7264b8cf0d74f9465020190 (we
still need to allow BB_SETSCENE_ENFORCE through from the external
environment since the eSDK relies upon that.)

(From OE-Core rev: ff29ac6901d04487312f554d9e62250a18729c6c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:49 +00:00
Paul Eggleton 785bec81ef classes/populate_sdk_ext: force a known value for TMPDIR
If TMPDIR is configured to be somewhere outside of TOPDIR (a not
uncommon configuration where you have multiple disks and space on /home
is at a premium) then our attempt to find out the location of paths
under TMPDIR by using a relative path led to horribly broken paths
ending up in the eSDK. To save pain, just force a known value for TMPDIR
(i.e. ${TOPDIR}/tmp) and then we can assume that everywhere else.

Fixes [YOCTO #10797].

(From OE-Core rev: 4fe60d526a94f30b201c434994e80fef0f7392f0)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:49 +00:00
Richard Purdie b0f70c5f9e staging: Add dependency on virtual/binutils for strip binary
The staging code strips binaries and we need virtual/binutils for that.
Add a specific dependency since the one from do_configure and others
may not be enough to ensure the binaries are in our own sysroot.

(From OE-Core rev: 9a799f70574ee8e0b1267497edfb4ac63166ef8f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:49 +00:00
Richard Purdie d80c95d53f multilib_global: Drop pointless event mask/code filtering
This code was pointless so cleanup, drop the unused event and the
filtering is no longer needed.

(From OE-Core rev: 4fd9e74035703b45a9e6e9143b1ec421e172200c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:49 +00:00
Richard Purdie 38bcf14abc sstate: Fix EXTRA_STAGING_FIXMES handling
The code wasn't working properly, tweak so that it works as expected and
the grep expression includes the right patterns. Not sure this code has ever
worked prior to this.

(From OE-Core rev: 6a46a974611c5262efefc21a11adb736c0fb206a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:49 +00:00
Patrick Ohly 90f1ef88d6 rm_work.bbclass: clean up sooner
Having do_rm_work depend on do_build had one major disadvantage:
do_build depends on the do_build of other recipes, to ensure that
runtime dependencies also get built. The effect is that when work on a
recipe is complete and it could get cleaned up, do_rm_work still
doesn't run because it waits for those other recipes, thus leading to
more temporary disk space usage than really needed.

The right solution is to inject do_rm_work before do_build and after
all tasks of the recipe. Achieving that depends on the new bitbake
bb.event.RecipeTaskPreProcess and bb.build.preceedtask().

It can't just run in an anonymous function, because other anonymous
functions that run later may add more tasks. There's still such a
potential conflict when some future RecipeTaskPreProcess event handler
also wants to change task dependencies, but that's not a problem
now. Should it ever occur, the two handlers will have to know about
each other and cooperate to resolve the conflict.

Benchmarking (see "rm_work + pybootchart enhancements" on the OE-core
mailing list) showed that builds with the modified rm_work.bbclass
were both faster (albeit not by much) and required considerably less
disk space (14230MiB instead of 18740MiB for core-image-sato).
Interestingly enough, builds with rm_work.bbclass were also faster
than those without.

(From OE-Core rev: 936179754c8d0f98e1196ddc6796fdfd72c0c3b4)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:49 +00:00
Patrick Ohly ce84432d98 rm_work_and_downloads.bbclass: more aggressively minimize disk usage
rm_work.bbclass never deletes downloaded files, even if they are not
going to be needed again during the
build. rm_work_and_downloads.bbclass is more aggressive in minimizing
the used disk space during a build, but has other disadvantages:
- sources required by different recipes need to be fetched once per
  recipe, not once per build
- incremental builds do not work reliably because sources get
  removed without ensuring that sources gets fetched again

That makes rm_work_and_downloads.bbclass useful for one-time builds in
a constrained environment (like a CI system), but not for general use.

(From OE-Core rev: ca23a07fc6677720508197f2b44573bfd6b52f28)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:48 +00:00
Patrick Ohly 3ba8917c4d rm_work.bbclass: allow preserving additional content
By default, do_rm_work either skips recipes entirely (when listed in
RM_WORK_EXCLUDE) or removes everything except for temp.

In meta-swupd, virtual image recipes collaborate on producing update
data for the base recipe. Tasks running in the base recipe need some
information from the virtual images.

Those files could be passed via a new shared work directory, but that
scatters data in even more places. It's simpler to use the normal
WORKDIR and teach rm_work.bbclass to not remove the special output
with the new RM_WORK_EXCLUDE_ITEMS.

(From OE-Core rev: 28fbb2dd17033308cc09811fbc4f43e2f6c17f54)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:48 +00:00
Mariano Lopez 81c3d4824a oeqa/utils/qemurunner.py: Be sure to stop qemu-system
When runqemu fails, qemu-system process would keep running
and won't be killed, setpgrp() was used when runqemu was
a shell script but it seems it doesn't work always with python.

This would kill qemu-system explicity and to avoid leaving
it behind.

(From OE-Core rev: 9d2b1aa1bcfb2f1933a8eeb9470b4174d5da2f0d)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19 22:47:22 +00:00
David Vincent f4fedefe49 extrausers: Use static ids when available
When creating users at the image level using extrausers class, the
current behavior is to ignore the status of USERADDEXTENSION. This could
lead to undefined behavior when static ids are expected but the system
falls back to dynamic ones.

(From OE-Core rev: 331140e892f84b70bced44a0b5d14f32ec95042e)

Signed-off-by: David Vincent <freesilicon@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19 22:47:20 +00:00
Ola Redell 47400e3648 kernel-module-split: Append KERNEL_VERSION string to kernel module name
The KERNEL_VERSION string is added to kernel module package names in order
to make the kernel modules for different kernel versions distinct packages
instead of different versions of the same package. With this change, when
a new kernel is installed together with its kernel modules (e.g. by upgrade
of the packages kernel and kernel-modules) using some package manager such
as apt-get or rpm, the kernel modules for the older kernel will not be
removed. This enables a fall back to the older kernel if the new one fails.

Also, for backwards compatibility and to enable kernel version agnostic
dependencies to kernel modules, create a virtual package with the old
(shorter) kernel module package name using RPROVIDES.

(From OE-Core rev: 78cde87bb6e71ec5b603426879267874900d09f3)

Signed-off-by: Ola Redell <ola.redell@retotech.se>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19 22:47:20 +00:00
Andreas Müller eb6bd89014 waf.bbclass: handle PACKAGECONFIG
(From OE-Core rev: 8d72bea03b3db1ddece309d1bab80f9e4c4c2d33)

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19 22:47:20 +00:00
Nathan Rossi ff14510cdf kernel-fitimage.bbclass: Check value of UBOOT_SIGN_ENABLE
Check the value of UBOOT_SIGN_ENABLE, as it is defaulted to "0" which
for matches as True in python due to being a non-empty string.

(From OE-Core rev: 35ebe793f2d933366863d17fb807b3d39f594334)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19 22:47:20 +00:00
Nathan Rossi 4c88512843 kernel-fitimage.bbclass: Don't assume KERNEL_IMAGETYPE == fitImage
The name of the output image for a fitImage that contains a ramdisk
should match the same as for the fitImage that does not contain a
ramdisk. As such it should not be assumed that KERNEL_IMAGETYPE is
"fitImage". This change explicitly sets the name of the output
ramdisk/initramfs to start with fitImage as does the non-ramdisk output.

(From OE-Core rev: 81caed2b7071ffc9ed8077d7d76952f2a2a4713d)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19 22:47:20 +00:00
Nathan Rossi 492ee05c65 kernel-fitimage.bbclass: Allow unset load/entry addresses for ramdisks
Allow the load and entry addresses to remain unset if the UBOOT_RD_*
variables are also unset for ramdisk entries in the image tree. This
allows for U-Boot to decide dynamically where to load the ramdisk.

(From OE-Core rev: 941b6ce3b297ed83f1c05dd76bfeefbf93482e6f)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19 22:47:20 +00:00
Robert Yang 28ef841440 qemuboot.bbclass: use IMGDEPLOYDIR
So that "bitbake <image> -ccleansstate" can remove qemuboot.conf

(From OE-Core rev: 0704f15d1ad7483f80ffa18fa32b6115923641cf)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19 22:47:20 +00:00
Juro Bystricky fe84f7b33e sanity.bbclass: Improved error message
When a non-existing MACHINE is specified, sanity check issues
the following message:

    Please set a valid MACHINE in your local.conf or environment

However, MACHINE can also be set in multiconfig .conf file(s).
Hence we may have several different MACHINE settings within one
(multiconfig) build, so the present error message is fairly
ambiguous.

This patch remedies this by explicitly naming the offending MACHINE and
by amending the list of places where this erroneous MACHINE definition
could have originated.

    MACHINE=xyz is invalid. Please set a valid MACHINE in your local.conf, environment or other configuration file.

[YOCTO#10810]

(From OE-Core rev: a7cb408dd784178197687a2129e936620bf6a0d3)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-17 11:31:36 +00:00
Alejandro Hernandez 928a93d516 systemd-boot.bbclass: Fix SYSYTEMD_BOOT_CFG creation
This patch makes sure the directory which will contain
the systemd configuration (loader.conf) is created before
the configuration file is written, fixing errors when it
tried to write it to a non-existent directory

(From OE-Core rev: f4ba23212c97fb8c3351a3cf981ee355ae2fc9b1)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-16 18:05:14 +00:00
Patrick Ohly 1f6e6455fe insane.bbclass: print license text as part of QA message
It it is hard to select exactly the right lines from a file, in
particular because the documentation did not specify the exact
semantic (YOCTO #10898).

When the QA license check fails, it now includes the license text for
which the md5sum was calculated. When adding a new entry to
LIC_FILES_CHKSUM, developers can then verify that they picked the
desired lines. When the checksum of an older entry changes, the developer
does not have to manually look up the changed text.

Here's an example which probably has an endline which is too large
(message triggered by changing the md5sum in the recipe):

ERROR: cmake-native-3.7.1-r0 do_populate_lic: QA Issue: cmake-native: The LIC_FILES_CHKSUM does not match for file://Source/cmake.h;beginline=1;endline=3;md5=deadbeef
cmake-native: The new md5 checksum is 4494dee184212fc89c469c3acd555a14
cmake-native: Here is the selected license text:
vvvvvvvvvvvvvvvvvvvvvvvvvvvv beginline=1 vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ endline=3 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cmake-native: Check if the license information has changed in .../cmake.h (lines 1 through to 3) to verify that the LICENSE value "BSD" remains valid [license-checksum]

The beginline/endline values are only repeated in the borders if set.

License snippets larger larger than 20 lines (configurable with
QA_MAX_LICENSE_LINES) are truncated in the middle.

(From OE-Core rev: b5b869348adc8e932eb58ecdfdff93d1d63e775c)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-16 18:05:13 +00:00
Ola x Nilsson 8a85d44ced externalsrc.bbclass: Add task buildclean
The buildclean task should call the package build system clean
command, just implemented for Make for now.

This is meant for recipes where S == B, but can be useful as a
standalone task for other recipes too.

When S == B, set it to run before do_clean which will do what most
developers expect when calling bitbake -c clean.  For S != B, do not
add it before clean as it is not needed and may take some time.

(From OE-Core rev: cfaad320d9565003e97893efcb14d00d0b8e23bb)

Signed-off-by: Ola x Nilsson <olani@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-16 18:05:13 +00:00
Amarnath Valluri 9c2158c073 kernel: Modify kernel modules installation path.
Use ${base_libdir}/modules inplace of /lib/modules for kernel modules installation path.

(From OE-Core rev: 0ccb2efe9837e2915c093341a662dffc1df00866)

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-16 18:05:12 +00:00
Patrick Ohly 753471db45 rootfs-postcommands.bbclass: sort passwd entries
The /etc passwd files in a rootfs consist of the default entries from
base-passwd plus anything that gets added via package installation,
EXTRA_USERS_PARAMS and/or system sysusers.

The execution order of preinst scripts is not perfectly deterministic,
or at least unrelated changes caused it to change in a
non-deterministic way, resulting in irrelevant changes in the order of
passwd entries.

useradd-staticids.bbclass ensures that the numeric IDs don't change,
but re-ordering can still occur, which is bad for reproducible builds
and file-based update mechanisms like swupd which work best if changes
are as minimal as possible.

To achieve that, the files get sorted in a post-processing command,
enabled by default. Sorting is based primarily on the numeric IDs, so
for example, the "root" user continues to be listed first. "nobody"
now is at the end, which wasn't the case before.

The order of the entries should not matter, but in obscure cases where
it does (like having multiple entries for the same numeric ID) this
behavior can be disabled by setting SORT_PASSWD_POSTPROCESS_COMMAND to
an empty string.

Fixes: YOCTO #10520

(From OE-Core rev: ba684f436908ac2300a00c174d5aa06b4f824367)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-16 18:05:12 +00:00
Randy Witt b138a8bba5 image_types.bbclass: IMAGE_TYPEDEP_ now adds deps for conversion types
Previously if IMAGE_TYPEDEP_* contained a conversion type of the form,
"foo.bar", the dependency on CONVERSION_DEPENDS_bar would not get added
to the task depends for do_rootfs.

[YOCTO #10883]

(From OE-Core rev: 037d39898e0e16c6d5b24a8d3844abfb328d3c14)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-16 18:05:12 +00:00
Ed Bartosh 8f38e76861 image_types.bbclass: look for wks files in <layer>/wic
Added <layer>/wic directory to the list of paths to look
for wks files. This makes wic behaviour consistent when
invoked manually and by bitbake.

(From OE-Core rev: d345985db69dc86e9a8f8e2506b250d8780374cb)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-16 18:05:11 +00:00
Alejandro Hernandez a250452f56 gummiboot: Remove old gummiboot recipe, related class and wks file
Since the gummiboot project is no longer being maintained
and we are using systemd-boot as a replacement instead,
we can now clean up all remaining gummiboot files.

[YOCTO #10332]

(From OE-Core rev: 65eb3f51b70baaf24de871301a7247d5baed00ed)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-16 18:05:11 +00:00
Alejandro Hernandez 2dce2648e3 gummiboot: Remove/change gummiboot references with systemd-boot
After systemd-boot was introduced, its been tested for a while with no major
issues being found until now, this patch completely replaces all gummiboot
instances with systemd-boot ones, taking the next step into cleaning
up systemd-boot/gummiboot.

[YOCTO #10332]

(From OE-Core rev: f9a61d3400ad9068a6d83b8eb6aefe3098c58e68)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Jochen Jaegers 8db49696e4 toaster: prevent use of unset variable BUILDSTATS_BASE
(From OE-Core rev: aca5555881edf4751540203591aadbaf3d17bf41)

Signed-off-by: Jochen Jaegers <jochen.jaegers@riedel-at.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
David Vincent fc89a3f739 classes: Fix alternatives and rc.d ordering
When using an alternative as an initscript, the ordering between
update-rc.d and update-alternatives tasks during prerm and postinst
tasks must always be the following in order to work:
  * prerm:
    - stop daemon
    - remove alternative

  * postinst:
    - add alternative
    - start daemon

This patchset adds comments to the scripts generated by both classes and
organize the generated sections based on those comments.

[YOCTO #10433]

Changes since v5:
    - Remove boolean in d.getVar() calls

(From OE-Core rev: aa87b1a4dcc14e4dfe719b6c55045c5662bc59c2)

Signed-off-by: David Vincent <freesilicon@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Ola x Nilsson 02f89167a3 externalsrc: Add optional srcdir arg to srctree_hash_files
Make it easier to reuse the function for other dirs than EXTERNALSRC.

(From OE-Core rev: 9ddcfb51e637acba82089da6430ac77e29f0f1ef)

Signed-off-by: Ola x Nilsson <ola.x.nilsson@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Ola x Nilsson 61b1e18608 externalsrc: Set STAMPCLEAN to match STAMP
Only the last stamp file should be kept, but unless STAMPCLEAN matches
files generated using STAMP old stamp files may linger.  This may
cause false positives for skipping tasks.

(From OE-Core rev: 6d60f60e38e0e00e6753f5b136277f27d6204e63)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Paul Eggleton 63e6aade78 classes/buildstats: don't expand variable pointing to SystemStats
We're placing an object into the datastore - it's very definitely not
something we want to be expanding.

(From OE-Core rev: adfee41d2b1edbd2abd09f9101c359919e21e5d6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Paul Eggleton 976373be12 classes/sstate: fix file conflict message
* Fix not decoding output from grep ("Matched in b'manifest...')
* Fix showing "Matched in b''" if no match (show "not matched to any
  task" instead)
* Drop the filtering out of .populate-sysroot from matched manifest
  names - it should have been .populate_sysroot so it doesn't work, and
  in any case the value of removing the task name is questionable given
  that we aren't removing it for any other task, and that the rest of
  the filename isn't only the task name, we might as well have the whole
  thing. At least then you can do a find on that exact name without
  wildcards and find it.
* Fix indenting of file list entries and indent "matched in" further
  underneath
* Minor punctuation fixes

(From OE-Core rev: 4675ce43496898fccbac738835d7e92b1cca648e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Paul Eggleton 3d6c667e54 classes/sstate: handle filenames containing square brackets
If a recipe installs a file or directory whose name contains square
brackets [ ] that form a valid glob expression and that file then they
won't be correctly removed from the sysroot, because we pass each path
in the sstate manifest to our oe.path.remove() function which calls
glob.glob() on the path passed into it and the expression won't
actually match the original filename. Since we don't expect to put any
wildcarded expressions in the sstate manifests, and we already have a
try...except around this, we can actually use os.remove() here instead.

Similarly, when we pass existing file paths to "grep" looking through
the manifests, we don't want those paths to be treated as regexes - so
use grep's -F command line switch.

Fixes [YOCTO #10836].

(From OE-Core rev: fd8a57861024fc82e15a2a4ec8c20ed0ebb242f6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Paul Eggleton d008867e45 classes/package_rpm: handle square brackets in filenames
When constructing a spec file we list files and directory paths in the
%files section. If ] or [ characters are in a file or directory name,
rpm treats them as wildcards which will mean it won't properly match the
filename. Instead, transform these into an ? wildcard so they don't
cause a problem.

(This fixes packaging the npm package "file-set" and anything that
happens to depend upon it, since it includes tests with files that
contain unusual characters including ] and [).

(From OE-Core rev: f95adb749619e70920c6cc6cd01c6d02cd348fd8)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Richard Purdie 022a8b58c8 meta/scripts: Various getVar/getVarFlag expansion parameter fixes
There were a few straggling expansion parameter removals left for
getVar/getVarFlag where the odd whitespace meant they were missed
on previous passes. There were also some plain broken ussages such
as:

d.getVar('ALTERNATIVE_TARGET', old_name, True)
path = d.getVar('PATH', d, True)
d.getVar('IMAGE_ROOTFS', 'True')

which I've corrected (they happend to work by luck).

(From OE-Core rev: 688f7a64917a5ce5cbe12f8e5da4d47e265d240f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
Ed Bartosh e30f5002c4 populate_sdk_ext: whitelist do_package tasks
With enabled SSTATE_MIRRORS sstate code expects mirrors to
contain entries for all tasks, which is not the case for ext
installer as it uses reduced sstate cache.

Added do_package tasks to BB_SETSCENE_ENFORCE_WHITELIST to prevent
installer failing with ERROR: Sstate artifact unavailable

[YOCTO #10832]

(From OE-Core rev: 2ed46ada4b8e496493835e84b36f7e9c367f59d2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-05 13:54:06 +00:00
Ed Bartosh 556725188f populate_sdk_ext: fix working with uninative sstate
Mapped uninative sstate directories to make ext SDK installer to
use them when it's run on systems with gcc version different from
gcc version used to build installer.

[YOCTO #10832]

(From OE-Core rev: 549df5f82c9b2d4feb6f459cb3b2f240efb9a981)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-05 13:54:06 +00:00
André Draszik 8f12a03dda module.bbclass: allow to override location of Module.symvers
Requiring all build systems for external kernel modules to
place Module.symvers directly into ${B}/. is quite an
artificial assumption/requirement. It doesn't have to end
up there, but could easily end up somewhere below ${B}.

Allow to override the location below ${B}

Note that we still don't make use of multiple
Module.symvers in case there are any generated by one
single kernel module build, but this is no change in
behaviour from before and could be added if there really
is a demand for that.

Reported-by: Denys Dmytriyenko <denis@denix.org>
(From OE-Core rev: caa0fa2ddf0c97255b38b1ec8579944ab4821ff1)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-05 13:54:06 +00:00
Ross Burton 1349320ee0 populate_sdk: don't force target debug packages into SDK
TOOLCHAIN_TARGET_TASK doesn't need to explicitly list sdk-target-dbg because if
SDKIMAGE_FEATURES contains dbg-pkgs (as it does by default) then they'll all be
installed anyway.  This means that if the user removes dbg-pkgs from
SDKIMAGE_FEATURES then the SDK correctly doesn't have debug packages in.

[ YOCTO #9078 ]

(From OE-Core rev: 4c711830ae26008f73bbf557964bdb86b8c922da)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-05 13:54:05 +00:00
Richard Purdie 04db2f5238 uninative: Parameterise the use of STAGING_DIR
This means that a user can change TMPDIR in a multiconfig situation
and still only have one path to the uninative setup. Without this change
its not possile to make such a setup work.

(From OE-Core rev: 779422c5458f5f643b3a4a0dedaa4d9ad709367a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-22 12:36:40 +00:00
Trevor Woerner d09de75601 ncurses.inc: add v6 binconfig-disabled entries
Newer host distributions are moving to ncurses6, therefore add entries so the
host's ncurses{w}6-config scripts aren't picked up.

(From OE-Core rev: 0174152272c546dd6cb6bc4b7238c232ab9133b3)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-22 08:50:17 +00:00
David Vincent de807c7820 kernel: Fix symlinks
When installing a kernel package, the symlinks created by
update-alternatives should point to a path relative to KERNEL_IMAGEDEST
and not an absolute path to '/boot'.

Failing to do so causes problems when resolving the symlink inside some
bootloaders which mount the boot partition elsewhere.

(From OE-Core rev: c7bc46b9bc29dd0953ab8d63b50fa105bb66892e)

Signed-off-by: David Vincent <freesilicon@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-22 08:50:17 +00:00
Zubair Lutfullah Kakakhel 6eb35af19a arch-mips: Add MIPS 64r6 N32 tune
Add MIPS64R6-n32 tuning options.

(From OE-Core rev: e723dbb9614f7d7e7e158bc9afd0b2bfac0fbee2)

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-22 08:50:16 +00:00
Jussi Kukkonen 041ac0f9c1 mirrors.bbclass: Fix gnutls mirror directory
(From OE-Core rev: 833f43f71b9a1665c26b6e1874546cb7d37ffd47)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-20 15:22:16 +00:00
Ross Burton 7379035e26 package: don't count every hardlink for PKGSIZE
When calculating PKGSIZE we sum the size of files after doing lstat() so we
don't count directory metadata overhead, but were not correctly handling
hardlinks.  This results in packages such as e2fsprogs-mke2fs having PKGSIZE of
1.5M when it's actually a single 300K binary with five hardlinks.

[ YOCTO #10423 ]

(From OE-Core rev: e82a7f879419828b42b5cc71e6229c8235090f21)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-17 09:57:05 +00:00
Alexander Kanavin 30fea7abda upstream-version-is-even.bbclass: exclude various alphas, betas, pre-releases etc.
Was a problem with perl in particular.

(From OE-Core rev: cc40b3ad2c4a725f93d0b984f23d34d247cffb2f)

(From OE-Core rev: 428531463574f4e7722912d1960bd288df586c14)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-17 09:57:04 +00:00
Joshua Lock 3c59b1bf93 meta: remove True option to getVarFlag calls
getVarFlag() now defaults to expanding by default, thus remove the
True option from getVarFlag() calls with a regex search and
replace.

Search made with the following regex:
getVarFlag ?\(( ?[^,()]*, ?[^,()]*), True\)

(From OE-Core rev: 2dea9e490a98377010b3d4118d054814c317a735)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Ed Bartosh c21cec8488 uninative: rebuild uninative for gcc 4.8 and 4.9
Some c++ libraries fail to build if uninative is built
with gcc 5.x and host gcc version is either 4.8 or 4.9.

The issue should be solved by making separate uninative sstate
directory structure sstate-cache/universal-<gcc version> for host gcc
versions 4.8 and 4.9. This causes rebuilds of uninative if host gcc
is either 4.8 or 4.9 and it doesn't match gcc version used to build
uninative.

[YOCTO #10441]

(From OE-Core rev: d36f41e5658bbbb6080ee833027879c119edf3e0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Jackie Huang 280c83335a extrausers.bbclass: Use PACKAGE_INSTALL instead of IMAGE_INSTALL
The initramfs image recipes changed to use PACKAGE_INSTALL
so they will not be affected by IMAGE_INSTALL, and will cause
error when inherit extrausers:

| ERROR: core-image-minimal-initramfs-1.0-r0 do_rootfs:
  core-image-minimal-initramfs: usermod command did not succeed.

So use PACKAGE_INSTALL as well in extrausers.bbclass to fix it.

(From OE-Core rev: fa541362e2d2cc0494a86a413b7b52dfe3eee908)

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:22 +00:00
Paul Eggleton 275b3fe5f4 classes/patch: move several functions to oe.patch
Move patch_path(), src_patches() and should_apply() to oe.patch, making
them easier to call from elsewhere (particularly across the
UI/server boundary).

(From OE-Core rev: 2724511e18810cc8082c1b028e3b7c8a8b5def56)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-14 12:30:50 +00:00
Paul Eggleton 45adbe3709 classes/patch: move in logic to commit for additional tasks
If PATCHTOOL is "git", and PATCH_COMMIT_FUNCTIONS is set to "1", for
additional tasks between do_unpack and do_patch, make a git commit. This
logic was previously implemented in devtool itself, but it makes more
sense for it to be implemented in the patch class since that's where the
rest of the logic is for this (or in lib/oe/patch.py). It also makes
it possible for this to work with tinfoil2.

(From OE-Core rev: f24f59ea1d8bc335ea8576f6a346d0935f4a3548)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-14 12:30:49 +00:00
Paul Eggleton 5942a8dc7c classes/base: fix license file checksumming when source not under TMPDIR
With the changes to the code for extracting source for a recipe, we are
properly executing the tasks for a recipe, which means their stamps (and
therefore signatures) are important. When running devtool extract on
the lsof recipe I noticed that do_fetch and do_unpack were executing a
second time when we called for do_patch, and this turned out to be
because LIC_FILES_CHKSUM in that recipe contains an entry which
is an absolute path (has ${S} at the start). Normally this wouldn't be
an issue since S is under TMPDIR and thus the existing code would ignore
it, however devtool's extraction code extracts to a temporary directory
which is not under TMPDIR; the result was the path to this file was not
being ignored and the second time around when the license file had been
extracted it was incorporated into the signature. We don't want this, so
explicitly exclude S as well as B and WORKDIR for good measure.

(From OE-Core rev: 1c99d74a862f25e23ea6465fab7ddc9ce74d6974)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-14 12:30:49 +00:00
Paul Eggleton af867199a5 classes/image: suppress log_check mechanism for warnings/errors logged through BitBake
If you printed a warning through bb.warn() / bbwarn or an error through
bb.error() / bberror, this was also being picked up by our log_check
mechanism that was designed to pick up warnings and errors printed by
other programs used during do_rootfs. This meant you saw not only the
warning or error itself, you saw it a second time through log_check,
which is a bit ugly. Use the just-added BB_TASK_LOGGER to access the
logger and add a handler that we can use to find out if any warning or
error we find in the logs is one we should ignore as it has already been
printed.

Fixes [YOCTO #8223].

(From OE-Core rev: fb37304d27857df3c53c0867e81fbc8899b48089)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-14 12:30:49 +00:00
Bruce Ashfield e3d51adafd kernel-yocto: explicitly trap subcommand errors
To trap errors and halt processing, do_kernel_metadata was recently
switched to exit on any non zero return code. While the concept is
sound, there are subcommands that have legitimate non-zero return
codes.

Instead of removing set +e, we'll explicitly check the return code
of the commands that can error, and throw a bbfatal to alert the
user.

(From OE-Core rev: a4705e62d0973c290011fc0d250501d358b659e8)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-13 22:55:21 +00:00
Ross Burton 7966afa64a rm_work: add do_write_qemuboot_conf to task list
We need to add do_write_qemuboot_conf to the list of tasks to be wiped as
otherwise the second time an image is built it will fail.

[ YOCTO #10758 ]

(From OE-Core rev: 3206f408e908870629eb47afac6249a3c9497a66)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-13 22:55:20 +00:00
Ross Burton 113828ff86 archiver: don't change directory when generating tarball
There's no need to chdir() as tarfile.add() can be told what name to use in the
archive.

(From OE-Core rev: d0b282bce34db44dde4dd7f53a64dfaafe6789de)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-13 22:55:20 +00:00
Ross Burton 058891183e cve-check: allow recipes to override the product name
Add a new variable CVE_PRODUCT for the product name to look up in the NVD
database.  Default this to BPN, but allow recipes such as tiff (which is libtiff
in NVD) to override it.

(From OE-Core rev: ba330051570a4c991885ee726cb187e0c911bd4f)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-13 22:55:19 +00:00
Vladimir Zapolskiy 56b4aa820c insane: Add SH4 musl mapping to the QA arch tests
This change allows to pass QA for packages built with sh4-oe-linux-musl
toolchain, the problem is reproted while building core-image-minimal target:

  ERROR: readline-7.0-r0 do_package_qa:
  Error executing a python function in exec_python_func() autogenerated

(From OE-Core rev: dff25cb16ffca0876e5a747644bd6223129df402)

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08 10:31:30 +00:00
Andreas Oberritter b4da2b0040 update-rc.d: ignore initscript in prerm and preinst when systemd is active
In hybrid systemd/sysvinit builds, if the recipe inherits systemd and systemd
is installed, we can safely assume that the service gets stopped by the prerm
script fragment from systemd.bbclass. This fixes deinstallation of packages
with initscripts returning errors when no running service was found. The preinst
shouldn't run the initscript either, because postinst will call systemctl restart.

(From OE-Core rev: f2cc0fdfd97b097145e40bc52674e17378cec863)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08 10:31:30 +00:00
Andreas Oberritter 0dffc09058 libc-package.bbclass: split binary localedata even more if asked to
If GLIBC_SPLIT_LC_PACKAGES is set to a non-zero value, convert
glibc-binary-localedata-XX-YY to be a meta package depending on
glibc-binary-localedata-XX-YY-lc-address and so on. This enables
saving quite some space if someone doesn't need LC_COLLATE for
example.

Some regex code was removed from output_locale_binary_rdepends,
because legitimize_package_name already converts to lowercase.

(From OE-Core rev: 40b4b31092058f8833ada3dfc254d362dd3139c1)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08 10:31:30 +00:00
Robert Yang 1bf8d703f4 image.bbclass: inherit image_types_uboot when needed
Fixed:
MACHINE = "qemuarm"
IMAGE_FSTYPES += "ext3.bz2.u-boot"
[snip]
No IMAGE_CMD defined for IMAGE_FSTYPES entry 'ext3.bz2.u-boot' - possibly invalid type name or missing support class
[snip]

This is because image_types_uboot is not inherited, inherit it when
needed will fix the problem.

(From OE-Core rev: 742a22ab7fd333e99d8701220d5a1db28347b1af)

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>
2016-12-08 10:31:30 +00:00
Andreas Oberritter c03d02f918 kernel.bbclass: fix kernel_do_compile for KERNEL_IMAGETYPE = "vmlinux.gz" on mips
The target directory didn't exist.

(From OE-Core rev: bd62851dc236a0279c735b290782602e275de5c1)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08 10:31:30 +00:00
Andreas Oberritter fffc641a10 kernel.bbclass: do not copy bundled initramfs to /boot
These files cause warnings because they don't get packaged, now that they
don't land in kernel-vmlinux anymore.

(From OE-Core rev: a49569e3a7534779bbe3f01a0647fd076c95798d)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08 10:31:30 +00:00
Andreas Oberritter e02affce3c kernel.bbclass: Avoid wildcards for kernel images
With multiple kernel images enabled starting with 'vmlinux', e.g.
vmlinux.gz and vmlinux.bin, all files landed inside the
kernel-vmlinux package.

On top of that, even initramfs images were included, e.g.
vmlinux.gz-initramfs-*.

(From OE-Core rev: b7f4133b44b740e8ac8e758b0d4a3ee32d326332)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08 10:31:29 +00:00
Andreas Oberritter 4cf1310051 kernel.bbclass: Use real filenames in kernel packages
When iterating over kernel image types to set up their packaging
variables, don't use make targets but the real names.

It was surprising if both vmlinux.bin and vmlinux.gz were enabled
and only the latter had its filename extension removed from the
package name.

(From OE-Core rev: aa189f183e10588f7e8d642f351bd9b8d69f3ea9)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08 10:31:29 +00:00
Andreas Oberritter 68b2a6320a kernel.bbclass: allow uncompressed initramfs archives
The code failed to copy the initramfs in case it was a plain
cpio archive.

(From OE-Core rev: 7dbdb4ea91aa027866da2bd46c65fe65a25c848f)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08 10:31:29 +00:00
Richard Purdie 53c9723ea8 staging: Drop unused SYSROOT_LOCK
This hasn't been used in years and isn't referenced anywhere, drop
the definition.

(From OE-Core rev: 68258f856f08f35813964e58ef761471e29373ad)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08 10:31:29 +00:00
Bruce Ashfield e38775a1d8 kernel-yocto: exit on non-zero return code
Historically the processing of kernel meta data contained some
commands that exited with a non-zero return code. Special processing
was required to properly deal with their exit.

That is no longer true, and instead of handling all return codes
and doing an explicit 'exit' call, we can remove set -e from the
routine and have all errors be trapped and stop processing.

(From OE-Core rev: 476ffd57cf5b6fba40d4e3f5dd913824ab8a8d3d)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-07 10:46:09 +00:00
Robert Yang e61b6e96b0 kernel.bbclass: let do_deploy depend on do_packagedata
The do_deploy runs depmodwrapper which requires
pkgdata/kernel-depmod/kernel-abiversion, which is generated by
PACKAGEFUNCS. So we need let do_deploy depend on do_packagedata.

This can fix the errors which happens sometimes when kernel upgrades:
DEBUG: Executing shell function do_deploy
Error: Kernel version 4.8.8-WR9.0.0.1_standard does not match kernel-abiversion (4.8.8-WR9.0.0.0_standard)

And we only see this error when kernel upgrades and rebuild, but doesn't
see it in a normal build, this is becuase depmodwrapper doesn't exit
error when kernel-depmod/kernel-abiversion doesn't exit, it just prints
an error which should go into log.do_deploy:
if [ ! -r /path/to/sysroots/qemux86-64/pkgdata/kernel-depmod/kernel-abiversion ]; then
    echo "Unable to read: /path/to/sysroots/qemux86-64/pkgdata/kernel-depmod/kernel-abiversion" >&2
else
    [foo]
fi

We can see that there is no "exit 1", I guess it was designed to let it
can run without kernel-abiversion

(From OE-Core rev: 64148a30397b8c92414262c0d414d103d2b97ddd)

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>
2016-12-07 10:38:06 +00:00
Patrick Ohly 25a5536a6e buildstats: record disk space usage
Hooks into the new monitordisk.py event and records the used space for
each volume. That is probably the only relevant value when it comes to
visualizing the build and recording more would only increase disk
usage.

(From OE-Core rev: 21a5b569370f47cc02291e1d8b76fe43faa04ea6)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-07 10:37:59 +00:00
Patrick Ohly 8f475b78c9 buildstats: add system state sampling
/proc/[diskstats|meminfo|stat] get sampled and written to the same
proc_<filename>.log files as during normal bootchat logging. This will
allow rendering the CPU, disk and memory usage charts.

Right now sampling happens once a second, triggered by the heartbeat
event.That produces quite a bit of data for long builds, which will be
addressed in a separate commit by storing the data in a more compact
form.

(From OE-Core rev: 6f4e8180b5b4857eaf6caf410fd3a4a41ed85930)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-07 10:37:59 +00:00
Alexander Kanavin c6bd22aee5 upstream-version-is-even.bbclass: ensure that the full version is matched.
Previously 4.3.2.1 would match as 3.2.1.

(From OE-Core rev: b066910f64ba964a8a0bb452925591eed1e16940)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:08 +00:00
Mark Asselstine 2965ccfcdb systemd.bbclass: don't block on service restart
The current class works fine when a recipe uses SYSTEMD_AUTO_ENABLE
'enable' and has no on device pkg_postinst(), ie when the postinst is
run as part of rootfs creation.  However, when there is a component of
pkg_postinst() that is run on device the 'systemctl restart' is run as
part of the run_postinsts.service at boot. This results in the boot
spinning indefinitely with:

[ *** ] A start job is running for Run pending postinsts (7s / no limit)

The issue could potentially be that the packages service has an
'After' clause which comes later in the boot, beyond
run_postinsts.service, creating a chicken before the egg
scenario. Even service files without an 'After' clause cause this
situation however. Despite this not being the cause of the issue this
fix will prevent this scenario from happenning.

Using strace we are able to find that during boot, when
run_postinsts.service is running attempting to start or restart any
service will result in the call get stuck on poll(). Since the
run_postinsts.service does not monitor the outcome of the call to
restart we can work around this by using '--no-block'.

(From OE-Core rev: 6ad6a0084a73088fc2a27ab9958e5c46d6e094fc)

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:08 +00:00
Patrick Ohly fd1b82e0bd qemuboot.bbclass: do not hook into do_rootfs
Writing qemuboot.conf in write_qemuboot_conf() does not modify the
rootfs and thus conceptually shouldn't be executed as part of rootfs
creation.

Running it as separate task is cleaner and fixes the problem of
missing qemuboot.conf files for meta-swupd virtual images; those
images replace do_rootfs and ROOTFS_POSTPROCESS_COMMANDs don't run at
all.

The task gets added such that it runs roughly at the same time as
before. Probably it doesn't actually need to depend on do_rootfs, but
this way we don't write a useless qemuboot.conf in cases where
do_rootfs fails.

(From OE-Core rev: c8260447ed115bc5be7df9b25e449a7744d9f2df)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:07 +00:00
Ross Burton bfcf8770d0 insane: rewrite the expanded-d test as a QAPKGTEST
Instead of being executed for every file in every package, this is now just
called for each package.  It is also now correctly called for packages which
don't have any content but do have postinst scripts.

[ YOCTO #10711 ]

(From OE-Core rev: afda72b2424528eaff9054327530bdf5654bec66)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:07 +00:00
Ross Burton b8f0acf70d insane: add QAPKGTEST, a package-wide equivilant to QAPATHTEST
QAPATHTEST defines a function that is executed for every file in every package.
For tests which just need to look at the datastore this is massive overkill.

Add QAPKGTEST, which is invoked for each package in the recipe.

(From OE-Core rev: acc3cc26099c77e4eeb44c75bc7167ab58ef1147)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:07 +00:00
Ross Burton 4a7a2b4777 insane: factor out the test matrix processing
Pull the test matrix processing out as a function so it can be reused.

(From OE-Core rev: 3caccd3f6079b7e284d32e1eb0217107425e7bf8)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:07 +00:00
Ross Burton 56d3c77ebe insane: fix expanded-d test
This test should be looking for the expanded value of ${D} in the expanded value
of pkg_postinst and so on, but one of the getVar() calls was passing
expand=False so the test would never be true.

(From OE-Core rev: cc545044cba51317bee32e3bf674723e422e3a8a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:07 +00:00
Alexandre Belloni 20020cb1d5 insane: Add aarch64 baremetal mappings to the QA arch test
Add mappings for aarch64-elf and aarch64_be-elf to binary lookup table
which allows for the generation of baremetal toolchains.

(From OE-Core rev: e90a1c4b8fd7baa738eb4683e5eac60905e04296)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:06 +00:00
Ross Burton ed367049e7 gnomebase: remove gnome-common-native DEPENDS
gnome-common is deprecated upstream and an increasingly smaller fraction of
GNOME packages still use it.  To avoid adding it redundantly to DEPENDS, remove
it from the class.

(From OE-Core rev: 1d18c2b7bfaed77b30e02d14ae581d920e4eb446)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:06 +00:00
Ross Burton 71b7c3a88e Revert "classes/populate_sdk_ext: require uninative"
The change to move C++ ABI tweaks to bitbake.conf should make this redundant, so
revert it.

This reverts commit c56cd49a12.

(From OE-Core rev: af280990bff4a484fd8a18e3442b56a0a39b7611)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-28 15:49:15 +00:00
Ross Burton 5fd4cada2e conf: add C++ flags for uninative interoperatility
Create a common include file for compiler flags which allow native binaries to
be interoperable on a wide range of hosts. In particular the C++ ABI is
problematic so choose the CXX11 version to allow interoperation between gcc4 and
gcc5 based hosts. Moving this to a common include instead of uninative.bbclass
allows uninative to be configured later and used in the eSDK (where its
mandatory) even if the base configuration doesn't enable uninative by default
(e.g. nodistro in OE-Core).

[ YOCTO #10645 ]

(From OE-Core rev: 60c912ae9306532bdd4c5e09a65863ee77c12f43)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-28 15:49:15 +00:00
Leonardo Sandoval eab4aaa074 buildstats: Place 'Elapsed Time' stat into a single line
All lines except one (the one containing the 'Elapsed Time') follows the format
'stat: value'. Fix that so post parsing the stats is simpler.

(From OE-Core rev: 47dfd172754440a7ab28eb1b59d9bd484cdad22a)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 11:10:14 +00:00
Stephano Cetola 93e8db2224 devshell: list commands when throwing NoSupportedTerminals
When attempting to run devshell, if no terminal is available, the
error being thrown was not very specific. This adds a list of
commands that failed, informing the user of what they can install to
fix the error.

[ YOCTO #10472]

(From OE-Core rev: c077f4aab2fc956408d4ad45c4e2e2ea6e480624)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 11:10:13 +00:00
Robert Yang 67e8ffcfa6 sanity.bbclass: fix check_connectivity() for BB_NO_NETWORK = "0"
The old code:
network_enabled = not d.getVar('BB_NO_NETWORK', True)

It is True only when BB_NO_NETWORK is not set (None),
but BB_NO_NETWORK = "0" should also be True while "1" means no network,
"0" means need network in a normal case.

(From OE-Core rev: 3d8db6cb992f96023a0486f64fe6b0f1ead04184)

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>
2016-11-23 11:10:13 +00:00
Robert Yang d755f0721a sanity.bbclass:check_connectivity(): print more error messages
This can help fix the problem when the error happens.

Now the error message is:
    Fetcher failure for URL: 'https://www.example.com/'. URL https://www.example.com/ doesn't work.
    Please ensure your host's network is configured correctly,
    or set BB_NO_NETWORK = "1" to disable network access if
    all required sources are on local disk.

(From OE-Core rev: 0b31a03c59efea3a8742762772e39dcbd6f8ed25)

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>
2016-11-23 11:10:13 +00:00
Robert Yang ddfc3afced testsdk.bbclass: print which file is not found
This is helpful when debug.

(From OE-Core rev: eef945787b5717bbb5d3bbddc446d4da86e3eb62)

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>
2016-11-23 11:10:13 +00:00
Robert Yang 37da91e4fc populate_sdk_ext.bbclass: use weak assignment for TOOLCHAINEXT_OUTPUTNAME
The TOOLCHAINEXT_OUTPUTNAME is different from TOOLCHAIN_OUTPUTNAME, it
is used for eSDK only, so that it doesn't mix with SDK, use "?=" for it
so that other conf file can define it.

If we don't use "?=" here, then we need use forcevariable to redfine it:
TOOLCHAINEXT_OUTPUTNAME_forcevariable = "foo"

(From OE-Core rev: 933539a07af3f1cca79e49b0ea92cb7699095f96)

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>
2016-11-23 11:10:13 +00:00
Paul Eggleton 55a157f4e6 devtool: update-recipe: fix handling of compressed local patches
It is possible to use gzip or bzip2 to compress patches and still refer
to them in compressed form in the SRC_URI value within a recipe. If you
run "devtool modify" on such a recipe, make changes to the commit for
the patch and then run devtool update-recipe, we need to correctly
associate the commit back to the compressed patch file and re-compress
the patch, neither of which we were doing previously.

Additionally, add an oe-selftest test to ensure this doesn't regress in
future.

Fixes [YOCTO #8278].

(From OE-Core rev: e47d21624dfec6f71742b837e91da553f18a28c5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 11:10:13 +00:00
Khem Raj 47594d59ec cmake.bbclass: Set CXXFLAGS and CFLAGS
We strip the TOOLCHAIN_OPTIONS and HOST_CC_ARCH from CC/CXX in cmake.bbclass
whereas CFLAFS and CXXFLAGS assume that TOOLCHAIN_OPTIONS are
part of CC/CXX variables, this causes compile failures when cmake
is running compiler tests during configure on some architectures
especially armhf, because hf ABI information -mfloat-abi is part
of TOOLCHAIN_OPTIONS, so what happens is that testcase gets compiled
without hard-float, howver, during linking the float ABI option
is passed via LDFLAGS, now linker rejects this and fails like
/mnt/a/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/6.2.0/ld: error: cmTC_27947 uses VFP register arguments, CMakeFiles/cmTC_27947.dir/src.cxx.o does not
mnt/a/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/6.2.0/ld: failed to merge target specific data of file CMakeFiles/cmTC_27947.dir/src.cxx.o
collect2: error: ld returned 1 exit status

This means that CMake now fails the configure time test too
which is not right, e.g. it might disable features which actually do exist
and should be enabled e.g. in case above it is resulting as below

Performing C++ SOURCE FILE Test HAS_BUILTIN_SYNC_SUB_AND_FETCH failed with the following output:

Its actually a bug in CMake see
https://gitlab.kitware.com/cmake/cmake/issues/16421

CMake is ignoring CMAKE_CXX_FLAGS when using CHECK_CXX_SOURCE_COMPILES
function.

Until it is fixed upstream, we add HOST_CC_ARCH and TOOLCHAIN_OPTIONS
to CFLAGS and CXXFLAGS, so that we can ensure that compiler invocation
remains consistent.

(From OE-Core rev: 826f3cdb474b5728b22f08d2342fc90235ca9e7d)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 11:10:12 +00:00
Linus Wallgren 69a8784b79 systemd: Reload configuration on package install
When a systemd service file has changed it is required to reload
systemd's configuration. Otherwise changes to a service file will not be
picked up during package upgrade.

(From OE-Core rev: 94efe6d1d7893e241bcf98eff80ac8d8fbf2e885)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 11:10:12 +00:00
Richard Purdie 3ef7cf5297 binconfig: Use d.getVar
The bb.data API is deprecated, use d.getVar instead.

(From OE-Core rev: 3246319233fd111d42e0a2c2b0d6983a604d5b81)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 10:59:56 +00:00
Markus Lehtonen 62b521722a sanity.bbclass: fix logging of an error
Fixes a crash in exception handler. All bb logging functions need an
string instances as arguments.

(From OE-Core rev: a675b2c89e477af088faee9b3be96eae19a85f0b)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-15 15:19:55 +00:00
Robert Yang 16011c5d4f populate_sdk_ext.bbclass: check unfsd before create it
Fixed when nativesdk-unfs3 is installed:
$ bitbake <image> -c populate_sdk_ext
| Traceback (most recent call last):
|   File "/path/to/oe-core/scripts/lnr", line 21, in <module>
|     os.symlink(target, linkname)
| FileExistsError: [Errno 17] File exists: '../../../../tmp/sysroots/x86_64-linux/usr/bin/unfsd' -> '/path/to/9.0/sysroots/x86_64-wrlinuxsdk-linux/usr/bin/unfsd'

(From OE-Core rev: a400c130037497f08a1645984129c5ddba76c031)

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>
2016-11-15 15:19:54 +00:00
André Draszik fe5c48dddf cve-check.bbclass: CVE-2014-2524 / readline v5.2
Contrary to the CVE report, the vulnerable trace functions
don't exist in readline v5.2 (which we keep for GPLv2+
purposes), they were added in readline v6.0 only - let's
whitelist that CVE in order to avoid false positives.

See also the discussion in
 https://patchwork.openembedded.org/patch/81765/

(From OE-Core rev: b881a288eec598002685f68da80a24e0478fa496)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Reviewed-by: Lukasz Nowak <lnowak@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-15 15:19:54 +00:00
Richard Purdie 21a5e74eb5 chrpath: Remove standard search paths from RPATHS
(From OE-Core rev: 6b94569d5d8e8bdd575d12e260abf10d3ac11cfd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-15 15:19:53 +00:00
André Draszik ba011f588b image-buildinfo: treat staged changes as modified branch, too
When staging changes in a layer using git add, image-buildinfo
doesn't detect this as a modification, because of the way it
uses git diff.

Surely, merely staging, but not committing changes to git
should not result in image-buildhistory assuming that the
git repository hasn't been modified compared to the branch
HEAD, this state should be treated similarly to modifications
being unstaged.

We have to use both, git diff and git diff --cached to get the
desired result.

(From OE-Core rev: b46906889665f6ab72bccee608276646cda50140)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Reported-by: Lukasz Nowak <lnowak@tycoint.com>
Reviewed-by: Lukasz Nowak <lnowak@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-15 15:19:53 +00:00
Alexander Kanavin eb345ca720 populate_sdk_base.bbclass: add documentation packages to SDKs if api-documentation is in DISTRO_FEATURES
(From OE-Core rev: d2b7b3fca328449cd87997be7f897b59433a153d)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-06 23:35:36 +00:00
Ross Burton e35775c598 classes/license: copy licenses even if there are no checksummed files
Previously do_populate_lic would bail writing the license files (such as the MIT
license text) to deploy/licenses/${PN}/ if there were no files listed in
LIC_FILES_CHKSUM.  In general this isn't a problem since LIC_FILES_CHKSUM was
effectively a required field, and for packages which don't have traditional
content was generally set to a separate license such as
${COREBASE}/meta/COPYING.MIT.

However LIC_FILES_CHKSUM is now only required if there are sources in SRC_URI,
so oe-core b18fa5f removed these now redundant values. The unexpected side
effect of this is that that recipes that generate their content (such as
os-release) or are otherwise "interesting" (such as perf) don't have their
license files copied over, resulting in warnings from do_rootfs.

Resolve this by not returning early if LIC_FILES_CHKSUM is empty, and always
copy the references license files.

(From OE-Core rev: 94f5ac0651249cb98fb8d1308b7c0d10605d5a1e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-06 23:35:36 +00:00
Paul Eggleton c56cd49a12 classes/populate_sdk_ext: require uninative
It seems that possibly due to OE-Core commit
ac59063bee0e32d0737340974f657341717a6abe, binaries produced without
uninative aren't compatible with the uninative glibc. I did try earlier
to ensure that the eSDK could work without uninative since the default
configuration in OE-Core does not enable it, but it seems like I didn't
go far enough. Given the practical considerations, just give up and
require uninative to be enabled in order to build the eSDK. I'm not
particularly happy about this, but I don't seem much of an alternative.

Fixes [YOCTO #10566].

(From OE-Core rev: b59eee7bebd413c7abe5626f69508e1fe47dd0ac)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-06 23:35:35 +00:00
Paul Eggleton b95bd4ebe3 classes/populate_sdk_ext: prevent invalid TEMPLATECONF entering eSDK
If you are using a repository which contains a .templateconf file that
sets TEMPLATECONF to point into a layer it contains, but you aren't
using that layer in your bblayers.conf, the eSDK would produce an error
during the preparation step of the installation. An example would be
using the poky repository but setting DISTRO to your own custom distro
and removing meta-poky from your bblayers.conf. The eSDK doesn't
support creating new build directories, so we don't care about the
templates and can thus force a known good value to prevent this from
happening.

Fixes [YOCTO #10568].

(From OE-Core rev: 5ee32191a18013061dfa72e64713a94c5d321496)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-06 23:35:35 +00:00
Christopher Larson 46af847aed texinfo.bbclass: use dummy dep for libtool-cross
The class clearly intends build tools to depend upon the dummy texinfo, but it
does so using the class-cross override for cross recipes, and libtool-cross
doesn't inherit cross. Add a special case to cover this.

(From OE-Core rev: 26343dc11725c4c15b78b8d45ff7d2fb8d35ef6e)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-06 23:35:35 +00:00
Robert P. J. Day 12809c8283 testsdk.bbclass: Clean up comments, clarify image choices.
Make it clear that SDK testing can use any valid image.

(From OE-Core rev: d190c69347921a626665a53469dcf99b3c86994b)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-06 23:35:34 +00:00
Robert Yang 970436f546 insane.bbclass:buildpaths: open() file with 'rb'
open() is default to 'rt' which may cause decoding errors when open
binary file:
$ bitbake xcursor-transparent-theme
[snip]
Exception: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfd in position 18: invalid start byte
[snip]

(From OE-Core rev: ddbab61f47efd9b4fde38ef8f0f3482c78abe37c)

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>
2016-11-06 23:35:33 +00:00
Paul Eggleton 2b1cbb43ae classes/nativesdk: set SDK_OLDEST_KERNEL appropriately
SDK_OLDEST_KERNEL currently only controls the check on SDK installation,
however as with OLDEST_KERNEL it should be controlling the OLDEST_KERNEL
value for building glibc used in the SDK. Thus, set it in
nativesdk.bbclass. This means we need to move the default to
bitbake.conf so that it can be seen in both places.

Also set a more reasonable default for SDK_OLDEST_KERNEL for x86/x86-64 as
glibc 2.24 still supports back to 2.6.32 there and there are still
people wanting to build SDKs that will install on older distros (e.g.
CentOS 6). However it's not possible to set this with overrides since
there aren't any for the SDK_ARCH, however we can instead set the variable
from conf files in conf/machine-sdk especially as there is now a soft
default for SDKMACHINE.

Fixes [YOCTO #10561].

(From OE-Core rev: 42d5781e31c5bf76b5b7e27abed4f6f3fd65bf40)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-06 23:35:33 +00:00
Paul Eggleton 8381bb0b5f classes/populate_sdk_base: fix usage of & character in SDK_TITLE
If you used an & character in SDK_TITLE (possibly indirectly from
DISTRO_NAME) then sed interpreted this as a directive to paste in the
replaced string (@SDK_TITLE@ in this case). Escape any & characters in
SDK_TITLE to avoid that.

(From OE-Core rev: acb85689c13cfdac21435509001048af5c3a7e99)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-06 23:35:33 +00:00
George McCollister 3d4c896b2a uboot-sign: fix do_concat_dtb for .img, .rom
Now that out of tree building is enabled, ${B} must be used instead of
${S} as the path for UBOOT_BINARY.

(From OE-Core rev: 1fe17c52e4d7ce1b9d69aaa2cd9d4b351a4b2603)

Signed-off-by: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-06 23:35:32 +00:00
Nathan Rossi 25f9530f78 qemuboot.bbclass: Setup the vardeps for write_qemuboot_conf
Setting up the vardeps on write_qemuboot_conf forces the updating of
variables in qemuboot.conf when machine/deploy configuration changes.
This is particularly useful when developing or setting up the qemuboot
(e.g.  changing QB_* variables) for new targets or when changing
deployment variables (e.g. KERNEL_IMAGETYPE).

(From OE-Core rev: c568f6ce06512a108cada5c7100eb1f6de73f2ff)

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-06 23:35:32 +00:00
Paul Eggleton ebe531b38b classes/npm: use npm install to do installation
Using "npm install" instead of "cp -a" is the more correct thing to be
doing here, and ensures that symlinks for executable scripts are put
into ${prefix}/bin. (I'd prefer ${bindir}, but npm does not allow
specifying paths at that level - only a prefix.)

Fixes [YOCTO #10460].

(From OE-Core rev: 90cb980a1c49de99a0aec00c0cd5fc1e165490a7)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-06 23:35:32 +00:00
Paul Eggleton 6879d524c1 classes/license: fix handling of symlinks pointed to in LIC_FILES_CHKSUM
If you set LIC_FILES_CHKSUM to point to a relative symlink then you'll
get "Could not copy license file" warnings in copy_license_files() since
the symlink won't be valid after it's copied. If the source is a symlink
then we need to dereference it first.

I encountered this when I used recipetool on the sources for capnproto,
where the c++ directory contains a LICENSE.txt symlink to the LICENSE
file in the parent directory, and this symlink ends up being pointed to
in LIC_FILES_CHKSUM.

(From OE-Core rev: c4d3b1e9c37b920444e53d3231552da18d101882)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-06 23:35:32 +00:00
Richard Purdie 71c8376116 rm_work: Ensure we don't remove sigbasedata files
We don't remove sigdata files, we also shouldn't remove sigbasedata files
as this hinders debugging.

(From OE-Core rev: 988349f90c8dc5498b1f08f71e99b13e928a0fd0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-04 12:50:55 +00:00
Richard Purdie f6b0c60664 sstate: Ensure we don't remove sigbasedata files
We don't remove sigdata files, we also shouldn't remove sigbasedata files
as this hinders debugging.

(From OE-Core rev: 1ebd85f8dfe45b92c0137547c05e013e340f9cec)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-04 12:50:55 +00:00
Mikko Ylinen 661c855fd2 useradd-staticids.bbclass: catch missing uid/gid exceptions
The change to get rid of FuncFailed exceptions changed the behavior
of how missing uid/gid error are be handled. Instead of catching
the exception and handling that via bb.parse.SkipPackage(), a fatal
error was called.

This won't work with recipes that are unused and therefore do not have
UID/GIDs defined. The problem triggers when parsing all recipes (e.g.,
oe-selftest runs bitbake -p).

The right way to handle this is to raise bb.parse.SkipPackage(). This
will error correctly once the recipe is needed.

(From OE-Core rev: 55384cfc743a12a78bef736ee08ed453b6a6a21e)

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-28 16:15:20 +01:00
Alexander Kanavin 1ae7b2e8ab manpages.bbclass: add a class
This class enables 'manpages' feature in packages if 'api-documentation'
is in distro features. This ensures that manpages are always built
and installed when API documentation feature is enabled.

(From OE-Core rev: 1587777f1c54137eb3dacbeb427d2f6814af1713)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-28 16:15:19 +01:00
Vesa Jääskeläinen 28832af7bb image_types: Add support for lzo compressed initial ramdisk
(From OE-Core rev: 881347f6169890c63eab30017b9d63a67600439e)

Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-28 16:15:18 +01:00
Vesa Jääskeläinen 9664e41ff9 image_types: Add support to compress initramfs with lz4
Changed to use lz4 as lz4c seems to be deprecated.

Removed use of redirection in favor of using output file.

As Linux kernel supports only legacy format for initial ramdisk add
COMPRESS_CMD_lz4_legacy mode in case some users are using newer format.

(From OE-Core rev: 0ce5ccc7ec81a1e875c025fa0b384afdbe77fa45)

Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-28 16:15:18 +01:00
Christopher Larson d0b0cf6cff buildhistory: fix latest_srcrev in the common case
buildhistory was writing srcrevs.values() as SRCREV when only one
srcrev/branch exists. This returns a view of the dictionary values in python
3, and used to return a list in python 2, neither of which is an appropriate
value for SRCREV. It was resulting in latest_srcrev files like this:

    # SRCREV = "346584bf6e38232be8773c24fd7dedcbd7b3d9ed"
    SRCREV = "dict_values(['346584bf6e38232be8773c24fd7dedcbd7b3d9ed'])"

Which in turn would result in invalid output in buildhistory-collect-srcrevs.
Fix by calling `next(iter())` on the `.values()`

(From OE-Core rev: ef826a395612400924bbe49859d256b237ff59e1)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-28 16:15:18 +01:00
Saul Wold 30d1af89ce image_types: Use softer setting of WKS_FILE
This will allow for more flexibility and overrides in BSP
layers.

(From OE-Core rev: 1886ab2f1dc1e3b5758a85604998e8deb9198f5e)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-25 17:58:59 +01:00
Mikko Ylinen 952a47b42c buildstats: check IMAGE_ROOTFS exists before checking its size
After 0d6b7276003f1afabc6de683f663540327d52bdc, the exceptions are
correctly checked if the rootfs size check fails. In case of a
failure a build error is triggered.

However, there are cases where this is known to fail (e.g.,
with meta-swupd the rootfs for swupd images is other than IMAGE_ROOTFS).

Because of that, check IMAGE_ROOTFS exists before trying to get the
size of it. Also, in case of any error catched as err, simply print
out a warning.

(From OE-Core rev: b4929542ff01a24bea5edd1c40e3174f55e213ff)

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-25 17:51:19 +01:00
Robert Yang 901e632a49 insane.bbclass: fix package_qa_check_arch() for mips64-o32
Fixed:
MACHINE = "qemumips64"
DEFAULTTUNE = "mips64-o32"

$ bitbake linux-yocto
ERROR: linux-yocto-4.8+gitAUTOINC+03bf3dd731_674818dad5-r0 do_package_qa: QA Issue: Bit size did not match (32 to 64) linux-yocto on
    /work/qemumips64-poky-linux/linux-yocto/4.8+gitAUTOINC+03bf3dd731_674818dad5-r0/packages-split/kernel-module-parport/lib/modules/4.8.0-yocto-standard/kernel/drivers/parport/parport.ko [arch]

The mips64-n32 works since it would set ABIEXTENSION to "n32" so that
TARGET_OS is linux-gnun32, and it will skip the check, but "mips64-o32"
doesn't set ABIEXTENSION to "o32", "n32" or "32", so the error happend.

Skip the check if mips64.*32 matches DEFAULTTUNE can fix the problem.
Another way to fix the problem is define ABIEXTENSION to "o32" or "32"
for mips64-o32, but that may make things confused since "o32" is purely
32 bit.

[YOCTO #10305]

(From OE-Core rev: 4e61d8d6f4619dbfaeb5ca642449de7cf4b3e92d)

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>
2016-10-15 10:01:44 +01:00
Ross Burton b2726f7515 populate_sdk_ext: explicitly set DL_DIR
The eSDK generation assumes that DL_DIR is downloads/ under the build directory,
and puts files such as a freshly buily uninative tarball in there expecting
bitbake will find it later.

Whilst ${TOPDIR}/downloads/ is in fact the default value for DL_DIR in
bitbake.conf, and any instances of DL_DIR are removed from the original
local.conf, there is still the possibility that other layers could contain a
site.conf that assigns DL_DIR.

If this happens the errors are quite mysterious as it fails to find the
uninative tarball and so the hashes all change, and eSDK building fails.

Ensure that this cannot happen by explicitly assigning the DL_DIR that we
require, instead of assuming that the default value will be used.

[ YOCTO #10439 ]

(From OE-Core rev: bc2e6f5eab47e869dbc4a3eacfe759b9b1cacaee)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-15 10:01:43 +01:00
Martin Jansa 704c8b825b live-vm-common.bbclass: Allow to use different kernel image than KERNEL_IMAGETYPE for /vmlinuz
* syslinux config hardcodes kernel image as /vmlinuz add warning message
  when the selected image doesn't exist and allow to select different image
  with VM_DEFAULT_KERNEL variable (qemuboot.bbclass is using QB_DEFAULT_KERNEL)

(From OE-Core rev: e6b21d1b3716ee6f4aec1674e56f06b2963a7968)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-15 10:01:43 +01:00
Ed Bartosh 65eb5144f5 image_types.bbclass: add dependency do_image_wic -> do_bootimg
To produce certain types of images wic uses do_bootimg results
to assemble final image. For example, it copies BOOT/EFI directory
produced by do_bootimg to boot partition for every EFI image.

The tricky part of this is that do_bootimg task is not always run,
so we can't always make do_image_wic depend on do_bootimg. We only
need to do it if do_bootimg present in task graph.

Thank to Cristopher Larson for this fix.

(From OE-Core rev: 1a961b4becf677c9eb07c5b24a8ddb75044663d1)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-15 10:01:43 +01:00
Robert Yang 49d189e241 package_tar: avoid chdir warnings and restore cwd after packaging
Fixed:
WARNING: attr-2.4.47-r0 do_package_write_tar: Task do_package_tar changed cwd to /path/to/attr/2.4.47-r0/packages-split/attr-locale-sv

(From OE-Core rev: 3753d07c9ff33b9a97aca61ad312b0e283c4c68d)

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>
2016-10-15 10:01:43 +01:00
Juro Bystricky a35493d0fc insane.bbclass: Additional "mips" and "mipsel" machine definitions
Add "mips" and "mipsel" to "machdata" table.
Although there is a way to add entries to the "machdata" table
from a BSP without modifying the insane.bbclass directly, MIPS is
already supported in poky and as such the relevant entries should be
present in insane.bbclass.

(From OE-Core rev: 3ba03d1affa6f647e9a03c8ba4389606a0da8e8b)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-15 10:01:43 +01:00
Juro Bystricky ca3c782964 kernel-arch.bbclass: Add xtensa and arc into valid_archs table
Both "arc" and "xtensa" are valid Linux architectures, add
them into valid_archs table.

(From OE-Core rev: 20d511cd1b7fe4891f7842be12f13a92da433c46)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-15 10:01:43 +01:00
Ross Burton 7c32a77cac pixbufcache: handle gdk-pixbuf not being present
It's possible - albeit unlikely - that gdk-pixbuf isn't present in the sysroot
when a recipe inheriting this class is and the sysroot is finalised.

One example would be if the sstate archive has librsvg but not gdk-pixbuf:
librsvg will be extracted from the sstate but gdk-pixbuf will be built to "fill
in the gap".  In this situation the setscene completion hook installed by
pixbufcache.bbclass will attempt to execute gdk-pixbuf-query-loaders, but that
binary hasn't been installed by gdk-pixbuf yet.

Also add gdk-pixbuf-native to DEPENDS in native builds to ensure that the
binaries we expect will be present, as it's possible to build loaders without
linking to GdkPixbuf.

[ YOCTO #10420 ]

(From OE-Core rev: 03cdb3366ded46cd760656e4cda0be37c1f82109)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-15 10:01:42 +01:00
Joshua Lock 751cb2c894 Remove RM_OLD_IMAGE, it's no longer useful
Since the move to put image deployment under sstate control in
d54339d4b1a7e884de636f6325ca60409ebd95ff old images are automatically
removed before a new image is deployed (the default behaviour of the
sstate logic).

RM_OLD_IMAGE is therefore no longer required to provide this
behaviour, remove the variable and its users.

(From OE-Core rev: 93631befe8b962bf99524746b49f4ebca336175c)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-15 10:01:42 +01:00
Paul Eggleton f7259298a2 classes/externalsrc: re-run do_configure when configure files change
If the user modifies files such as CMakeLists.txt in the case of cmake,
we want do_configure to re-run so that those changes can take effect. In
order to accomplish that, have a variable CONFIGURE_FILES which
specifies a list of files that will be put into do_configure's checksum
(either full paths, or just filenames which will be searched for in the
entire source tree). CONFIGURE_FILES then just needs to be set
appropriately depending on what do_configure is doing; for now I've set
this for autotools and cmake which are the most common cases.

Fixes [YOCTO #7617].

(From OE-Core rev: 923fc20c2862a6d75f949082c9f6532ab7e2d2cd)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-11 23:04:44 +01:00
Markus Lehtonen 83e4e27246 update-rc.d.bbclass: ignore init script return code
We need to ignore the return code from the init script 'stop' command in
the preinst and prerm scriptlets. Otherwise package upgrade or
deinstallation (at least when opkg is used) is likely to fail if the
daemon is not running. That is because an init script possibly returns
'1' if you try to stop a service that is not running which, in turn,
causes the scriptlet to fail which, in turn, causes the package
(de-)installation to fail.

[YOCTO #10299]

(From OE-Core rev: daa3c266a7ffa060b52381fa00df518102fceda8)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-11 22:19:21 +01:00
Ross Burton a003a929d0 insane: display names instead of ELF machine numbers
The 'arch' QA test currently simply outputs the ELF machine field as a number
which isn't helpful.  Display this as a human-readable name to make it clearer
to the user what the problem is.

(From OE-Core rev: 607a2a1de4b77818c3e801a4de7ff0888229e036)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-11 22:19:21 +01:00
Saul Wold 45f7221915 archiver: fix gcc-source handling
The source archiver was not handling the gcc-source target correctly, since it uses the
work-shared directory, we don't want to unpack and patch it twice, just as the comments
say, but the code was not there to check for the gcc-source target.

[YOCTO #10265]

(From OE-Core rev: bbac0699ceadb7a25a60643fb23dffce8b4d23d0)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-11 08:31:41 +01:00
Joshua Lock 9489382b6a testimage: disable build tests for qemumips and qemumips64
It's not uncommon for qemumips[64] builds on the Yocto Project
autobuilder to fail during Sanity Tests after a very long timeout
period. This is due to the MIPS emulation in QEMU being slow and
some of the build tests taking a very long time on MIPS machines.

This patch works around this slowness by disabling the more
complex build tests for QEMU MIPS machines.

[YOCTO #10340]

(From OE-Core rev: 4a1c04c0d509b2cda9b2ccd5a80523c05fa279c6)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-09 12:31:40 +01:00
Markus Lehtonen ac647ea696 update-rc.d.bbclass: check that init script is executable before running it
Check that the init script that is going to be called in the prerm()
script really exists and is executable. There might be a packaging bug
or the script might've been removed already earlier in prerm().

[YOCTO #10299]

(From OE-Core rev: aabb87c9dbd60fe9467ca0354ec05c275a3f1b1a)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:53:18 +01:00
Paul Eggleton 35362715b1 classes/populate_sdk_ext: add symlinks and unfsd to support Eclipse plugin
The Yocto Project Eclipse plugin requires that runqemu and unfsd are
accessible within the SDK, and indeed the standard SDK has these. This
turns out to be fairly easy to do - we just need to add unfsd and symlink
it, runqemu and a few other scripts into the SDK's bin directory.

Fixes [YOCTO #10214].

(From OE-Core rev: 9007e0e3fce7e09b043fead54b17f69c1661d162)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:52:54 +01:00
Fabio Berton 7df195106c classes/uboot-extlinux-config: Add class
This class allow the extlinux.conf generation for U-Boot use.
The U-Boot support for it is given to allow the Generic Distribution
Configuration specification use by OpenEmbedded-based products.

This class can be inherited by u-boot recipes to create extlinux.conf
and boot using menu options.

U-boot with extlinux support is machine dependent, so to use this class
you need to set UBOOT_EXTLINUX to 1 in machine configuration file and
also set root= kernel cmdline UBOOT_EXTLINUX_ROOT. This variable is used
to pass root kernel cmdline, e.g:

UBOOT_EXTLINUX_ROOT = "root=/dev/mmcblk2p2"

(From OE-Core rev: 7c18abeb2a6ef8b7bb53aa92a9ee76bd465fada2)

Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:58 +01:00
Mark Hatle 1ddd23c542 linuxloader.bbclass: Adjust mips to cover all mips/mips64
[YOCTO #10389]

Use a glob (*) to match all mips (not previously matched).  This will ensure
that the linuxloader is properly returned for mips, mipsel, mips64,
mips64el and their n32 variants.

See: https://sourceware.org/glibc/wiki/ABIList#mips for the official list
of loaders.

(From OE-Core rev: b90d68fda3d14b4d19b7ffcb5b80ed28563a616d)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:58 +01:00
Zubair Lutfullah Kakakhel 80a4239674 siteinfo.bbclass: Add mipsisa{32, 64}r6{el, } support
Add support for MIPS Release 6 ISA

(From OE-Core rev: fcb67508be00cdd22181d6c9e4c3d29dfa578b45)

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:57 +01:00
Zubair Lutfullah Kakakhel 8535ed9867 linuxloader.bbclass: Add mipsisa{32, 64}r6{el, } support
Add support for MIPS Release 6 ISA. The loader is located at a
new place for multiarch.

For more details, check https://wiki.debian.org/Multiarch
and https://sourceware.org/glibc/wiki/ABIList#mips

(From OE-Core rev: 27537d146f3f143b06819102c348c8914287ec8e)

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:57 +01:00
Zubair Lutfullah Kakakhel ba8bfee0b6 libc-package.bbclass: Add mipsisa{32, 64}r6{el, } support
Add support for MIPS Release 6 ISA

(From OE-Core rev: 8e098ddb656d39c56427ad45e0fa429b8f0153f5)

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:57 +01:00
Zubair Lutfullah Kakakhel caf7e849c9 kernel-arch.bbclass: Add mipsisa{32, 64}r6{el, } support
Add support for MIPS Release 6 ISA

(From OE-Core rev: aecb57f2fd65a1bfbc2e9a23fba4984d44055c4c)

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:57 +01:00
Zubair Lutfullah Kakakhel 4ec02b3e54 insane.bbclass: Add mipsisa{32, 64}r6{el, }
Add support for MIPS release 6 of the ISA

(From OE-Core rev: 6613ee0155de1e0afd30cd8d8290eda3f7486337)

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:57 +01:00
Stephano Cetola ef7828c9f2 utils.bbclass: add function to check for git config user
If attempting to patch a git repo without a proper git config setup,
an error will occur saying user.name/user.email are needed by git
am/apply. After some code was removed from kernel-yocto, it was
simple enough to reproduce this error by creating a kernel patch and
using a container to build.

This patch abstracts out functionality that existed in buildhistory
for use in other classes. It also adds a call to this functionality
to the kernel-yocto class.

Fixes [YOCTO #10346]

introduced in OE-core revision
0f698dfd1c8bbc0d53ae7977e26685a7a3df52a3

(From OE-Core rev: 25b43cb05c645e43f96bc18906441b8fdc272228)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-07 16:43:57 +01:00
Martin Jansa 35ca6add0f icecc.bbclass: replace os.popen with subprocess.check_output
* otherwise there is a lot of warnings about missing close on file descriptor

(From OE-Core rev: 629ff6eb58ddad2d533cbcc8b1a4594d3c8fd441)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-06 07:51:01 +01:00
Peter Kjellerstedt 79286b497a populate_sdk_base.bbclass: Make do_populate_sdk depend on PACKAGE_EXCLUDE_COMPLEMENTARY
(From OE-Core rev: 06c732bb8e2896d789716e7f0635aac9ff3a2d42)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-06 07:51:00 +01:00
Peter Kjellerstedt 27d947c184 image.bbclass: Make do_rootfs depend on PACKAGE_EXCLUDE_COMPLEMENTARY
(From OE-Core rev: 7294c550eb3c7e31f8b80c7055aa84945c75c7f1)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-06 07:51:00 +01:00
Aníbal Limón f205384495 classes/sstate.bbclass: Enable thread lock when checkstatus
The checkstatus function fires an event to notify bitbake UI about
the progress of the task, this function is implemented using ThreadPool
and is causing event lose when multiple threads tries to fire an event
(writes over socket/fd).

[YOCTO #10330]

(From OE-Core rev: 6e0bb9d141438c0051c32b0d3a247915b71ccb82)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-05 10:10:11 +01:00
Ulf Magnusson 56be38f834 testimage.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 5f8eb6726a492d259bfe25b0bbce2333c9505504)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:05 +01:00
Ulf Magnusson 4768cd6519 utility-tasks.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: de45a7e302fe5a2a08baf26c91e2c788d7285263)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:05 +01:00
Ulf Magnusson 4dbb0d73dd package.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 8443b6f3f25181f5ac49bc25a1387cd05b814376)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:05 +01:00
Ulf Magnusson 4c25460c5a libc-package.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 5369bb7fa6238cc85f0b5263519974c1a2d9eea8)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:05 +01:00
Ulf Magnusson c5823be186 testsdk.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 086240468265dc15c5b4cdb2594d5aa7c3114dda)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:05 +01:00
Ulf Magnusson fe7a7836ed chrpath.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 20e669f56489b2c8a9bc6a0e6f3eac81ef35445a)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:05 +01:00
Ulf Magnusson 39f80cefcc sstate.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 33611b69c221cf875eba1c7cb599c256825ae470)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ulf Magnusson db6ae52544 useradd.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 21969c3d1397e0a11a8cb9dad8ce3469ee655f57)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ulf Magnusson fadc4fc746 gtk-immodules-cache.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 11a2f932073635f9680470cd69216cecf7ed0c37)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ulf Magnusson 823acf8037 systemd.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 8e956d66087b9c41591b8e4e817ed6c9e42f5981)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ulf Magnusson 0aaa51e1e5 license.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 8e9255763674703ea16651da64fe794e5359f16e)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ulf Magnusson 7f22c97be3 update-rc.d.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: a77b4e543407eee133fbd38ac9b69e90bea541e0)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ulf Magnusson f13bd4b8e4 gummiboot.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: f7c82acbac583c7838550175796a7aa697a5c7e0)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ulf Magnusson d11b51dfad systemd-boot.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: c61d7a01c89f0d25d069191cc47d6768bee2ce48)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ulf Magnusson 46398106ef syslinux.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: cca772ecf0adafbd767974add27ada125aae5269)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ulf Magnusson 103ab2d810 grub-efi.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 48c4faa1d7117732974e51428f7ed2f62ad7e7bf)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ulf Magnusson 255f260675 useradd-staticids.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: e507cb978fd52164beb28324933cb3d5e368c3ab)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ulf Magnusson fc3dc09732 package_rpm.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: f0561ba205723fd7f05c28d501c2c517034b326c)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ulf Magnusson c7d522c717 package_deb.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 5a074e8a26d27ea9c4f31e2b75b2b14f6e0641d3)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ulf Magnusson 9efdd605c9 package_ipk.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 01e3ac73860a24710852383a15bb5d01db13de57)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ulf Magnusson 4359ef0895 base.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 9635af9785509a39c1ac2509740d46276119a0ca)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ross Burton 922a745993 classes/native: set lt_cv_sys_lib_dlsearch_path_spec
This variable is used by libtool to know what paths are on the default loader
search path.  As we have modified loader paths, native.bbclass can tell libtool
that both the sysroot libdir and the host library paths are searched, so no
RPATHs for those will be generated.

(From OE-Core rev: 2d0a1b029447842a6f97f72ae636c9020c4206a9)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Ross Burton 87acbfe903 classes/cross: set lt_cv_sys_lib_dlsearch_path_spec
This variable is used by libtool to know what paths are on the default loader
search path.  As we have modified loader paths, cross.bbclass can tell libtool
that both the sysroot libdir and the host library paths are searched, so no
RPATHs for those will be generated.

(From OE-Core rev: 5b61324fa76b27bb6ce13e78b17e767eed2f8f57)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Richard Purdie a9b3a6dade allarch: Fixes to stop rebuilds when change multilibs
When changing multilibs, allarch recipes should not be rebuilding. This
adds enough variable exclusions to make this work properly. Future
regressions will be prevented with new testing.

(From OE-Core rev: ce1e7fcc60276040477c1d5e3129e029bb9f204b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-01 21:45:57 +01:00
Richard Purdie d36c7036a2 nativesdk: Don't enable MULTILIBS
package_write_rpm references the MULTILIBS variable and the checksums
of nativesdk recipes were changing as a result of this.

We don't need/want MULTILIBS values for nativesdk so disable this.

(From OE-Core rev: 738ff6bc72533bbdeb58425b20b0bfbeff280a04)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-01 21:45:57 +01:00
Stephano Cetola 5d96223e31 subprocess: remove Popen in favor of check_output
This begins moving away from the deprecated subprocess calls in an
effort to eventually move to some more global abstraction using the run
convenience method provided in python 3.5.

[ YOCTO #9342 ]

(From OE-Core rev: 0d6b7276003f1afabc6de683f663540327d52bdc)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-01 21:45:56 +01:00
Raymond Tan 14cdcbcba5 grub-efi.bbclass: Add a space between root and append parameter
Add a space between the root and append parameter, similar to
syslinux.bbclass, in creating the final grub.cfg.

Without this, the final kernel boot parameters will concatenate into
strings like root=/dev/ram0console=ttyS0...

(From OE-Core rev: a3b271ec8e1b2758e1e619e76646d22fd5777ce3)

Signed-off-by: Raymond Tan <raymond.tan@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-01 21:45:56 +01:00
Joshua Lock debb7bb86f multilib_header: avoid sstate checksum issues for -nativesdk recipes
Much as with -native recipes, as addressed in commit
b15730caf0, arch specific variables
like MIPSPKGSFX_ABI were affecting -nativesdk sstate checksums for
recipes like nativesdk-glibc-initial.

Disable multilib_header for nativesdk as we don't use multilibs in
this scenario.

[YOCTO #10320]

(From OE-Core rev: f1c7b4f16dc9a7e5155108641fed8b3d98c931f3)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-01 21:45:56 +01:00
André Draszik a3e5ebea34 image-buildinfo: restore trailing newline
The last line in the generated /etc/build doesn't end
with a newline anymore, restore it.

(From OE-Core rev: afbd3917061212558ccacda129eff516b735e5b1)

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-01 21:45:55 +01:00
Richard Purdie b6253350fb cross-canadian/libgcc-common: Fixes for arm multilib
Arm is unusual in that we force it to "linux-gnueabi" and "linux" doesn't
build. This was causing problems for multilib configurations which were assuming
"linux" was the default compiler rather than linux-gnueabi.

This change does two things, ensures symlinks are generated for linux-gnueabi
and also adapts the libgcc code to account for the difference on arm.

It still needs to immediately expand/save TARGET_VENDOR but we defer
deciding what TARGET_OS should be until we know TARGET_ARCH (which the
multilib code may change).

[YOCTO #8642]

Note that sanity tests of a 32 bit arm multilib still break due to issues
with the kernel headers on a mixed bit system. This looks to be a general
headers issue for the platform though and a different type of bug.

(From OE-Core rev: bcddc3e7eff138add031bc9c9728be5a42fa62ef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-30 16:51:15 +01:00
Martin Jansa b8f5fdacae qemuboot: don't fail when QB_DEFAULT_KERNEL isn't symlink
* in some cases we might set QB_DEFAULT_KERNEL to the real filename
  instead of symlink and then this whole readlink work around actually
  breaks the build, because os.readlink fails on normal files:

  >>> os.readlink('deploy/images/qemux86/bzImage-linux-yocto-qemux86-master-20160927084848.bin')
  'bzImage-linux-yocto-qemux86.bin'
  >>> os.readlink('deploy/images/qemux86/bzImage-linux-yocto-qemux86.bin')
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  OSError: [Errno 22] Invalid argument: '/jenkins/mjansa/build-starfish-master-mcf/BUILD/deploy/images/qemux86/bzImage-linux-yocto-qemux86.bin'

(From OE-Core rev: a11d0d8641b7dfb05c78645cf21f2c04a08c4822)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-30 16:51:15 +01:00
Ioan-Adrian Ratiu 93d4250c2b populate_sdk_base.bbclass: fix broken variables
This function never worked because the SDK_OUTPUT and SDKPATH vars are
written bash-style in a python function. The only reason it never failed
a build is because the function bails out the start because of the flag
CHECK_SDK_SYSROOTS.

And I guess nobody tested with CHECK_SDK_SYSROOTS enabled until now.

(From OE-Core rev: 9f60dfdaaa74b90ebcfcdd9f3817c62a56243e92)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:04 +01:00
Ed Bartosh 390140e7b9 image_types.bbclass: remove redundant dependency
Removed parted-native dependency from do_image_wic as it's
already mentioned in IMAGE_DEPENDS_wic variable.

Thanks to Christopher Larson for pointing out to this.

(From OE-Core rev: 82353471ccaae59967df7f14de0b4065cbc8169a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:04 +01:00
Juro Bystricky cf882b6e3a SDK: Allow changing SDKMACHINE without wiping TMP folder
When changing SDKMACHINE, we may encounter an error forcing us to wipe the TMP folder.
Since only SDK_ARCH is captured in the PN of the crosssdk recipes, changes to SDK_OS
result in conflicts. Eventually we hit the error:

ERROR: ...: The recipe <...>  is trying to install files into a shared area when those files already exist.
The build has stopped as continuing in this scenario WILL break things

This patchset addresses the problem by SDK_SYS as the recipe name suffix instead
of SDK_ARCH.

[YOCTO #9281]

(From OE-Core rev: d2eccccb70e809d482c493922f23aef4409cfd82)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:03 +01:00
Patrick Ohly b5a00339d9 archive.bbclass: fix do_ar_original archiving of multiple source repos
When a recipe uses more than one source which isn't a plain file (for
example, multiple git repos), then do_ar_original created the source
archives using the same filename and thus only archived one source.

The "name" parameter is used as file suffix to create unique names for
each source, leading to archives following this pattern:
deploy/${TARGET_SYS}/${PF}/${PF}[-<name>].tar.gz.

The ${PF} part is a bit redundant, which may or may not be
desirable. The patch is more localized this way (no need to modify
create_tarball()).

For example, meta-oic's iotivity_1.1.1.bb uses:

   url_iotivity = "git://github.com/iotivity/iotivity.git"
   branch_iotivity = "1.1-rel"
   SRC_URI = "${url_iotivity};destsuffix=${S};branch=${branch_iotivity};protocol=http;"

   url_tinycbor = "git://github.com/01org/tinycbor.git"
   SRC_URI += "${url_tinycbor};name=tinycbor;destsuffix=${S}/extlibs/tinycbor/tinycbor;protocol=http"

   url_hippomocks = "git://github.com/dascandy/hippomocks.git"
   SRC_URI += "${url_hippomocks};name=hippomocks;destsuffix=${S}/extlibs/hippomocks-master;protocol=http"
   SRC_URI += "file://hippomocks_mips_patch"

   url_gtest = "http://pkgs.fedoraproject.org/repo/pkgs/gtest/gtest-1.7.0.zip/2d6ec8ccdf5c46b05ba54a9fd1d130d7/gtest-1.7.0.zip"
   SRC_URI += "${url_gtest};name=gtest;subdir=${BP}/extlibs/gtest"

   url_sqlite = "http://www.sqlite.org/2015/sqlite-amalgamation-3081101.zip"
   SRC_URI += "${url_sqlite};name=sqlite3;subdir=${BP}/extlibs/sqlite3;unpack=false"

These now get archived in deploy/sources/*/iotivity-1.1.1-r2/ as:

gtest-1.7.0.zip                      iotivity-1.1.1-r2-recipe.tar.gz    sqlite-amalgamation-3081101.zip
hippomocks_mips_patch                iotivity-1.1.1-r2.tar.gz
iotivity-1.1.1-r2-hippomocks.tar.gz  iotivity-1.1.1-r2-tinycbor.tar.gz

(From OE-Core rev: 5c63ffc706c0fff8cfb797a238f4f0e73ee2813d)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:03 +01:00
Patrick Ohly 58866d6e9a archiver.bbclass: ignore unpack sub-directories in do_ar_original
Support for absolute paths in the "subdir" parameter was recently
added (bitbake rev: c3873346c6fa). The git fetcher has supported
absolute paths in "destsuffix" already before.

When the path is absolute as in destsuffix=${S}/foobar, the tmpdir
used by do_ar_original gets ignored, which breaks:
- source code archiving (tmpdir is empty)
- compilation due to race conditions (for example, ${S} getting
  modified by do_ar_original while do_compile runs)

To solve this, these parameters get removed from URLs before
instantiating the fetcher for them.

This is done unconditionally also for relative paths, because these
paths are not useful when archiving the original source (upstream
source does not have them, they only get used by the recipe during
compilation).

(From OE-Core rev: c27c464e267db3f4b08cbd966412d19b0e756d28)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:03 +01:00
Richard Purdie 153da94000 utils: Add all_multilib_tune_list function
Its useful to be able to query a list of variables to obtain the values
in each multilib context. This adds such a function which works even
if called in the non-default recipe context.

(From OE-Core rev: 4202a09dece07c0d3f654c2b1ae504a031b4ee90)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:03 +01:00
Markus Lehtonen 7ff051c2fb autotools.bbclass: use python3 instead of python (v2)
(From OE-Core rev: 97b21645fdcdb39a58546b5f4d763b920fe5fbd6)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-28 10:16:02 +01:00
Otavio Salvador 18afc88038 qemu.bbclass: Allow use different QEMU binary depending of target
There are architectures which support running in 32 and 64 bit
flavours however the simulation is provided in a specific QEMU
setting, requiring us to use a different binary. This patch allow this
to be done using, for example:

QEMU_TARGET_BINARY_ppce5500 = "qemu-ppc64abi32"

(From OE-Core rev: 9b6d414fd27932ed1325de54e8e867c75b340e3d)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-24 07:30:10 +01:00
Andreas Müller f82cc4b768 scons.bbclass: rework parameters for install task
Fixes:

* During install all files were recompiled -> redurced build time
* For some recipes we found lot of links to build host image path

(From OE-Core rev: 3d1d287785c388bebba2ba1f2d8f843a5c6a2417)

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-24 07:30:10 +01:00
Mariano Lopez 659fab4291 testimage.bbclass: Add package manager dependency
The feature to install packages in the target requires to
build the package manager. It would fail, with very obtuse
errors, if a test requires to install something and the
package manager hasn't been build. This will add the package
manager as dependency for testimage.

[YOCTO #10260]

(From OE-Core rev: cf548fd85297585cc5688eda45ee332200bbd4b7)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-23 14:56:39 +01:00
Joshua Lock cb1ffb835f toolchain-scripts-base: add base class for toolchain_create_sdk_version
We use toolchain_create_sdk_version() in buildtools-tarball but
don't want the extra classes toolchain-scripts pulls in, therefore
split out a separate base class for this function which both
toolchain-scripts and the buildtools-tarball can inherit.

(From OE-Core rev: a398dfa654dc035c404fc12279fac9edf6403e11)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-23 14:56:39 +01:00
Richard Purdie 7358cbf36b base.bbclass: Drop unnecessary dirs setting
${D} is listed in cleandirs so no need to list it in dirs as well.
The default directory is ${B} so this is a cleanup which should have
no changes to the execution.

[YOCTO #10017]

(From OE-Core rev: 7e0f95bf359bc3b5bb1578024a993e184de155cd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-22 11:13:24 +01:00
Richard Purdie 577ff4e3dd autotools/siteinfo: Tweak CONFIG_SITE handling for determism/races
As things stand there are multiple races in the CONFIG_SITE handling
where checksums can change depending on whether site directories
exist or not when parsing happens. This is bad.

Secondly, there is a build race that occurs if you build virtuals
in parallel with the "main" recipe, since the main recipe is parsed
when the virtual is (since it sets variables like BBCLASSEXTEND)
and with the current code, it may look for files and directories
which could be created/destroyed which the loop is executing. This
is also bad.

The aclocal-copy directory should only ever be accessed by the call
from autotools.bbclass. This changes the parameter name to make it
clear and ensures all callers have the right usage, neatly avoiding
all the problems above. Also added better comments.

(From OE-Core rev: 3207244004c612c1a0e13921251003e5e635d1b1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-22 11:13:24 +01:00
California Sullivan 0eacf03de1 kernel.bbclass: Add kernel_version_sanity_check function
The kernel being built should match what the recipe claims it is
building. This function ensures that happens by comparing the version
information in the kernel's Makefile to the PV the recipe is using.

v2 changes:
* Match against PV instead of LINUX_VERSION
* Match against EXTRAVERSION as well (e.g., -rc4)
* Cleaned up version string building

Fixes [YOCTO #6767].

(From OE-Core rev: ec467cfaea5c8cf22c61daa8845c2e4e96449512)

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-21 21:58:05 +01:00