Commit Graph

25 Commits

Author SHA1 Message Date
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
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
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
Zhenhua Luo 27e202f2d9 meta/classes/qemu.bbclass: set -cpu of ppce5500/ppce6500 to e500mc
The e5500 and e6500 cpu types are not supported by native qemu, set the value
of -cpu to e500mc. Without this change, build will fail for packages which use
qemuwrapper in compile phase due to the following error.
| Unable to find CPU definition

e.g. gobject-introspection

(From OE-Core rev: e06c5c5447350049ebd1a6245fc2dd2608b265e5)

Signed-off-by: Zhenhua Luo <zhenhua.luo@nxp.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-15 06:59:43 +01: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
Andre McCurdy f80d16e4d3 qemu.bbclass: clarify QEMU_EXTRAOPTIONS
QEMU_EXTRAOPTIONS is a way to add PACKAGE_ARCH specific options to the
qemu_run_binary qemu commandline. The base QEMU_EXTRAOPTIONS variable
(ie without a PACKAGE_ARCH suffix) is not used, so defining it, either
directly or via an over-ride has no effect.

Although previously an over-ride for _armv7a was used, it did nothing
for most armv7a builds, which typically use PACKAGE_ARCH values such
as "cortexa9hf-neon". In practice this worked OK since without a -cpu
option, qemu-arm will default to emulating a CPU which supports all
required architecture levels.

qemu-arm (v2.5.0) with no -cpu option has been confirmed to
successfully run binaries built for armv7ve.

(From OE-Core rev: 62b25b3489b44969e4adad657daebfaffdb4de56)

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-01-30 11:37:01 +00:00
Christopher Larson 13a4c383c1 qemu.bbclass: fix vardeps of QEMU_OPTIONS
The variable name for QEMU_EXTRAOPTIONS is constructed programmatically, so we
need an explicit variable dependency, otherwise changes to it won't cause e.g.
qemuwrapper-cross to be rebuilt.

(From OE-Core rev: 7740f214fffd6278f801899fc5e45f5720cbb544)

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>
2015-11-24 15:55:41 +00:00
Christopher Larson 51bd011f8b qemu.bbclass: correct the fsl ppc QEMU_EXTRAOPTIONS
These need to be based on PACKAGE_ARCH rather than TARGET_ARCH, as we aren't
using overrides for this.

(From OE-Core rev: 46f41df60491990dc41f0514f63b304ac51b67d1)

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>
2015-11-24 15:55:41 +00:00
Richard Purdie b813bdebb3 qemu/libc-package: Fix qemu option handling
The 'overrides' here are PACKAGE_ARCH based and hence not overrides
as such and the _append wasn't working in many cases. This adjusts the
code to use PACKAGE_ARCH as the accessor and ensures the variables
work as expected. This fixes various segfaults and ensures postinsts
run at build time rather than on the target system.

The bug was introduced in http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=7efad8a1b56df6ee07c12ad360c0493d7b1d6d23.

(From OE-Core rev: 219e793907406eabf632e784e3a11ab9acb77cfb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-05 18:01:08 +00: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
Richard Purdie 6ad8d642d2 bitbake.conf/qemu: Move QEMU_OPTIONS to qemu.bbclass
The QEMU_OPTIONS variables belong in qemu.bbclass so move them there. The
only users of them inherit qemu.bbclass. There is no point in pushing
these into every recipe.

(From OE-Core rev: 5824293de37919e89f60192836997281933e23d6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-14 08:43:56 +01:00
Laurentiu Palcu cf76b424f5 Revert "qemu.bbclass: Use the correct qemu binary in multilib cases"
This reverts commit 9f5a6f89d9.

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 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>
2013-04-29 14:45:10 +01:00
Laurentiu Palcu 2435d807d1 postinst-intercepts, qemu.bbclass: fix segfaults in postinstalls
Postinstalls that use qemu are throwing a segmentation fault when
building for qemux86-64 on a 64bit host (it might also happen for
qemux86 if building on a 32bit host but I didn't test). It looks like
qemu looks for ld.so.cache which is not found because it is generated
after rootfs_(rpm|ipk|deb)_do_rootfs is called and then it tries to load
libraries from the default paths (which are the host's). In order to
avoid this, pass the LD_LIBRARY_PATH explicitly to the target's dynamic
loader.

(From OE-Core rev: 48e8b613b3f5c7b1d917bf3147606d44072ce49e)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-10 12:56:52 +01:00
Laurentiu Palcu 1872ee316b postinst-intercepts, qemu.bbclass: fix issue on 32 bit hosts
The intercept scripts fail to run on 32 bit hosts. Apparently, the
current approach worked on 64 bit hosts due to the larger virtual address
space (probably). On 32 bit hosts, however, calling the target binary like:

qemu-arm ld-linux.so --library-path /lib:/usr/lib arm_binary

fails with:

arm_binary: error while loading shared libraries: arm_binary: failed to
map segment from shared object: Operation not permitted

When run like this, qemu-arm fails to map the arm_binary executable in
memory because it's hitting the lower limit of
/proc/sys/vm/mmap_min_addr. That's because it loads the
ld-linux.so binary successfully, taking into account mmap_min_addr, runs
it, and then ld-linux.so will map the arm_binary at a fixed address but this
will fail because it is below mmap_min_addr. The qemu's guest base probing,
apparently, doesn't work fine when a program runs inside other.

One way around this would be to set mmap_min_addr to 0 (on recent
distributions is set to 65536 to avoid "kernel NULL pointer dereference"
defects) but this approach is not safe.

The other way is to call the binary directly but providing qemu with a
prefix (-L option) in order to find the elf interpreter correctly. This
way, both the target binary and dynamic loader are mapped into memory
under qemu's control and, only after, the dynamic loader is started.

[YOCTO #4179]

(From OE-Core rev: 78f91e08c8a7b0f0c831a087f7c89e2c76047e7a)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-05 17:36:34 +01:00
Laurentiu Palcu 8c263420ed qemu.bbclass: fix segfaults when running through pseudo
qemu user binaries sometimes segfault when running them through pseudo.
So, set PSEUDO_UNLOAD to 1 before running any qemu binary.

[YOCTO #3788]

(From OE-Core rev: 688e9485980de0f29aa00e24ce53a3efd3a3a7cc)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-07 16:50:47 +00:00
Richard Purdie 9f5a6f89d9 qemu.bbclass: Use the correct qemu binary in multilib cases
For example with a lib32 multilib, we need to still use the 64 bit
qemu binary in case we do encounter a 64 bit binary.

(From OE-Core rev: e8ec13a26217bf473504ae4aab22b134dd9dffff)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-07 15:25:07 +00:00
Laurentiu Palcu f33014f607 qemu.bbclass: return qemuwrapper instead of qemu-allarch
When qemu bbclass is inherited from a recipe that is not architecture
dependent, qemu_run_binary will return "qemu-allarch". However this
binary does not exist. Instead, return "qemuwrapper" which will, in
turn, execute the right binary for the target the image was built for.

[YOCTO #2599]

(From OE-Core rev: 149a564bba7d3e1c2054ae6d908835ebd95b9084)

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>
2013-02-06 09:37:23 +00:00
Laurentiu Palcu aab3c1306f qemu.bbclass: add qemu_run_binary() function
[YOCTO #3602]

(From OE-Core rev: 2cfbe0bd9d02ab8c054e5bc879a2181c6a7e3719)

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>
2013-01-10 23:43:15 +00:00
Khem Raj bedae2815e qemu.bbclass: Map the qemu binary name for powerpc64
(From OE-Core rev: b9c7b050eb3e51c98f95feb8cf19f45ff2cc8700)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-26 14:40:46 +01:00
Richard Purdie 73cf0335c4 Remove a number of unneeded import os/bb calls
The bb and os modules are always imported so having these extra import calls
are a waste of space/execution time. They also set a bad example for people
copy and pasting code so clean them up.

(From OE-Core rev: 7d674820958be3a7051ea619effe1a6061d9cbe2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 12:24:50 +01:00
Richard Purdie bfd279de32 Convert tab indentation in python functions into four-space
(From OE-Core rev: 604d46c686d06d62d5a07b9c7f4fa170f99307d8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 10:24:50 +01:00
Robert P. J. Day 9e3c79cfe8 Fix common typoes "existant", "dependant" and variations
Fix a couple common typoes, all contained within comments so there
should be no effect on functionality.

(From OE-Core rev: dc52c3cbf3a7b7242d53019f7643495eb40c0566)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-22 16:47:06 +00:00
Richard Purdie 06f2f8ce0a meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)
Using "1" with getVar is bad coding style and "True" is preferred.
This patch is a sed over the meta directory of the form:

sed \
 -e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \
 -e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \
 -i `grep -ril getVar *`

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05 10:22:56 -08:00
Richard Purdie c8dee9b92d Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:

sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`

(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10 11:51:19 +00:00
Nitin A Kamble 512d3b713c eglibc: import eglibc_2.12 recipe from OE
use http proto for svn checkout
cosmetic cleanups to metadata

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-08-13 23:37:30 +01:00