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 | |
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>
-rw-r--r-- | recipes-extended/xen/README | 3 | ||||
-rw-r--r-- | recipes-extended/xen/files/0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch | 49 | ||||
-rw-r--r-- | recipes-extended/xen/xen-hypervisor.inc | 49 | ||||
-rw-r--r-- | recipes-extended/xen/xen_4.14.bb | 1 | ||||
-rw-r--r-- | recipes-extended/xen/xen_git.bb | 1 |
5 files changed, 73 insertions, 30 deletions
diff --git a/recipes-extended/xen/README b/recipes-extended/xen/README index 34e79774..f286bb54 100644 --- a/recipes-extended/xen/README +++ b/recipes-extended/xen/README | |||
@@ -25,6 +25,9 @@ Select the config settings that you want and Save the file. If you save it to | |||
25 | the default ".config" file when prompted by menuconfig, you can find it in the | 25 | the default ".config" file when prompted by menuconfig, you can find it in the |
26 | 'xen' subdirectory of the build tree. | 26 | 'xen' subdirectory of the build tree. |
27 | 27 | ||
28 | Configuration fragments are also supported. To use them you need to list the | ||
29 | .cfg files in the SRC_URI. | ||
30 | |||
28 | security patches | 31 | security patches |
29 | ---------------- | 32 | ---------------- |
30 | 33 | ||
diff --git a/recipes-extended/xen/files/0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch b/recipes-extended/xen/files/0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch new file mode 100644 index 00000000..22b67c40 --- /dev/null +++ b/recipes-extended/xen/files/0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | Upstream-Status: Xen: Inappropriate [oe specific, cross compile issue] | ||
2 | Upstream-Status: Kernel: Pending | ||
3 | Signed-off-by: Diego Sueiro <diego.sueiro@arm.com> | ||
4 | commit e6972e689a980ab28637e94e48c77eeace6abde5 | ||
5 | Author: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
6 | Date: Mon Jul 2 23:10:28 2018 -0400 | ||
7 | |||
8 | xen/kconfig,menuconfig,mconf-cfg: Allow specification of ncurses location | ||
9 | |||
10 | In some cross build environments such as the Yocto Project build | ||
11 | environment it provides an ncurses library that is compiled | ||
12 | differently than the host's version. This causes display corruption | ||
13 | problems when the host's curses includes are used instead of the | ||
14 | includes from the provided compiler are overridden. There is a second | ||
15 | case where there is no curses libraries at all on the host system and | ||
16 | menuconfig will just fail entirely. | ||
17 | |||
18 | The solution is simply to allow an override variable in | ||
19 | check-lxdialog.sh for environments such as the Yocto Project. Adding | ||
20 | a CROSS_CURSES_LIB and CROSS_CURSES_INC solves the issue and allowing | ||
21 | compiling and linking against the right headers and libraries. | ||
22 | |||
23 | Change-Id: Ibe8dfafc90655e3be2671dbbb0cb7f5631fc4d44 | ||
24 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | ||
25 | cc: Michal Marek <mmarek@suse.cz> | ||
26 | cc: linux-kbuild@vger.kernel.org | ||
27 | Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
28 | |||
29 | diff --git a/xen/tools/kconfig/mconf-cfg.sh b/xen/tools/kconfig/mconf-cfg.sh | ||
30 | old mode 100755 | ||
31 | new mode 100644 | ||
32 | index c812872..65a9b9e | ||
33 | --- a/xen/tools/kconfig/mconf-cfg.sh | ||
34 | +++ b/xen/tools/kconfig/mconf-cfg.sh | ||
35 | @@ -4,6 +4,14 @@ | ||
36 | PKG="ncursesw" | ||
37 | PKG2="ncurses" | ||
38 | |||
39 | +if [ "$CROSS_CURSES_LIB" != "" ]; then | ||
40 | + echo libs=\'$CROSS_CURSES_LIB\' | ||
41 | + if [ x"$CROSS_CURSES_INC" != x ]; then | ||
42 | + echo cflags=\'$CROSS_CURSES_INC\' | ||
43 | + fi | ||
44 | + exit 0 | ||
45 | +fi | ||
46 | + | ||
47 | if [ -n "$(command -v pkg-config)" ]; then | ||
48 | if pkg-config --exists $PKG; then | ||
49 | echo cflags=\"$(pkg-config --cflags $PKG)\" | ||
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 | ||
diff --git a/recipes-extended/xen/xen_4.14.bb b/recipes-extended/xen/xen_4.14.bb index 0413bee1..91e89883 100644 --- a/recipes-extended/xen/xen_4.14.bb +++ b/recipes-extended/xen/xen_4.14.bb | |||
@@ -6,6 +6,7 @@ XEN_BRANCH ?= "stable-${XEN_REL}" | |||
6 | SRC_URI = " \ | 6 | SRC_URI = " \ |
7 | git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \ | 7 | git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \ |
8 | file://xen-arm64-implement-atomic-fetch-add.patch \ | 8 | file://xen-arm64-implement-atomic-fetch-add.patch \ |
9 | file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \ | ||
9 | " | 10 | " |
10 | 11 | ||
11 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=419739e325a50f3d7b4501338e44a4e5" | 12 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=419739e325a50f3d7b4501338e44a4e5" |
diff --git a/recipes-extended/xen/xen_git.bb b/recipes-extended/xen/xen_git.bb index 408bc3b3..57791fc4 100644 --- a/recipes-extended/xen/xen_git.bb +++ b/recipes-extended/xen/xen_git.bb | |||
@@ -6,6 +6,7 @@ XEN_BRANCH ?= "master" | |||
6 | SRC_URI = " \ | 6 | SRC_URI = " \ |
7 | git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \ | 7 | git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \ |
8 | file://xen-arm64-implement-atomic-fetch-add.patch \ | 8 | file://xen-arm64-implement-atomic-fetch-add.patch \ |
9 | file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \ | ||
9 | " | 10 | " |
10 | 11 | ||
11 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=419739e325a50f3d7b4501338e44a4e5" | 12 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=419739e325a50f3d7b4501338e44a4e5" |