summaryrefslogtreecommitdiffstats
path: root/meta/classes/qemu.bbclass
AgeCommit message (Collapse)Author
2022-08-12classes: Update classes to match new bitbake class scope functionalityRichard Purdie
Move classes to classes-global or classes-recipe as appropriate to take advantage of new bitbake functionality to check class scope/usage. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12classes: Add SPDX license identifiersRichard Purdie
As stated in our top level license files, the license is MIT unless otherwise stated. Add SPDX identifers accordingly. Replace older license statementa with the standardised syntax. Also drop "All Rights Reserved" expression as it isn't used now, doesn't mean anything and is confusing. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12classes: Add copyright statements to files without oneRichard Purdie
Where there isn't a copyright statement, add one to make it explicit. Also drop editor config lines where they were present. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-26qemu.bbclass: Extend ppc/ppc64 extra optionsKhem Raj
Some recipes are marked machine specific which need qemu usermode during build eg. if they use meson build system, which means they wont get right -cpu settings to run qemu-ppc/qemu-ppc64 and build fails, this ensures that we set the right options when PACKAGE_ARCH is set to MACHINE_ARCH on ppc/ppc64 qemu Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-01-07Revert "qemu.bbclass: drop OLDEST_KERNEL reference"Richard Purdie
This patch was merged on the basis that it wasn't needed with recent versions of qemu. That isn't true and has been showen to cause failures for aarch64 on centos7 hosts. Revert the patch as we'll need a different solution. This reverts commit 94b371e1c9e3cea787d70d6d7a09f7d3d69a30aa.
2021-12-20qemu.bbclass: drop OLDEST_KERNEL referenceMatt Madison
which is introducing task hash changes for some allarch package builds, and should no longer be needed with recent versions of qemu. Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-30Convert to new override syntaxRichard Purdie
This is the result of automated script conversion: scripts/contrib/convert-overrides.py <oe-core directory> converting the metadata to use ":" as the override character instead of "_". Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-22qemu: Enable ppc64le support for qemu-usermodeKhem Raj
glibc defines minimum kernel needed to be 3.10.0 for LE ppc64 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-06meta/scripts: Various getVar/getVarFlag expansion parameter fixesRichard Purdie
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). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16meta: remove True option to getVar callsJoshua Lock
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\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-09-23qemu.bbclass: Allow use different QEMU binary depending of targetOtavio Salvador
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" Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-15meta/classes/qemu.bbclass: set -cpu of ppce5500/ppce6500 to e500mcZhenhua Luo
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 Signed-off-by: Zhenhua Luo <zhenhua.luo@nxp.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09qemu.bbclass: add qemu_wrapper_cmdline()Alexander Kanavin
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. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-29qemu.bbclass: clarify QEMU_EXTRAOPTIONSAndre McCurdy
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. Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-11-24qemu.bbclass: fix vardeps of QEMU_OPTIONSChristopher Larson
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. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-11-24qemu.bbclass: correct the fsl ppc QEMU_EXTRAOPTIONSChristopher Larson
These need to be based on PACKAGE_ARCH rather than TARGET_ARCH, as we aren't using overrides for this. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05qemu/libc-package: Fix qemu option handlingRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-09-10qemu.bbclass: add -r ${OLDEST_KERNEL} parameterMartin Jansa
* 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}\ 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-06-14bitbake.conf/qemu: Move QEMU_OPTIONS to qemu.bbclassRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-29Revert "qemu.bbclass: Use the correct qemu binary in multilib cases"Laurentiu Palcu
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; Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-04-10postinst-intercepts, qemu.bbclass: fix segfaults in postinstallsLaurentiu Palcu
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. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-05postinst-intercepts, qemu.bbclass: fix issue on 32 bit hostsLaurentiu Palcu
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] Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-07qemu.bbclass: fix segfaults when running through pseudoLaurentiu Palcu
qemu user binaries sometimes segfault when running them through pseudo. So, set PSEUDO_UNLOAD to 1 before running any qemu binary. [YOCTO #3788] Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-07qemu.bbclass: Use the correct qemu binary in multilib casesRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06qemu.bbclass: return qemuwrapper instead of qemu-allarchLaurentiu Palcu
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] Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-01-09qemu.bbclass: add qemu_run_binary() functionLaurentiu Palcu
[YOCTO #3602] Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-07-26qemu.bbclass: Map the qemu binary name for powerpc64Khem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-07-19Remove a number of unneeded import os/bb callsRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19Convert tab indentation in python functions into four-spaceRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-22Fix common typoes "existant", "dependant" and variationsRobert P. J. Day
Fix a couple common typoes, all contained within comments so there should be no effect on functionality. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)Richard Purdie
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>
2011-11-10Convert to use direct access to the data store (instead of bb.data.*Var*())Richard Purdie
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 *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2010-08-13eglibc: import eglibc_2.12 recipe from OENitin A Kamble
use http proto for svn checkout cosmetic cleanups to metadata Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>