fontcache.bbclass: do not exit with 1 after installing intercept hook

This will allow to register, in a single postinstall, multiple hooks.

(From OE-Core master rev: 9553874cf02ba443aff1bbead56bacfcda9bb6ca)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
gtk-icon-cache.bbclass: do not exit 1 after installing intercept hook

This will allow to register, in a single postinstall, multiple hooks.

(From OE-Core master rev: 2cd244d6c93ec6d39e2649de64575c365bd4238d)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
pixbufcache.bbclass: do not exit 1 after installing intercept hook

This will allow to register, in a single postinstall, multiple hooks.

(From OE-Core master rev: b396138ee081c8f5dddbaab0e374787ba2e31029)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
image.bbclass: change the logic when intercepts fail

Due to some issues with postinstalls that register hooks, we changed the
logic a bit. Now, all postinstalls that register hooks will return
successfully and only after, if hooks fail, mark the package as unpacked.

(From OE-Core master rev: 82dae98d0eb771c05e57635f0f8763b118d8177e)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
grub-efi-native: fix build on modern distributions without gets()

O irony: the grub2/gnulib nag macro that says "don't use gets, use fgets" breaks the build if you're using a recent (e)glibc release that has gets removed.

Fedora already #if 0's the check in grub, so I stole their patch.

(From OE-Core master rev: 261e377b08388a288ee521a3629877b89e18e42b)

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
pulseaudio: install alsa mixer data files

These data files are required for module-alsa-card to load properly

(From OE-Core master rev: 8dda0dc79f5c90f8d40450ba6215f44edcbacb8f)

Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
glib-2.0: disable tests for native builds, and respect ptest for LSB

Without disabling the tests in the native build, glib-2.0-native will need
libdbus-native to be present.  As we don't run the tests, disable them so we
don't have build failures due to missing dependencies.

Also, the LSB override was missing PTEST_CONF so the same problem could happen.
After adding PTEST_CONF the LSB override is identical to the non-overridden
EXTRA_OECONF, so remove it.

Finally, to be explicit, put --enable-module-tests in PTEST_CONF.

(From OE-Core master rev: 395b90054eccddc1c9062a9a8657ed4482b7710a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
udev-extraconf: Avoid mounting unknown filesystems

Depending on kernel version used, the system can hung when trying to
mount the extended partition (not the logical one) as it is a holder
for other partitions and does not have a filesystem in it.

To avoid this to happen we just mount partitions when these are using
known filesystems so it does not try to mount a partition for an
unsupported filesystem.

Reported-by: Vladan Jovanovic <vladan.jovanovic@gmail.com>
Reported-by: Leonardo Sandoval Gonzalez <b42214@freescale.com>
(From OE-Core master rev: 895c9685a7f95dc84786213f945895a504a16254)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Tested-by: Vladan Jovanovic <vladan.jovanovic@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
udev: create /var/volatile/tmp to avoid dead link

If it's not first boot, /tmp has already been symlinked to /var/volatile/tmp.
But the udev service starts before populate-volatile.sh starts. This leads to
a dead link at /tmp. As a result, trying to create any file under /tmp will
fail.

If a USB is plugged in before the populate-volatile.sh script starts, the
/tmp/.automount-$name file will not be created correctly. As a result, when
the USB is unplugged, the /media/$name directory is not removed.

So we create /var/volatile/tmp directory in the udev script to avoid this dead
link problem.

[YOCTO #3404]

(From OE-Core master rev: 2f93c8466ca146c965585ea38210ddb5fb5754bd)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
libxslt: Avoid regenerating manpage during "make install"

The timestamps in libxslt-1.1.28.tar.gz (specifically) are rather hokey, making
the source files for the documentation appear newer than the generated output:

-rw-rw-r-- 500/500       16307 2012-11-21 07:22 libxslt-1.1.28/doc/xsltproc.xml
-rw-rw-r-- 500/500        7082 2012-09-12 07:24 libxslt-1.1.28/doc/xsltproc2.html
-rw-rw-r-- 500/500        9475 2012-09-04 15:26 libxslt-1.1.28/doc/xsltproc.html
-rw-rw-r-- 500/500        8256 2012-11-21 06:03 libxslt-1.1.28/doc/xsltproc.1

This causes make to decide that xsltproc.1 needs to be regenerated during the
installation process.  However, this requires a native xsltproc binary which
may not be available, leading to errors like:

| make[2]: /usr/bin/xsltproc: Command not found
| make[2]: [xsltproc.1] Error 127 (ignored)

Adding DEPENDS_class-target = "libxslt-native", or installing xsltproc in the
host environment, fixes the above but the documentation still doesn't build:

| I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
| warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
| error
| xsltParseStylesheetFile : cannot parse http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
| compilation error: file ./xsltproc.xml line 10 element refentry
| xsltParseStylesheetProcess : document is not a stylesheet

And in any case, requiring libxslt-native would increase build time for no
real benefit.  So, let's just adjust the timestamp on the shipped copy of
xsltproc.1 to make it appear newer than the source files.

(From OE-Core master rev: 12074bf5319c1086f86efd00f502c91fed344698)

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
systemd-systemctl: parse unit files more correctly

Old script failed to parse unit files containing comments like

| #Alias=some-alias

or whitespaces like

| WantedBy = foo

correctly.  Patch changes script to interpret keywords only when they
are at the beginning of a line and ignores whitespaces before the '='.

(From OE-Core master rev: 443e75ee2c0e9a62df997aef24855bce54d39177)

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
cpan.bbclass: use '|' as sed separator for entry with paths

With normal toolchain it works. But fails badly when external Linaro
toolchain is used. And this is why:

-e "s/^\(CCFLAGS =.*\)/\1  -isystem/home/hrw/devel/canonical/aarch64/openembedded/build/linaro-tcwg/gcc-linaro-aarch64-linux-gnu-4.7-2013.04-20130415_linux//aarch64-linux-gnu/include  -O2 -pipe -g -feliminate-unused-debug-types/" \

(From OE-Core master rev: f6244a9d3da7c301f19efc114c2aaf39e5eec299)

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
rpm: change arch scoring items

Don't add the first line of /etc/rpm/platform to the list of patterns
to match when computing an arch score, use it just for getting
information about the platform (cpu/vendor/os).

[YOCTO #3864]

(From OE-Core master rev: 9263a2192ccf8ca513cbf7f2f88473e267e6b945)

Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
tune-thumb.inc: Remove, replaced by arm/feature-arm-thumb.inc

(From OE-Core master rev: f4b451c8ad8f857b1789d75d68ce8ea8fc73542e)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
conf/machine: use .= instead of += in TUNE_CCARGS

* number of TUNE_CCARGS conditionals is important if we add
  extra space with each one in "else" branch

  I'm building for 2 MACHINEs one is cortexa9, second is cortexa8

  few months ago we added TUNE_CCARGS[vardepvalue] in bitbake.conf
  http://git.openembedded.org/openembedded-core/commit/?id=03f1e34ea3ce80931e9c3cd2ab22824f28a7233b

  which fixed some cases (like mentioned tune-xscale and tune-arm926ejs)
  where both had unused TUNE_CCARGS when common DEFAULTTUNE was used.

  with cortexa[89] it's different, because cortexa9 has one extra TUNE_CCARGS
  TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "cortexa9", "-mtune=cortex-a9", "", d)}"
  which adds extra *space* even when not used because of '+=' and as result:

  $ bitbake-diffsigs tmp-eglibc/sstate-diff/1366797730/*/armv7*/adapterbase/*do_configure*
  basehash changed from f986789fb8fb3579ed6a3492cc8a8d10 to c851b5f838d945ee13072e9ad6725dca
  Variable TUNE_CCARGS value changed from
  ' -march=armv7-a     -mthumb-interwork -mfloat-abi=softfp -mfpu=neon '
  to
  ' -march=armv7-a     -mthumb-interwork -mfloat-abi=softfp -mfpu=neon  '
  Hash for dependent task gcc-runtime_4.7.bb.do_populate_sysroot changed from bdeabf7a86958b9110b566344b7916de to 2be5618e6bc8c57ec9db5659bf217915
  Hash for dependent task eglibc_2.17.bb.do_populate_sysroot changed from b4f40fc62dde684acd0a574532a55360 to 97fcb426603d4a1c1099c0504d2ebf7d
  Hash for dependent task glib-2.0_2.34.3.bb.do_populate_sysroot changed from fd2f90b83098c34e88d649d70f6ea4f5 to ebd740bb94ea3eb0a914efda6fc82c4a

(From OE-Core master rev: b7430ff83760ac29079d20dc7c62f498a0a9d55d)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
glib: Add --disable-man to configure arguments

Without this, glib will probe for the existence of xsltproc and use that
to decide whether or not it wants to generate manpages.  This has two
consequences, neither of them good:

a) the result of the build will vary depending on whether xsltproc
happens to be installed in either the native sysroot or the host
environment; and

b) if xsltproc does happen to be installed but docbook-xsl isn't, the
build will fail with "I/O error" messages.

(From OE-Core master rev: b2e2c6e1a20ea4c53dea04992bb1b38890a959dd)

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
qemuwrapper: use fallback in case the ELF binary is wrong

This wrapper script is called mainly from intercept hooks and allarch
packages postinstalls. When multilib is used, the qemuwrapper script
points to the binary that matches the MACHINE architecture.

For example: if MACHINE=qemux86_64 and we activate multilib, then the
postinstalls for lib32 packages would call qemu-x86_64 with 32 bit
binaries and they would certainly fail.

This patch adds just a fallback method if the exit code of the previous
qemu call corresponds to "Invalid ELF image for this architecture"
error. This will allow us to have all postinstalls run on host.

(From OE-Core master rev: 0c6ddb84043f0f917543cdaf4814efc15cd0273f)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
pango: fix postinstall when using multilib

The pango-query-modules binary gets a multilib prefix and the
postinstall has to call the appropriate binary.

(From OE-Core master rev: 21ae18ca5e3be0b3e5cb0fdcf19b1476dbd38b0c)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Revert "qemu.bbclass: Use the correct qemu binary in multilib cases"

This reverts commit 9f5a6f89d9f4a6c7bed3b163e6eaa764d762f523.

The reason for reverting this is:
 * qemuwrapper has now a fallback method;
 * when using multilib, calling qemu_target_binary from recipes would
   always point to the qemu binary corresponding to the machine
   architecture. Hence, postinstalls needing to use qemu would call the
   wrong qemu user emulation binary;

(From OE-Core master rev: 15408466515cec7cbb4c394aa203c87b6165f884)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/postinst-intercepts: create separete hooks for multilib

When using multilib, the hooks for lib32/lib64 must be different because
the libdir/base_libdir point to different locations. Postinstalls
calling postint_intercept script must pass the mlprefix in the 3rd
argument.

(From OE-Core master rev: 2c5c6e3ffcd561c25a34603922b622449f677a34)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>