Commit Graph

3561 Commits

Author SHA1 Message Date
Richard Purdie 2cbab459e4 uninative: Add uninative - a way of reusing native/cross over multiple distros
These patches are the start of a new idea, a way of allowing a single set of
cross/native sstate to work over mutliple distros, even old ones.

The assumption is that our own C library is basically up to date. We build
and share a small tarball (~2MB) of a prebuilt copy of this along with a
patchelf binary (which sadly is C++ based so libstdc++ is in there). This
tarball can be generated from our usual SDK generation process through
the supplied recipe, uninative-tarball.

At the start of the build, if its not been extracted into the sysroot, this
tarball is extracted there and configured for the specified path.

When we install binaries from a "uninative" sstate feed, we change the
dynamic loader to point at this dynamic loader and C librbary. This works
exactly the same way as our relocatable SDK does. The only real difference
is a switch to use patchelf, so even if the interpreter section is too small,
it can still adjust the binary.

Right now this implements a working proof of concept. If you build the tarball
and place it at the head of the tree (in COREBASE), you can run a build from
sstate and successfully build packages and construct images.

There is some improvement needed, its hardcoded for x86_64 right now, its trivial
to add 32 bit support too. The tarball isn't fetched right now, there is just a
harcoded path assumption and there is no error handling. I haven't figured
out the best delivery mechanism for that yet. BuildStarted is probably not
the right event to hook on either.

I've merged this to illustrate how with a small change, we might make the
native/cross sstate much more reusable and hence improve the accessibility
of lower overhead builds. With this change, its possible the Yocto Project may
be able to support a configured sstate mirror out the box. This also has
positive implications for our developer workflow/SDK improvements.

(From OE-Core rev: e66c96ae9c7ba21ebd04a4807390f0031238a85a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-23 20:31:18 +01:00
Carlos Rafael Giani 5ceb02d694 kernel.bbclass: use one package split for all firmware filename extensions
(From OE-Core rev: dd5313228879487ca2b11fc5d38fb821a2a810a5)

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-22 13:04:23 +01:00
Richard Purdie 955bf632a7 populate_sdk_base/meta-environment: Remove overlap from the two
Currently we have the horrible situation where meta-environment packages
the toolchain environment files and they get included in the SDK but are
broken, then, the SDK code overwrites them with good versions. This is
suboptimal.

This change fixes the code in meta-environment to create working
files and adds in the multilib support from populate_sdk_base, then
we remove the code in that base bbclass and rely on the packages
being installed if/as/when needed. This removes the duplication
and the broken versions of the files, hopefully making all well.

[YOCTO #6608]
[YOCTO #6613]

(From OE-Core rev: 063355e5965439c7b3253d692d7ab0ed1189d123)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-22 13:04:23 +01:00
Philip Balister 3e6df77b23 cmake.bbclass : Add support for cmake projects that use .S files.
UHD and GNU radio use the cmake build system. The toolchain file made
from cmake.bbclass does not set the variable needs by cmake projects
that use .S files. UHD added some .S files and these changes are required
to build recent UHD.

(From OE-Core rev: 43ce4b804d433662fe77c6f5298060ba74a0e639)

Signed-off-by: Philip Balister <philip@balister.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-22 13:04:21 +01:00
Hongxu Jia 7450ba4053 sstate: set SIGGEN_LOCKEDSIGS_CHECK_LEVEL default to error
(From OE-Core rev: 65020364bd089afbb83cd216e7ae2f837077bfc5)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-17 22:00:26 +01:00
Richard Purdie c5cc4993f0 sstatesig/sstate: Add support for locked down sstate cache usage
I've been giving things some thought, specifically why sstate doesn't
get used more and why we have people requesting external toolchains. I'm
guessing the issue is that people don't like how often sstate can change
and the lack of an easy way to lock it down.

Locking it down is actually quite easy so patch implements some basics
of how you can do this (for example to a specific toolchain). With an
addition like this to local.conf (or wherever):

SIGGEN_LOCKEDSIGS = "\
gcc-cross:do_populate_sysroot:a8d91b35b98e1494957a2ddaf4598956 \
eglibc:do_populate_sysroot:13e8c68553dc61f9d67564f13b9b2d67 \
eglibc:do_packagedata:bfca0db1782c719d373f8636282596ee \
gcc-cross:do_packagedata:4b601ff4f67601395ee49c46701122f6 \
"

the code at the end of the email will force the hashes to those values
for the recipes mentioned. The system would then find and use those
specific objects from the sstate cache instead of trying to build
anything.

Obviously this is a little simplistic, you might need to put an override
against this to only apply those revisions for a specific architecture
for example. You'd also probably want to put code in the sstate hash
validation code to ensure it really did install these from sstate since
if it didn't you'd want to abort the build.

This patch also implements support to add to bitbake -S which dumps the
locked sstate checksums for each task into a ready prepared include file
locked-sigs.inc (currently placed into cwd). There is a function,
bb.parse.siggen.dump_lockedsigs() which can be called to trigger the
same functionality from task space.

A warning is added to sstate.bbclass through a call back into the siggen
class to warn if objects are not used from the locked cache. The
SIGGEN_ENFORCE_LOCKEDSIGS variable controls whether this is just a warning
or a fatal error.

A script is provided to generate sstate directory from a locked-sigs file.

(From OE-Core rev: 7e14784f2493a19c6bfe3ec3f05a5cf9797a2f22)

(From OE-Core rev: 884d4fa3e77cf32836f14a113c11489076f4a84d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-17 22:00:25 +01:00
Robert Yang 563ea5b3d9 sstate.bbclass: fix sstate_hardcode_path()
The "grep -e (x|y)" doesn't work, for example:
$ echo xy | grep -e '(x|y)'
No output

We can use "grep -E" (extended regexp) or "grep -e x -e y" to fix it.
It only affected the cross recipes.

(From OE-Core rev: 62722de6d0ec00608eacc2cb0396362aced00047)

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>
2014-09-16 22:13:52 +01:00
Richard Purdie 40e1c38dbf license: Improve disk usage
Currently copies of the license files are made which wastes disk space
and adversely affects performance. We can link these instead in most
cases for small performance gains.

(From OE-Core rev: 0b0f3631fd22f731b6aeedb73965e367b695028b)

(From OE-Core rev: fe00d4f479c4fb5e4be5dda616a4de0a257ef6c3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-16 22:13:51 +01:00
Richard Purdie 57edf5991a sstate: Fix incorrect return value handling
The use of [ and && here means $? is reset and the exit 1 error
interception wasn't working, leading to "file changed as we read it"
errors from sstate_create_package when heavily using hardlinks.

Fix this by placing $? into a variable.

(From OE-Core rev: 6e51f900b76b06c09a3d6927f8db7398e2c035ed)

(From OE-Core rev: 75040a098e11927e6872e3a2a6286fe3ed0c7f47)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-16 22:13:51 +01:00
Paul Eggleton 429802fe66 classes/populate_sdk_base: enable adding custom commands to SDK install script
Add an SDK_POST_INSTALL_COMMAND variable which allows additional
commands to be added towards the end of the SDK install script, for e.g.
additional processing that needs to be done as part of installing the
SDK.

(From OE-Core rev: 10df0718d6a626d99beb68cde8d914ee0820d7eb)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-11 18:02:55 +01:00
Otavio Salvador c2c8c0283f packagegroup.bbclass: Use immediate expanded PACKAGE_ARCH value
When the PACKAGE_ARCH is dependant of a override, the expanding is
done too late triggering the false-positive error of wrong inclusion
order.

To fix this we use immediate expansion operator to evaluate the
PACKAGE_ARCH value in order to choose to load 'allarch' class or not.

(From OE-Core rev: 2c9b1d304daade7b0907320aeb9c522e7ab9dcab)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-10 15:38:57 +01:00
Carlos Rafael Giani 3a7769329e kernel.bbclass: handle .dsp firmware
A few firmware files use this filename extension, like korg/k1212.dsp .
Create respective packages.

(From OE-Core rev: 4a4877c2e7cdcb8a1d0a54add600c0cd4e92e647)

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-10 15:38:54 +01:00
Paul Eggleton a41d97a23b classes/buildhistory: fix for sstate class change
SSTATEPOSTINSTFUNCS is now set with = in sstate.bbclass, and because
the line here in buildhistory.bbclass ends up being parsed before that
we now need to use _append or the value we are adding will be wiped out.
This fixes buildhistory no longer recording package information since
OE-Core revision 9d659c6f20fa4a141b491c62a3ef0dfb1f896d9c.

(From OE-Core rev: b5c05b474554925524073023f3aac2532c87537f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-10 13:52:31 +01:00
Martin Jansa 7efad8a1b5 qemu.bbclass: add -r ${OLDEST_KERNEL} parameter
* in some cases (e.g. with external toolchain which doesn't respect our
  reasonably old version set in OLDEST_KERNEL) it's possible to have libc
  which requires newer kernel than what we have on builders, qemu supports
  -r param to use different uname than what's returned by host system.
* change qemu_run_binary to pass -r ${OLDEST_KERNEL} and add the same to
  QEMU_OPTIONS which are used by qemuwrapper-cross
* maybe we should eventually convert all qemu_run_binary usages always include
  qemuwrapper-cross dependency and always call qemu through that (it
  seems very strange that qemu_target_binary is called from qemuwrapper
  and for allarch recipes it can return qemu-allarch as qemu binary).

  qemu_run_binary is used by:
  meta/classes/gtk-immodules-cache.bbclass:            ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-$maj_ver.0')} \
  meta/classes/qemu.bbclass:def qemu_run_binary(data, rootfs_path, binary):
  meta/recipes-core/systemd/systemd_213.bb:         ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \
  meta/recipes-graphics/pango/pango.inc:    ${@qemu_run_binary(d, '$D','${bindir}/${MLPREFIX}pango-querymodules')} \

  and qemuwrapper directly by:
  scripts/postinst-intercepts/update_font_cache:PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir}\
  scripts/postinst-intercepts/update_pixbuf_cache:PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir}\

(From OE-Core rev: 1f0bff320077f4d9f2ee51096a1438e8cae9dd0d)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
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>
2014-09-10 11:33:25 +01:00
Hongxu Jia 5f26c0292b sstate: Add extra intercept functions SSTATEPOSTCREATEFUNCS
In some cases we do either need to add extra sstate manipulation
functions, or change the existing modification functions. This patch
parametrizes it to SSTATEPOSTCREATEFUNCS after sstate_create_package

(From OE-Core rev: ed5fb9c69fcf0f6e8e98f72ac753c66119468ea5)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
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>
2014-09-10 11:33:23 +01:00
Robert Yang 60bfdb0f19 insane.bbclass: add QA check: file-rdeps
The ipk or deb can't depend on file such as "/bin/bash" or
"/usr/bin/perl", so it knows nothing about the pkg depends bash or perl,
thus there would be dependencies problems when we run "apt-get
install/remove <pkg>" on the target, this check can help us find the
issues and then fix them manually.

* Benefits:
  - Help to fix file rdepends issues for ipk and deb
  - Help to fix abnormal rdepends.
  - Help to check whether the rdepends is OK or not after build each
    recipe (don't have to install to the image), for example, a recipe may
    generate 10 binary packages, only a part of them will be installed to
    the image by default, we can know whether the rdepends are OK or
    not for the ones which are installed, but can't know the ones which
    are not installed, this patch can help check all the 10 binary
    packages' rdepends.

* Basic designs:
  - Get all the RDEPENDS on the chain.

  - Get the pkg's FILERPROVIDES from oe.packagedata.read_subpkgdata()
    and save to set filerdepends.

  - Get each RPDEPENDS' FILERPROVIDES, RPROVIDES and FILERPROVIDESFLIST,
    and save to set rdep_rprovides.

  - Do the set "filerdepends -= rdep_rprovides" and QA issue if
    filerdepends is not null.

[YOCTO #1662]

(From OE-Core rev: cd5e0f01cdb4e7c759c01cf3f87952a20253737c)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
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>
2014-09-10 11:33:22 +01:00
Fabrice Coulon b02da021b1 useradd-staticids.bbclass: Fix for Bug 6633
When using the useradd-staticids.bbclass under meta/classes,
this error occurs:
"<username> - <username>: Username  does not have a static uid defined."
There was a problem with the regular expression for parsing parameters,
it was sometimes returning an empty string.

I have fixed this by skipping empty strings.

(From OE-Core rev: f249ef32709069a2680b92dc5a5b4f6545d014b7)

Signed-off-by: Fabrice Coulon <fabrice@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-03 16:00:28 +01:00
Ronan Le Martret 2f42ef8d8f package_rpm: Add optional improved directory handling
During spec generation, ideally directories should not be auto
packaged under the %file section of rpm packages but take ownership of
specific directories.

* packages only empty directories or explict directory.
   See:
       - http://www.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html
       - "The %dir Directive"

* This will prevent the overlapping of security permission.
   For example, in Tizen the directory /etc have smack label 'System::Shared'
   So Only one package should own and set the label of /etc to prevent
   the overwriting of the smack label.

Existing behaviour is maintained if DIRFILES is not set. If it is set,
the modified behaviour is used. If can be set to an empty value by
core recipes to trigger the modified behaviour.

[RP: Modified to allow optional usage of DIRFILES]
(From OE-Core rev: 0e33d232916125ba5305ced7200cc00f8b5f7b22)

Signed-off-by: Ronan Le Martret <ronan@fridu.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-03 16:00:28 +01:00
Chen Qi ee05cc8359 update-rc.d: fix logic in populate_packages_updatercd
The 'and' logic for the check is wrong. To make things clear, please
see the example below.

Say that we have a recipe A, which has a sysv-init style init script named
initA and no corresponding service file. The recipe inherits update-rc.d,
but it doesn't inherit systemd.bbclass. The DISTRO_FEATURES has 'systemd'
inside it, but it doesn't have 'sysvinit'. Now if we build an image, with
the 'and' logic in the check, the symlinks for initA would not be installed
into /etc/rc?.d directory.
This is incorrect. Because there's no corresponding service. The symlinks
in /etc/rc?.d/ should be created so that the service would be correctly
started at boot time.

The logic should really be 'or' in the check. This is actually what the code
was when it was originally written.

Several different situations are listed below to prove the correctness of the
'or' logic.

If 'sysvinit' is in DISTRO_FEATURES, the initA script would always be installed
with corresponding preisnt/postinst generated and added.

If 'sysvinit' is not in DISTRO_FEATURES, we have three situations.
1) A has initA and A.service.
   In such situation, systemd.bbclass would set INHIBIT_UPDATERCD_BBCLASS,
   so no preinst/postinst about update-rc.d would be added and the symlinks
   for initA would not be created.

2) A has initA, and the functionality of initA is not implemented internally
   in systemd.
   In such situation, symlinks for initA would be installed.

3) A has initA, and the functionality of initA is implemented internally in
   systemd or in some other recipe.
   Examples for such situation are alsa-state and keymaps in OE.
   In such situation, we need to set INHIBIT_UPDATERCD_BBCLASS in the recipe
   so that there would be no preinst/postinst scripts about update-rc.d added.

(From OE-Core rev: 6272c81509bbdb5d602056ceaa6f2c02bbf47a41)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-03 11:09:04 +01:00
Hongxu Jia b15a7036c5 classes/compress_doc.bbclass: compress man/info pages
A distribution compression policy should be established, and used by all
packages. It compressed man pages in ${mandir} and info pages in ${infodir}

1. The doc will be compressed to gz format by default, which is configured
in ${DOC_COMPRESS}

2. It will automatically correct the compressed doc which is not
in ${DOC_COMPRESS} but in ${DOC_COMPRESS_LIST} to the format
of ${DOC_COMPRESS} policy

3. It is easy to add a new type compression by editing
local.conf, such as:
...
DOC_COMPRESS_LIST_append = ' abc'
DOC_COMPRESS = 'abc'
DOC_COMPRESS_CMD[abc] = 'abc compress cmd ***'
DOC_DECOMPRESS_CMD[abc] = 'abc decompress cmd ***'
...

[YOCTO #1238]

(From OE-Core rev: 5c833e188bbf25c35c24f78eaa761a191d6b5801)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-03 11:09:03 +01:00
Richard Purdie c5dc66430e package_rpm: Add builddir macro to define source directory
This allows its usage in other RPM macros so files in ${S} can be found.

(From OE-Core rev: 649ddd4b17e8a1f94ca9f4bc3a71560437c61909)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-03 11:09:02 +01:00
Richard Purdie 2668104a5c package_rpm: Add custom extension support for spec generation.
Add hooks to allow customisation of the rpm spec files. Since python functions
aren't visible in the data store, one variable is used to trigger the call to
a separately named function. A dummy function is not provided since this then
triggers various class ordering complexities which are best avoided.

Ultimately this will be replaced by a refactor of the code to generate the
spec file using a python class.

This allows the tizen layer to add hooks for the security manifests for
example.

(From OE-Core rev: 03ac91815013c0e85c4694b3ab849257e658aeba)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-03 11:09:02 +01:00
Khem Raj 4e4e80e4f2 image-swab.bbclass: Account for eglibc -> glibc move
(From OE-Core rev: 9942fe4b36e2a18510cb0805ddb7be71d72a75a2)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 18:03:04 +01:00
Robert Yang 051f6a19f9 native.bbclass: deltask package_qa
The native recipe doesn't need package_qa, and it has a race issue with
do_unpack which requires the clean dir of ${S}, then causes error:

NOTE: recipe opkg-utils-native-0.1.8+gitAUTOINC+eae0d8fa44-r0: task do_package_qa: Failed
ERROR: Task 283 (virtual:native:/path/to/opkg-utils_git.bb, do_package_qa) failed with exit code '1'

(From OE-Core rev: 6ad0979a6064755fd6d86b568bd3cbbcdd3d4e37)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 17:17:11 +01:00
Bruce Ashfield 92c1ece6c3 kernel-yocto: replace --is-ancestor with basic git porcelain commands
--is-ancestor is a relatively new git option [commit 5907cda1, Aug 30 2012].
To support build machines with older versions of git installed, we can use
the basic porcelain commands to acheive the same check.

merge-base: "--is-ancestor A B" can be replaced with:

    if test "$(git rev-parse --verify A)" = "$(git merge-base A B)"

(From OE-Core rev: 2ddfffe52720d1df70b04131eac553776da7bc73)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 14:35:41 +01:00
Bruce Ashfield 9a3292efcb kernel-yocto: convert echo statements to bb* equivalents
Use the bbinfo, bberror, bbfatal equivalents to the existing echo statements
within the kernel-yocto processing. This makes us consistent with the other
messages from the build system.

(From OE-Core rev: 1686d69de08bcecd39942802df18c4f0ca029ffe)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 14:35:41 +01:00
Bruce Ashfield 63f2e18987 kernel-yocto: allow custom non-meta, SRCREV format builds
When custom respositories are built (like a pure kernel.org
repo), the machine_meta SRCREV format is not applicable. As
such, we shouldn't check for the meta branch and we shouldn't
only check SRCREV_machine based revisions.

(From OE-Core rev: bf555ee3305114483aa5083cde1accd23b46a39e)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 14:35:40 +01:00
Bruce Ashfield ba7614b0e6 kernel-yocto: clean overly complex branch checkout
Since the git fetcher ensures that branches exist, we no longer need to
validate the branch and have a conditional checkout of the source.

We can remove some checks and ensure that whenever we exit the
do_kernel_checkout routine that a branch is always checked out.

(From OE-Core rev: 2ffa3f8be6996877cd552ff22260de35c19c413d)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 14:35:40 +01:00
Bruce Ashfield 2aa75224b5 kernel-yocto: use show-ref instead of branch -a
It's better to check a branches existence via show-ref versus the end
user branch commands. So we make the switch.

Also as part of this change, we move the conversion of remote branches
to local branches above the meta branch checking. This is required to
ensure that the branch is local for the show-ref check.

(From OE-Core rev: 04bd4cee625574cfa67679b6b2a150a21106c5bf)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 14:35:40 +01:00
Bruce Ashfield 4ee454d356 kernel-yocto: simplify branch SRCREV validation
The checking of machine and meta branch SRCREVs was inconsistent and
didn't allow a mixed AUTOREV machine/meta branch combination. By
simplifying the checks and changing the logic, we can now allow this
combination.

(From OE-Core rev: e272cfbba87a98393d6c22bd96c7f1cb6902170a)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 14:35:40 +01:00
Bruce Ashfield 3b3fe047a4 kernel-yocto: remove KBRANCH_DEFAULT
KBRANCH_DEFAULT was introduced as a way to trigger the enforced build
of a particular branch of the tree. With the fetcher now enforcing
SRCREVs existing on a branch, we can simply validate that the SRCREV
is reachable from the final branch and no longer care about enforcing
a given branch.

(From OE-Core rev: fbacbb0ca79cdae33803fdd3158671488b9bbcbe)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 14:35:40 +01:00
Bruce Ashfield 95bfc6ab51 kernel-yocto: remove branch existence checking in do_validate_branches
Now that the fetcher will enforce branch existence, we no longer need to
confirm that a branch exists, and that it was the branch requested to
be built.

We know the branch exists and we'll confirm that the specified SRCREV
is going to be built after we've patched the tree.

(From OE-Core rev: 93a7c7bd8e860e621af7174ef10d571b0d8622b2)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 14:35:40 +01:00
Bruce Ashfield 254bc3a283 kernel-yocto: remove SRC_URI kbranch validation
We no longer need to check if the KBRANCH matches the branch specified
in the SRC_URI. This is taken care of by the fetcher at the beginning
and SRCREV ancestor validation after patching.

(From OE-Core rev: a9b6550d3e2f5bf21fd05a17bca3e57c5b74e057)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 14:35:40 +01:00
Bruce Ashfield 8a5b1c771a kernel-yocto: remove containing branch check
The bitbake fetcher now enforces that a commit is contained by a branch,
so this code can be dropped from do_validate_branches.

(From OE-Core rev: 9e473d348d9e0db34e03446065c6c48d36964e1e)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 14:35:39 +01:00
Bruce Ashfield 7097cdf14a kernel-yocto: move SRCREV validation to patching phase
Rather than attempting to condition the entire tree to machine SRCREV (since
we don't know what branch will be built), we can instead wait until patching
has completed and then confirm that we are indeed building a decendant of the
specified SRCREV. The result is a much simpler check, and no mangling of the
tree.

(From OE-Core rev: 97075af9e9a691276cd417f1181ca73223f52d1c)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 14:35:39 +01:00
Bruce Ashfield 4e96983a3a kernel-yocto: use cat-file instead of git-show
Parsing the output of git show is error prone, since it changes based on
the type of issue with bad comit IDs. Since the output is no longer used
in the case of a valid ref, we can switch to git-cat-file and  simply
check the return code.

(From OE-Core rev: 228c05013fe691321ec00467d8d0c0bb64dd175c)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 14:35:39 +01:00
Bruce Ashfield 6b294a0489 kernel-yocto: remove redundant SRCREV check
do_validate_branches checks to ensure that a valid machine SRCREV was
set. A test against an empty SRCREV is done in two separate locations,
we only need one, since the first check immediately returns and the
second check never hits.

At the same time, we can stop referring to the same commit hash by
3 different names. Instead we assign to a local variable at the
top of the routine, and refer to it at all times.

(From OE-Core rev: 05508339882c7cc1fe3f1f67f72314fdcab979b7)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-01 14:35:39 +01:00
Jate Sujjavanich d8f60bb81c useradd: Add setscene dep on pseudo-native
A recipe will sometimes be rebuilt unnecessarily if it adds users via
useradd and the pseudo-native task has not been populated.

This patch adds the correct dependency.

(From OE-Core rev: 2bb244e9e18124b3b86195e0e10b2ebd40cd4f81)

Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-29 23:44:37 +01:00
Peter Kjellerstedt 9f36a3c445 package: Correct two typos in a comment
This quite coincidentally invalidates the sstate for do_package which
is needed due to the correction of oe.utils.multiprocess_exec().

(From OE-Core rev: 9972f0686794a01582fd1a15889dcbd89bc5cf72)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-29 23:44:37 +01:00
Richard Purdie e50ebcc502 testimage: Add parselogs to the default tests for sato images
(From OE-Core rev: d373d4332a03eb71c1112b8dd51052e56ca4fa59)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-29 23:44:37 +01:00
Tim Orling 00317221bf classes/cpan_build.bbclass: add EXTRA_CPAN_BUILD_FLAGS
Some packages have additional configuration options that are currently
not accessible through cpan_build.bbclass. Similar to cpan.bbclass, add
EXTRA_CPAN_BUILD_FLAGS to pass the optional parameters to perl Build.PL.

(From OE-Core rev: bef6c3f4ebcd19ea3845aab27a165c370102b62c)

Signed-off-by: Tim Orling <TicoTimo@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-29 23:44:36 +01:00
Richard Purdie 859ad9402c populate_sdk_base: Remap TOOLCHAIN_HOST_TASK variable
Currently this variable isn't passed through the magic rename
mangling. This means that if you try adding "nativesdk-eglibc"
to an image directly, you can't since the package is renamed
by debian.bbclass and nothing sees the renaming.

This is annoying since I wanted to exactly that. This code
change passes it through the standard renaming function, the
tricky part is that we have to set PKGDATA_DIR to point to
the correct sysroot during the call. We create a copy of the
 datastore for the purposes of the call to do this.

(From OE-Core rev: d2fbc55d6863a767e69092bac686c02c3ec34650)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-28 15:12:45 +01:00
Robert Yang 9c0d4f5ba2 cpan.bbclass: matches more lines
Fixed:
- There might be a space between "#!" and "/pat/to/usr/bin/perl", e.g.:
  "#! /usr/bin/perl", now also matches it.

- There might be the lines like the following in the body:
  eval 'exec /path/to/usr/bin/perl-native/perl -S $0 ${1+"$@"}'

  Now we only check "#! */path/to/usr/bin/perl" to make sure it is a
  perl script, but match and fix the lines in both header and body.

(From OE-Core rev: 0d2e2ac137465885a1d55103010ccfdec579f1ce)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-28 15:12:43 +01:00
Richard Purdie 347f9c6bc3 sstate: Add extra intercept functions
In some cases we do either need to add extra sstate manipulation
functions, or change the existing modification functions. This patch
parametrises them to SSTATECREATEFUNCS and SSTATEPOSTUNPACKFUNCS and
abstracts the "hardcoded path" functions into separate functions using
these new variables.

We may use this new functionality to improve binary relocating using
patchelf for example, this at least lets us have the hooks to be able to
experiment.

(From OE-Core rev: 9d659c6f20fa4a141b491c62a3ef0dfb1f896d9c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-28 15:12:42 +01:00
Corneliu Stoicescu e04172d8bd classes/testimage.bbclass: add more fields to the sdk TestContext
In order to use hasFeature and hasPackage methods in sdk test modules, we need specific fields to be set in the TestContext object.
Adding pkgmanifest, imagefeatures and distrofeatures to the TestContext.

(From OE-Core rev: cd342b399b2d78724032cdd7042968d3238cd548)

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-27 12:12:31 +01:00
Corneliu Stoicescu 475e976272 classes/populate_sdk_base.bbclass: add a manifest for target sdk
Similar to the way BSP images have rootfs a manifest, the toolchain now also has a manifest file created alongside the sdk image.

(From OE-Core rev: 3d42fd1f050a1382b15c3c4d59fd02d0ed7091b2)

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-27 12:12:31 +01:00
Joe Slater a9b080405e archiver.bbclass: add revision to git tarfile name
When archiving original source, insert the first 10
characters of srcrev, after stripping off any
AUTOINC+, into the filename for tarfiles created
from directories.

(From OE-Core rev: 36726049a6a452f85d7cc849d57ad6af05d6d3ea)

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-27 12:12:30 +01:00
Khem Raj d09e6d8830 native/nativesdk: Clear MACHINEOVERRIDES
In cases where we override variables e.g PACKAGE_ARCH
conditionally and use a MACHINEOVERRIDE to qualify the
override like

PACKAGE_ARCH_<MACHINE> = "some target PACKAGE_ARCH"

This would also be effective if this recipe is
BBEXTENDED to native or nativesdk which is undesired
This particular issue will cause wrong sysroot to be
used for nativesdk case since PACKAGE_ARCH would have
been modified and eventually changing value of
STAGING_DIR_TARGET which we use as --sysroot option
to cross and cross-canadian built SDK gcc

(From OE-Core rev: 6907da7eb44dca812dbb9e214357ee96e9ff738a)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-27 12:12:29 +01:00
Christopher Larson 8491ca52b8 sanity: refactor mirrors checks to be more pythonic
- Use clearer variable names
- Use variable unpacking to reference elements by name rather than index
- Sacrifice a small amount of time (iterate over protocols twice per entry
  rather than once) for clarity: use readable generator expressions with any()
  rather than maintaining state.

(From OE-Core rev: 9d31e1e6ce07991fe360e67295311e62a55603af)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-27 12:12:29 +01:00
Christopher Larson af6d66852f sanity: fix support for regex schemes in mirrors check
(From OE-Core rev: c8afcb9cab9d610892db9c41b29685583f3b5773)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-27 12:12:29 +01:00