path.py: Deal with race issue

The change to use copyhardlinktree in some of the sstate code instead of
copytree exposed a race condition. This is due to cp failing if it finds
a directory doesn't exist yet some other process creates it while cp was
trying to create it itself. tar doesn't error in this case.

To fix this we need to create the directory structure with tar, then
use cp to hardlink the files. Messy but probably worth doing.

I also took the opportunity to remove src_bak since the code is neater
without it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
classes/image: allow complementary package globs to be extended

Make it easy for the wildcard specifications for complementary package
features to be extended outside of image.bbclass. For example, to add a
new "foo-pkgs" item that could be added to IMAGE_FEATURES that would
cause *-foo packages to be installed for all packages currently in the
image, you can now use this line at the global level:

COMPLEMENTARY_GLOB[foo-pkgs] = "*-foo"

Implements [YOCTO #4228].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
image.bbclass: Don't mark do_rootfs and do_build as nostamp

When image.bbclass was first conceived (as rootfs_ipk.bbclass), oemake
was unable to figure out when the inputs to do_rootfs had changed in
such a way that it would need to be rerun.  Absent any reliable
information of this kind, it was necessary to adopt the conservative
assumption that images always needed rebuilding and, to this end,
do_rootfs and do_build in image recipes were marked as nostamp.  (The
nostamp annotation for do_build was added in oe-classic commit
80d622e0c1dbc284858e01d3eb670303a6d8cdf9 from January 2005; the exact
point at which do_rootfs was made nostamp is obscure, but it predates
oe-classic revision 63fad339e01d4b16105146c32a61f24460397126.)

This situation persisted for the following eight years but, during that
period, oemake evolved into today's sstate-enabled bitbake, oe itself
gained the OEBasicHash algorithm which can reliably detect changes to
the input data for do_rootfs or any other task, and OEBasicHash was made
the default for oe-core in 4199efed48005a62267fa3374c33b13627d85f44
(June 2012).

Given these various changes in the wider landscape, there is no longer
any obvious benefit to having these two tasks marked as nostamp, and
indeed having them so marked causes needless rebuilds which can be
annoying.  Anybody who does genuinely wish to rerun these tasks when
nothing in the input has changed can run "bitbake -f", just like with
any other task.  So, let's remove the nostamp annotations and just let
bitbake figure out when to rerun them.

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
image_types: fix default location of kernel when generating elf images

Generation of elf images fails because kernel images are no longer staged under
${STAGING_DIR_HOST}/kernel, but rather ${STAGING_DIR_HOST}/usr/src/kernel. This
patch fixes the path to point to the correct location.

Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
mesa-demos: Use PACKAGECONFIG to enable/disable features

This allow selection of following features:

 drm, egl, freetype2, gbm, gles1, gles2, glut, osmesa, vg, wayland, x11

The x11 features is enabled depending on distro features but the
wayland has not been enabled as it does not work with Wayland
1.0. Rest were enabled for a sane default.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
archive-*-source.bbclass: have do_dumpdata_create_diff_gz task run before do_rootfs

do_rootfs[cleandirs] contains ${S} and, if do_rootfs task starts before
the do_dumpdata_create_diff_gz is finished, an error will occur in the
process because the directory will be removed while still needed by the
create_diff_gz() function.

This patch will force the do_dumpdata_create_diff_gz task to run before
do_rootfs when the final image is created.

[YOCTO #4310]

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
gcc-runtime: Avoid error when trying to remove nonexistent directories

If we didn't build libgomp then we won't have installed anything into
${infodir} or ${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude.  Check
whether those directories exist before trying to remove them, else we
will lose.

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
fs-perms.txt: Don't tinker with file modes in /usr/src/debug

Since 6775feb9fe935ab01fd9cae2b2d3fce5824a9a72 our local "copy" of the
debug sources has in fact been hardlinked to ${S} and potentially other
places too.  This means that any modifications we make to these files
might have wider consequences than intended.

Avoid this potential pitfall by telling fixup_perms() to leave the file
modes in this directory alone.  No great harm will result from shipping
debug sources with a mode other than 0644: if the mode was permissive
enough for us to compile the sources in the first place then it must
also be permissive enough for subsequent debugging.

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
gcc-4.7: fix gcc ICE when building with gcc-4.8

Backport fix for internal compiler error when building gcc-4.7.2 with a
gcc-4.8.0 host gcc.

See upstream bug here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56308

Signed-off-by: Josh Cartwright <josh.cartwright@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
dmidecode: Add dmidecode to dev tools

Dmidecode reports information about your system's hardware as described
in your system BIOS according to the SMBIOS/DMI standard.

This recipe was updated to version 2.12 and cleaned up slightly from the
OE 2.10 version and proposed here for inclusion in oe-core.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
ia32-base.inc: remove inapropriate grub dependency

There is no good reason for ia32 machines to have hard dependency on grub,
as there are other bootloaders available for ia32 platforms.

Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>