diff options
author | Diego Sueiro <diego.sueiro@arm.com> | 2020-08-14 10:56:33 +0100 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-08-27 16:28:58 -0400 |
commit | b2cd5f340ea220360e3fb90282c75994d9e553ca (patch) | |
tree | 0176b728f0cd154e0ddf7ac1738864731f1d7cd6 /recipes-extended/xen/xen-hypervisor.inc | |
parent | 3fafab50cf510a99ad1d0ab4e6f0402721716b35 (diff) | |
download | meta-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.inc | 49 |
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 |
10 | COMPATIBLE_HOST = '(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi' | 10 | COMPATIBLE_HOST = '(x86_64.*).*-linux|aarch64.*-linux|arm-.*-linux-gnueabi' |
11 | 11 | ||
12 | inherit deploy python3native | 12 | inherit deploy python3native cml1 |
13 | 13 | ||
14 | PACKAGES = " \ | 14 | PACKAGES = " \ |
15 | ${PN} \ | 15 | ${PN} \ |
@@ -34,6 +34,18 @@ FILES_${PN}-efi = " \ | |||
34 | 34 | ||
35 | do_configure() { | 35 | do_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 | ||
39 | do_compile() { | 51 | do_compile() { |
@@ -77,35 +89,12 @@ do_deploy[depends] += "xen-tools:do_populate_sysroot" | |||
77 | do_deploy[depends] += "xen-tools:do_deploy" | 89 | do_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 |
80 | OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO" | ||
81 | HOST_EXTRACFLAGS = "${BUILD_CFLAGS} ${BUILD_LDFLAGS}" | ||
82 | HOSTLDFLAGS = "${BUILD_LDFLAGS}" | ||
83 | TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo" | ||
84 | do_devshell[depends] += "ncurses-native:do_populate_sysroot" | 92 | do_devshell[depends] += "ncurses-native:do_populate_sysroot" |
85 | 93 | ||
86 | KCONFIG_CONFIG_COMMAND ??= "menuconfig" | 94 | # Pass the native library path for kconfig build when running the do_menuconfig |
87 | python do_menuconfig() { | 95 | # task |
88 | import shutil | 96 | CROSS_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 | 100 | KCONFIG_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 | } | ||
108 | do_menuconfig[depends] += "ncurses-native:do_populate_sysroot" | ||
109 | do_menuconfig[nostamp] = "1" | ||
110 | do_menuconfig[dirs] = "${B}" | ||
111 | addtask menuconfig after do_configure | ||