From 3119a03a3db979541a5a20884e393c3b0868f9b5 Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Fri, 14 Apr 2017 00:05:20 +1000 Subject: qemuboot-xilinx.bbclass: Rework qemu-xilinx setup This change reworks how the meta-xilinx layer enables and provides the custom version of QEMU based on Xilinx's fork of QEMU. The existing implementation relied on the single sysroot which was changed in oe-core such that now recipes have their own sysroots (RSS support). Additionally oe-core now provides the QEMU binaries to the runqemu script via the 'qemu-helper-native' recipes sysroot as opposed to the image sysroot. These rework changes allow for a single machine to select the targeted QEMU version as well as to provide the qemuboot config specific to the targeted QEMU version. The selection of QEMU version is now handled by PREFERRED_PROVIDER mechanics with the meta-xilinx layer providing an additional recipe that is equivalent to qemu-helper-native and which also provides said target allowing for the machine to select via the use of PREFERRED_PROVIDER_qemu-helper-native. This recipe (qemu-xilinx-helper-native) however instead provides the sysroot populated with qemu-xilinx instead of qemu. Additionally the XILINX_QEMUBOOT variable is replaced with the qemuboot-xilinx.bbclass, this provides the overrides for setting up qemu-xilinx specific QB_* args. Additionally this bbclass points runqemu at the qemu-xilinx-helper-native sysroot for QEMU binaries. These changes also work towards making the meta-xilinx layer better handle multiple qemuboot.conf variants as well as handling different QEMU versions. This change also removes the 'qemu-system-xilinx' MACHINE_FEATURES, this is due to MACHINE_FEATURES no longer being available for native recipes. Additionally there is no longer any logic that needs to know this any way. Signed-off-by: Nathan Rossi Reviewed-by: Alistair Francis --- .../qemu/qemu-xilinx-helper-native_1.0.bb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb (limited to 'recipes-devtools') diff --git a/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb b/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb new file mode 100644 index 00000000..f04be960 --- /dev/null +++ b/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb @@ -0,0 +1,20 @@ + +def get_filespath_extra(d, subpath): + metaroot = next((p for p in d.getVar('BBPATH').split(':') if os.path.basename(p) == 'meta'), None) + if metaroot: + return os.path.join(metaroot, subpath) + ":" + return "" + +# TODO: improve this, since it is very hacky that this recipe need to build tunctl. +# include the existing qemu-helper-native +require recipes-devtools/qemu/qemu-helper-native_1.0.bb +# get the path to tunctl.c +FILESEXTRAPATHS_prepend := "${@get_filespath_extra(d, 'recipes-devtools/qemu/qemu-helper')}" + +# provide it, to replace the existing +PROVIDES += "qemu-helper-native" + +# replace qemu with qemu-xilinx +DEPENDS_remove = "qemu-native" +DEPENDS_append = " qemu-xilinx-native" + -- cgit v1.2.3-54-g00ecf