summaryrefslogtreecommitdiffstats
path: root/recipes-extended/xen/xen-hypervisor.inc
diff options
context:
space:
mode:
authorDiego Sueiro <diego.sueiro@arm.com>2020-08-14 10:56:33 +0100
committerBruce Ashfield <bruce.ashfield@gmail.com>2020-08-27 16:28:58 -0400
commitb2cd5f340ea220360e3fb90282c75994d9e553ca (patch)
tree0176b728f0cd154e0ddf7ac1738864731f1d7cd6 /recipes-extended/xen/xen-hypervisor.inc
parent3fafab50cf510a99ad1d0ab4e6f0402721716b35 (diff)
downloadmeta-virtualization-b2cd5f340ea220360e3fb90282c75994d9e553ca.tar.gz
xen: Fix menuconfig and add support for config fragments and diffconfig
This patch introduces the following changes: 1. When building in OE environment the linker path needs to be passed when buildind the Kconfig tool in order to get the menuconfig task properly working. 2. By inheriting cml1.bbclass we can drop some environment variables settings in xen-hypervisor.inc for the menuconfig task, and also be able to search for config fragmens and use the diffconfig task. Also, there is no need to have a custom do_menuconfig task anymore. Change-Id: I8d61ec76d92de7d1613b79edf55b4868fe712334 Signed-off-by: Diego Sueiro <diego.sueiro@arm.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-extended/xen/xen-hypervisor.inc')
-rw-r--r--recipes-extended/xen/xen-hypervisor.inc49
1 files changed, 19 insertions, 30 deletions
diff --git a/recipes-extended/xen/xen-hypervisor.inc b/recipes-extended/xen/xen-hypervisor.inc
index c386917d..3bfee8ee 100644
--- a/recipes-extended/xen/xen-hypervisor.inc
+++ b/recipes-extended/xen/xen-hypervisor.inc
@@ -9,7 +9,7 @@ DESCRIPTION = "The Xen hypervisor"
9# The Xen hypervisor has a narrower compatible platform range than the Xen tools 9# The Xen hypervisor has a narrower compatible platform range than the Xen tools
10COMPATIBLE_HOST = '(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi' 10COMPATIBLE_HOST = '(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi'
11 11
12inherit deploy python3native 12inherit deploy python3native cml1
13 13
14PACKAGES = " \ 14PACKAGES = " \
15 ${PN} \ 15 ${PN} \
@@ -34,6 +34,18 @@ FILES_${PN}-efi = " \
34 34
35do_configure() { 35do_configure() {
36 do_configure_common 36 do_configure_common
37
38 # Handle the config fragments
39 cfgs="${@' '.join(find_cfgs(d))}"
40 if [ -n "${cfgs}" ]; then
41 # If .config is not present generate one in order
42 # to use the merge_config.sh
43 if [ ! -f "${S}/xen/.config" ] ; then
44 oe_runmake -C ${S}/xen defconfig
45 fi
46 ${S}/xen/tools/kconfig/merge_config.sh -m -O \
47 ${S}/xen ${S}/xen/.config "${cfgs}"
48 fi
37} 49}
38 50
39do_compile() { 51do_compile() {
@@ -77,35 +89,12 @@ do_deploy[depends] += "xen-tools:do_populate_sysroot"
77do_deploy[depends] += "xen-tools:do_deploy" 89do_deploy[depends] += "xen-tools:do_deploy"
78 90
79# Enable use of menuconfig directly from bitbake and also within the devshell 91# Enable use of menuconfig directly from bitbake and also within the devshell
80OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO"
81HOST_EXTRACFLAGS = "${BUILD_CFLAGS} ${BUILD_LDFLAGS}"
82HOSTLDFLAGS = "${BUILD_LDFLAGS}"
83TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo"
84do_devshell[depends] += "ncurses-native:do_populate_sysroot" 92do_devshell[depends] += "ncurses-native:do_populate_sysroot"
85 93
86KCONFIG_CONFIG_COMMAND ??= "menuconfig" 94# Pass the native library path for kconfig build when running the do_menuconfig
87python do_menuconfig() { 95# task
88 import shutil 96CROSS_CURSES_LIB += "-L${STAGING_LIBDIR_NATIVE}"
89
90 try:
91 mtime = os.path.getmtime("xen/.config")
92 shutil.copy("xen/.config", "xen/.config.orig")
93 except OSError:
94 mtime = 0
95 97
96 oe_terminal("${SHELL} -c \"cd xen; XEN_CONFIG_EXPERT=y make %s; if [ \$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"" % d.getVar('KCONFIG_CONFIG_COMMAND'), 98# Specify the root dir of the .config file for do_menuconfig and do_diffconfig
97 d.getVar('PN') + ' Configuration', d) 99# tasks
98 100KCONFIG_CONFIG_ROOTDIR = "${S}/xen"
99 try:
100 newmtime = os.path.getmtime("xen/.config")
101 except OSError:
102 newmtime = 0
103
104 if newmtime > mtime:
105 bb.note("Configuration changed, recompile will be forced")
106 bb.build.write_taint('do_compile', d)
107}
108do_menuconfig[depends] += "ncurses-native:do_populate_sysroot"
109do_menuconfig[nostamp] = "1"
110do_menuconfig[dirs] = "${B}"
111addtask menuconfig after do_configure