Commit Graph

4443 Commits

Author SHA1 Message Date
Ross Burton 07f0af3d33 uninative: don't try to relocate static binaries
patchelf will understandably error out if there isn't a .interp section to
relocate, so don't try to relocate static binaries.

(From OE-Core rev: 2a1803e64174825d9392094ae6e680a1ac96eb4a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-26 07:34:58 +00:00
Ross Burton 10b6037624 uninative: ensure patchelf errors are visible
(From OE-Core rev: 9840bfbe7d860bdb7ad9ac444a82f95510d48c2d)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-26 07:34:58 +00:00
Mariano Lopez d7cf2c3230 archiver.bbclass: Fix tar name for git repositories
When archiving the original source, the git repositories have the name as
they are in the $DL_DIR plus the source revision; i.e.
"git.yoctoproject.org.linux-yocto-4.4.git.89419d8b90_dadb436904.tar.gz".
This change set the tar name to $PF.tar.gz instead, to have consistency with
the others archives created by the class.

(From OE-Core rev: 3f903cb767150e316337929d72559cad6931039a)

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-03-25 10:29:17 +00:00
Mariano Lopez 2cb4cb7a6c archiver.bbclass: Fix gcc-source corner case
Bitbake couldn't add the task ar_configured when
trying to archive the configured source for
gcc-source-${PV} recipes. This is because the task
depended in the do_configure and this task doesn't
exist for gcc-source.

This fix allows to archive configured gcc-source recipe.

(From OE-Core rev: 5be5eae2e1630a151a9f5866d60325d439150ced)

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-03-25 10:29:17 +00:00
Mariano Lopez c29eea0df8 archiver.bbclass: Fix use of ARCHIVER_WORKDIR and ARCHIVER_OUTDIR
Currently do_unpack_and_patch() and do_ar_configured() are using
the ARCHIVER_OUTDIR as the ARCHIVER_WORKDIR, this lead to have
duplicated files inside the tars when using the archiver class
for patched and configured source.

(From OE-Core rev: 09dfc99a813090043262529beb6d900900e983dc)

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-03-25 10:29:17 +00:00
Mariano Lopez 8b7ee6ebeb archiver.bbclass: Don't expand python functions in dumpdata
Currently the dumpdata task expands python data in the datastore, in
some functions this causes a silent error and the task will fail.

The change also rewrite the function to make a bit clearer.

(From OE-Core rev: e3239ade430ff48e00dce47066abe8fcb990af61)

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-03-25 10:29:17 +00:00
Bill Randle e33124f828 sanity.bbclass: check host tool dependencies on change in NATIVELSBSTRING
When a user upgrades their host distro, it may no longer have all the
required tools installed, but this won't be caught by bitbake resulting
in possible build errors. Rather than check for installed tools on every
startup, use the NATIVELSBSTRING change as indicator to rescan for host
tool dependencies. Store the NATIVELSBSTRING in the sanity_info file.

[YOCTO #8585]

(From OE-Core rev: e838b581397bbea9a0f4d74648fcc250073db1ae)

Signed-off-by: Bill Randle <william.c.randle@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:16 +00:00
Brendan Le Foll 959b7f204e package.bbclass: Treat .node files same as .so when checking what to strip
Typically in a node/npm compiled modules the module is named .node. This is a
binary module without a wrapper so it can actually be relatively large if
unstripped.

(From OE-Core rev: d14bc2667575bc0e29b9e90d80c01703639b76f1)

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:16 +00:00
Robert Yang e0bc781ce0 bootimg.bbclass: only inherit syslinux when pcbios
syslinux.bbclass should not be seen when use efi.

(From OE-Core rev: f994eef0aeae861857756d3cc05c49cca17bd12b)

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-03-25 10:29:16 +00:00
Robert Yang 1b1de89304 grub-efi.bbclass: make it can build vm and live together
* Make it can build vm and live (e.g., iso + vmdk) together as we did
  for syslinux.
* GRUBCFG -> GRUB_CFG as other GRUB_FOO vars

(From OE-Core rev: e38039e43f22d55a443064efa91752e2943fda79)

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-03-25 10:29:16 +00:00
Robert Yang 4ebaeb281b bootimg.bbclass: fix settings for grub-efi.bbclass
Fixed:
- Found potential conflicted var LABELS ...
  Set LABELS to "boot install" would build out broken images when build
  vm + live together, use set_live_vm_vars() to fix the problem.

- Use ROOT and LABEL in boot-directdisk.bbclass and image-foo.bbclass,
  they are not only used by syslinux.bbclass, but also grub-efi.bbclass,
  add "SYSLINUX_" prefix would mislead users.

(From OE-Core rev: d7d1e0193c94abb1cd2daf1c298c8c1788f3616d)

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-03-25 10:29:16 +00:00
Bill Randle 421289cbcc sanity.bbclass cleanup
Limit search for a version var name to start at the beginning of a line,
otherwise, if the var name is used in a comment, that comment line will
be replaced, rather than the desired assignment line.
Move bblayer update message into function where it's actually updated,
rather than assuming all successful config file update are to the
bblayers.conf file.
Replace a stray tab with spaces for consistency.

[Fixes YOCTO #9318]

(From OE-Core rev: 7c1e53bb802f021f06231243077d0e007a64274c)

Signed-off-by: Bill Randle <william.c.randle@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:15 +00:00
Robert Yang 3e5c5fe330 gpg_sign.py: get rid of pexpect
The python-expect is not installed on the distro such as Ubuntu by
default, and we can get rid of it.

Use RPM_GPG_PASSPHRASE to replace of RPM_GPG_PASSPHRASE_FILE which is
more straightforward.

(From OE-Core rev: 4a8a74c62836a20610daf029d4cec0b3087758b2)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:14 +00:00
Paul Eggleton 11c1d30152 devtool: add: delete externalsrc files on npm recipe do_install
The npm class just installs whatever is in ${S}; if you're using
externalsrc in conjunction with it the symlinks (oe-workdir and oe-logs
by default) plus singletask.lock will end up in the final package, which
isn't really right. Introduce a variable so we know the path the files
will be installed into within npm.bbclass, and append to do_install
within the workspace bbappend to delete the files.

(From OE-Core rev: 766845e06db9d7d595e836ea1364c16fa132a413)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:13 +00:00
Paul Eggleton 58d2e5625f classes/populate_sdk_ext: parse metadata on minimal SDK install
Instead of skipping the build system preparation step within the
extensible SDK install process when SDK_EXT_TYPE is "minimal", run
bitbake -p so that the cache is populated ready for the first time
devtool is run.

(From OE-Core rev: 6b38a991a3475fb82889428b94563968c7570473)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:13 +00:00
Paul Eggleton 50addfb97b classes/distutils*: don't hide logs when setup script fails
We need to see the output of the setup script in the error message
because what we are having bbfatal print here doesn't completely
describe what went wrong, thus we should use bbfatal_log here and not
bbfatal.

(From OE-Core rev: 970a02061b474a238f57cd0cc4db7b62e36dfa3d)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:13 +00:00
Paul Eggleton 0ec30c7a68 classes/packagegroup: drop complementary -ptest if ptest not in DISTRO_FEATURES
If ptest isn't in DISTRO_FEATURES, there won't be any -ptest packages
and thus no need for the -ptest package for the packagegroup either.

(From OE-Core rev: 52f9b12601c02f1585438f890f847b4596170362)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:13 +00:00
Paul Eggleton d96ea299b3 classes/packagegroup: fix dbg/dev/ptest complementary packages
OE-Core commit 8981ed20234c42dc1f5cdef802ebe7214bd55238 (from 2013)
caused a regression where -dbg/-dev/-ptest packages weren't generated
for packagegroups because we weren't setting ALLOW_EMPTY for them.
Break out the code for adding complementary groups to its own
conditional so we can set ALLOW_EMPTY at the same time.

(From OE-Core rev: 340e9d619c881f320070474d5c4674dcaeabad35)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:13 +00:00
Markus Lehtonen 62ddde6ebe externalsrc: use shared stamp directory if B=S
We have a common build directory for all target architectures if
externalsrc is used and ${B}=${S}. In this case we also need to have a
common stamp directory. The reason is that e.g. changing MACHINE will
basically "invalidate" the artefacts in ${B} (wrt. to the new MACHINE)
but old stamp files with matching hashes from an earlier build might be
available in the machine-specific stamps directory and tasks would not
be correctly re-run.

Previous attempt in f44f12af346888bdeb3ae01a275cb5dd4396b505 to handle
this correctly was faulty as it threw some spurious warnings and caused
do_configure to be re-run in every build if that would not be necessary.

[YOCTO #8950]
[YOCTO #9237]

(From OE-Core rev: f5031fb37ceef83c85f0dfec773da75c05b2a631)

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-03-20 23:12:29 +00:00
Andre McCurdy ac347da759 gobject-introspection.bbclass: wrap comments at 80 columns
Whitespace and comment updates only, no functional changes.

(From OE-Core rev: 738393ea98baec364d3da117a1307a39d348b660)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-20 23:12:29 +00:00
Patrick Ohly cad415dc2f sanity.bbclass: allow customizing config file update error messages
The default file pattern may be amiguous and "meld" might not always
be the preferred tool, so allow distros to override those parts of the
error messages.

(From OE-Core rev: 98fc50436dfa5d0e5bee0930154a5563ffc8151d)

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-03-20 23:12:28 +00:00
Patrick Ohly 96a5cb41fd sanity.bbclass: fix success message when config file was updated
The code now iterates over different config files, but always printed a
message about conf/bblayers.conf for each file.

(From OE-Core rev: af55727fc1920c4c23476304f57a3720835ec203)

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-03-20 23:12:28 +00:00
Patrick Ohly 805aca8192 sanity.bbclass: expand error messages for version checks
The ${WORKDIR} variable was not getting expanded (anymore?), leading to
less helpful error messages like:

   Exception: NotImplementedError: Your version of bblayers.conf has the wrong LCONF_VERSION (has 7, expecting 8).
   Please compare your file against bblayers.conf.sample and merge any changes before continuing.
   "meld conf/bblayers.conf ${COREBASE}/meta*/conf/bblayers.conf.sample"

   is a good way to visualise the changes.

   ERROR: Execution of event handler 'check_sanity_eventhandler' failed

After adding expansion, embedding ${LCONF_VERSION} and ${LAYER_CONF_VERSION}
in the error message seems a bit more readable and consistent.

(From OE-Core rev: 7fd08497cf780018fa144a870bdea0e7a69dae20)

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-03-20 23:12:28 +00:00
Kai Kang 57a525ca72 useradd_base.bbclass: replace retry logic with flock
When perform useradd during populate sysroot, it locks files passwd.lock
and group.lock at same time. And then it meets a dead lock issue
randomly.

Use flock to reslove it by using an universal lock directory for all the
user and group related operations.

[YOCTO #9022]

(From OE-Core rev: 2ebf697b46c42cee8bfa6d2e6087397f8cce385c)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-20 23:12:27 +00:00
Patrick Ohly 5d06f00471 image.bbclass: track ROOTFS_POSTUNINSTALL_COMMAND in do_rootfs vardeps
The list of variables influencing do_rootfs was not updated when
introducing ROOTFS_POSTUNINSTALL_COMMAND. As a result, making changes
in commands listed there or the variables they depend on did not trigger
a re-run of do_rootfs.

(From OE-Core rev: 66b461ce9df7ed06d7651b9b54a49a950b97a1d4)

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-03-20 23:12:26 +00:00
Richard Purdie 637b3c8259 uninative: Add a fix for icu-native to use the correct ABI
If no -std= option is passed to icu's configure, it defaults to CXX11.
This isn't what we want for uninative, so pass an explicit option
which selects an older ABI on newer versions of g++.

This avoids the __cxa_bad_array_new_length@CXXABI_1.3.8 symbol
being used.

(From OE-Core rev: ac59063bee0e32d0737340974f657341717a6abe)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-12 22:11:48 +00:00
Paul Eggleton 0eb52b91a7 classes/buildhistory: record a few more variables for extensible SDK
We've recently added SDK_EXT_TYPE and SDK_RECRDEP_TASKS and these will
have an effect on the size and functionality of the SDK, so record them
in sdk-info.txt.

(From OE-Core rev: 1be0ae80f97bdee758232ec5397c09d73d57e1e0)

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-03-12 22:11:48 +00:00
Ricardo Ribalda Delgado cbb4c5b0f1 package-deb: Ignore circular dependencies
If a package depends on itself apt-get fails to install it with the
error attached to this patch.

This patch checks for this conditions and notifies the user so the
recipe maintainer can fix his RDEPENDS variable.

root@qt5022:~# apt-get install perl-module-cpan
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  perl-module-cpan
0 upgraded, 640 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/5964 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
E: Internal error: MaxLoopCount reached in SmartUnPack (2) for
perl-module-cpan:amd64, aborting
E: Internal error, packages left unconfigured. perl-module-cpan:amd64
root@qt5022:~# apt-get install perl-modules

(From OE-Core rev: d8bf148c3b740254ed23d52cf244f0f6e9c7a4ab)

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-12 22:11:47 +00:00
Ricardo Ribalda Delgado fcc7ff072a package_deb: Fix python runtime error
The dictionary cannot be used for iteration if its size may change
during the loop.

ERROR: Error executing a python function in
/home/ricardo/curro/qt5022/build-qt5022/repo/yocto/meta/recipes-devtools/perl/perl_5.22.0.bb:
Exception: RuntimeError: dictionary changed size during iteration

Acked-by: Aníbal Limón <anibal.limon@linux.intel.com>
(From OE-Core rev: 04aa40be126e00e2eb97311510e4d3ea90bfe7eb)

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-12 22:11:47 +00:00
Patrick Ohly cf3402eb82 image-buildinfo.bbclass: fix performance problems
Inheriting image-buildinfo.bbclass primarily slowed down image
building for two reasons:
1. The content of the shell command "buildinfo" gets expanded
   multiple times, each time again checking the state of all
   layers.
2. When expanded as part of the actual image creation, git
   is invoked under pseudo, which makes the check quite a bit
   slower (from a few seconds to a minute with many layers).

To fix this, buildinfo now is a Python method which calls the checks
only when really executed. Pseudo is told to unload itself when
starting git.

In addition, "git diff" is invoked with "--quiet", which avoids
producing output that is just getting thrown away. As before, any kind
of problem or output causes the layer to be marked as "modified".

[Revision 2 of the change with some dead code removed]

(From OE-Core rev: e59547e4154b772a36f4e58f1d454c0c38653c84)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-12 22:11:46 +00:00
Alexander Kanavin ff3500b7a9 gnomebase.bbclass: do not disable gobject introspection
(From OE-Core rev: 37b2c27b18115b5a7b0e7d46da246852d2f045ee)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-12 22:11:45 +00:00
Alexander Kanavin 4fbf761027 vala.bbclass: remove pre-packaged vapigen.m4 from tarballs
We need to make sure that our fixed vapigen.m4 is used instead.

(From OE-Core rev: 3086dbaabaa5eccd05e091bed9ff0bdf707113fa)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-12 22:11:44 +00:00
Alexander Kanavin d1b96f1594 gobject-introspection.bbclass: add a class that enables gobject introspection
(From OE-Core rev: 142cd4399a742f5482c1f83efe77bd85069bd7a7)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-12 22:11:44 +00:00
Ioan-Adrian Ratiu 81d58d6b24 sign_package_feed: add feed signature type
Signing package feeds will default to ascii armored signatures (ASC) the
other option being binary (BIN). This is for both rpm and ipk backends.

(From OE-Core rev: 862a3892feb2628282e1d6f2e4498a7a3bd60cbf)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-11 16:50:45 +00:00
Ioan-Adrian Ratiu 2fccd8aa1c gpg_sign: add local ipk package signing functionality
Implement ipk signing inside the sign_ipk bbclass using the gpg_sign
module and configure signing similar to how rpm does it. sign_ipk uses
gpg_sign's detach_sign because its functionality is identical to package
feed signing.

IPK signing process is a bit different from rpm:
    - Signatures are stored outside ipk files; opkg connects to a feed
server and downloads them to verify a package.
    - Signatures are of two types (both supported by opkg): binary or
ascii armoured. By default we sign using ascii armoured.
    - Public keys are stored on targets to verify ipks using the
opkg-keyrings recipe.

(From OE-Core rev: a40f27aa7802e8a0bd87a5417e35adbface62d05)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-11 16:50:45 +00:00
brian avery 3f8d5bfdfd toaster.bbclass: show packages that were setscened into existence too
We were previously ignoring pkgs that came in from a setscene like from
an sstate mirror).  With this patch we can use pkgs than come from sstate
for image customisation as well.

Also remove unused variable.

[YOCTO #9137]

(From OE-Core rev: 4ea7f96ae28ff53867f5ffa4158076761676d288)

Signed-off-by: brian avery <brian.avery@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-11 16:50:44 +00:00
Chris Austen 37b61b0590 siteinfo: Add ppc64le support.
(From OE-Core rev: 00d3fd571a8d261d065b43f5cf3076a381843984)

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-10 23:13:55 +00:00
Tyler Hall b578a06564 image-mklibs: handle position independent binaries
Executables built with -fpie have the ELF type DYN rather than EXEC
which makes them difficult to distinguish from shared libraries.
Currently when building the list of executables we omit these binaries
so they might fail to run on the resultant rootfs due to missing
symbols. One of these is systemd which builds -fpie unconditionally, so
mklibs breaks images containing systemd.

Modify the search to catch all executable files that are ELF and have an
interpreter set. Omit libc and libpthread as special cases because they
have an interpreter and are directly executable but treating them as
such is antithetical to the pupose of mklibs.

(From OE-Core rev: 30da34ef032d5b4b2f694743715f2c8d64dd9849)

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-10 23:13:54 +00:00
Richard Purdie ad50ce907a populate_sdk_ext: Correct commit 8b81bb56c69aabdea984352f8e267a9783c0bdbc
Commit 8b81bb56c69aabdea984352f8e267a9783c0bdbc was accidentally merged.
The DL_DIR piece was simply incorrect and should be removed.

The patch commit message should have mentioned that the changes were
to update populate_sdk_ext after the changes to uninative now the
download is placed into a specific directory in DL_DIR. We also
need to specify the uninative tarball checksum.

(From OE-Core rev: be177739b46d3296c0c0c01310b499ffc6782d43)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 22:33:40 +00:00
Paul Eggleton 91455005b6 recipetool: create: split npm module dependencies into packages
Rather than rolling all of an npm module's dependencies into the same
package, split them into one module per package, setting the SUMMARY and
PKGV values from the package.json file for each package. Additionally,
mark each package with the appropriate license using the license
scanning we already do, falling back to the license stated in the
package.json file for the module if unknown. All of this is mostly in
aid of ensuring all modules and their licenses now show up in the
manifests for the image.

Additionally we set the main LICENSE value more concretely once we've
calculated the per-package licenses, since we have more information at
that point.

(From OE-Core rev: 8226805f83d21e7c1d2ba21969f3e8ee4b137496)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 17:00:29 +00:00
Alexander Kanavin 5dce2e3664 qemu.bbclass: add qemu_wrapper_cmdline()
The class had qemu_run_binary() which was not suitable for gobject-introspection,
as it required the name of the binary to run.

qemu_wrapper_cmdline() returns just the command line string needed to run
binaries, and does not require the binary name.

(From OE-Core rev: 0b68f0632312392cbd20bfcb9ed4895cfc9883ff)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 17:00:28 +00:00
Elliot Smith 6d89b5201b toaster.bbclass: improve how we gather buildstats for Toaster
Clean up the code which gathers buildstats for Toaster,
and modify the field names so that the correct parts of the
buildstats files are used to derive the CPU usage values.

Also derive elapsed time for the build here, rather than in
Toaster, as we have ready access to the data in the correct
format.

[YOCTO #8842]

(From OE-Core rev: c145624ccc77ffd07a0b4c368c0dfce525e17eac)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 16:58:13 +00:00
Ross Burton 4dd3e40ed6 image-prelink: use STAGING_*_NATIVE variables
(From OE-Core rev: d78921e91ea1caf0154d544496a8aeabc2ec543d)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 16:58:12 +00:00
Randy Witt 433d866a0a populate_sdk_ext: Make populate_sdk_ext nostamp
Since the metadata for multiple layers will be put into the sdk, anytime
those layers change the sdk needs to be rebuilt. Ideally, this would use
checksums to only rebuild when necessary.

However, since this feature needs to be in the release, opt for a less
intrusive change by setting the task to nostamp. Unnecessary rebuilds
may occur, but it's better than a user wondering why their changes
didn't get added.

(From OE-Core rev: d801547f6fe4315da6476ed9fc4ccca2a6983421)

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>
2016-03-09 16:58:12 +00:00
Jagadeesh Krishnanjanappa b051a953fc license.bbclass: fix host contamination warnings for license files
We get below host contamination warnings of license files for
each recipe, when we try to create a separate ${PN}-lic package (which
contains license files), by setting LICENSE_CREATE_PACKAGE equal to "1"
in local.conf.

-- snip --
WARNING: QA Issue: libcgroup: /libcgroup-lic/usr/share/licenses/libcgroup/generic_LGPLv2.1 is owned by uid 5001, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
WARNING: QA Issue: attr: /attr-lic/usr/share/licenses/attr/libattr.c is owned by uid 5001, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
WARNING: QA Issue: bash: /bash-lic/usr/share/licenses/bash/COPYING is owned by uid 5001, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
-- CUT --

Since the license files from source and OE-core, are populated in a normal
shell environment rather in pseudo environment (fakeroot); the ownership of
these files will be same as host user running bitbake. During the do_package
task (which runs in pseudo environment (fakeroot)), os.link preserves the
ownership of these license files as host user instead of root user.
This causes license files to have UID same as host user id and resulting in
above warnings during do_package_qa task.

Changing ownership of license files to root user (which has UID and GID as 0)
under pseudo environment will solve above warnings, and on exiting pseudo
environment the license files will continue to be owned by host user. Perform
this manipulation within try/except statements, as tasks which are not exected
under pseudo (such as do_populate_lic) result in OSError when trying to
change ownership of license files.

(From OE-Core rev: a411e96c3989bc9ffbd870b54cd6a7ad2e9f2c61)

Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 16:58:12 +00:00
Richard Purdie 946d00c01f populate_sdk_ext: Update after uninative changes
(From OE-Core rev: 8b81bb56c69aabdea984352f8e267a9783c0bdbc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 16:58:10 +00:00
Patrick Ohly ba57ba1942 image.bbclass: support chaining compression (aka conversion) commands
It makes sense to use the compression mechanism also for conversion,
for example of a whole-disk image into .vdi (VirtualBox). That part
already works, like this:

   COMPRESSIONTYPES_append = " vdi"
   COMPRESS_CMD_vdi = "qemu-img convert -O vdi ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.vdi"
   IMAGE_DEPENDS_vdi = "qemu-native"

But then it also makes sense to allow compressing the resulting image,
which only works after enhancing the image.bbclass.

For example, suppose a custom image command produces "dsk" images. Then
it becomes possible to set
   IMAGE_FSTYPES = " dsk.xz dsk.vdi.xz"
and do_image_dsk will automatically produce the intermediate images,
convert to dsk.xz resp. dsk.vdi -> dsk.vdi.xz and delete all
intermediate images. Symlinks are also set correctly.

(From OE-Core rev: 588f14370372a66329b54606071175519ce88f1e)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09 16:58:10 +00:00
Patrick Ohly 5ac3dc76a5 image.bbclass: fix incomplete .rootfs customization
The patch for making the .rootfs configurable was incomplete: in the
python create_symlinks() method the new variable must be expanded
explicitly.

Not doing so broke the symlink creation and that led to hard build
failures in image types depending on the boot-directdisk.bbclass (like
qcow2) because the build_boot_dd() method relied on the symlink.

(From OE-Core rev: 0d02159c8d66bb136f7da2c10fda7d1a57f40cec)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 22:10:54 +00:00
Patrick Ohly 26ee4ddc65 image creation: allow overriding .rootfs suffix
By default, the image file name contains ".rootfs" to distinguish the
image file from other files created during image building. However,
for certain image types (for example, .hddimg) the ".rootfs" suffix is
redundant because the type suffix alone already uniquely identifies
the main image file (core-image-minimal-intel-corei7-64.hddimg instead
of core-image-minimal-intel-corei7-64.rootfs.hddimg).

With this change, distros that prefer the shorter image name can
override the .rootfs suffix unconditionally with
   IMAGE_NAME_SUFFIX ?= '' in their distro configuration
or with some condition check like this:
   python () {
       if <whole-disk image format active>:
           d.setVar('IMAGE_NAME_SUFFIX', '')
   }

The exact logic when to remove the extra suffix depends on the distro
and how it enables its own image type.

(From OE-Core rev: 380ee36811939d947024bf78de907e3c071b834f)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:17:43 +00:00
Paul Eggleton 59b4cefe29 classes/packageinfo: remove
This class was only used by Hob, and since Hob has now been removed we
can drop it as well.

(From OE-Core rev: b8db070926a7ec294816bc6648eb12db7f126f26)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-07 17:17:43 +00:00