diff options
| author | Christopher Clark <christopher.clark6@baesystems.com> | 2017-09-13 18:16:21 -0700 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-09-14 16:00:43 -0400 |
| commit | 1d9e1bd99db93c1394f51f59dd3e2a3dec15c04d (patch) | |
| tree | 87d73a8d5731c248d3765aa10518f59ec43cc081 | |
| parent | 01a8d4537012ad93dc8510e9b762acdc8c4536c7 (diff) | |
| download | meta-virtualization-1d9e1bd99db93c1394f51f59dd3e2a3dec15c04d.tar.gz | |
xen: Add menuconfig task and enable menuconfig from devshell
Xen supports Kconfig for configuring optional build settings.
This commit adds the menuconfig task to simplify interactive use:
bitbake xen -c menuconfig
and also ensures that menuconfig works when using the devshell.
This change adds ncurses-native as a build dependency.
Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
| -rw-r--r-- | recipes-extended/xen/xen.inc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc index ab699873..3ca38fba 100644 --- a/recipes-extended/xen/xen.inc +++ b/recipes-extended/xen/xen.inc | |||
| @@ -30,6 +30,7 @@ DEPENDS = " \ | |||
| 30 | flex-native \ | 30 | flex-native \ |
| 31 | file-native \ | 31 | file-native \ |
| 32 | iasl-native \ | 32 | iasl-native \ |
| 33 | ncurses-native \ | ||
| 33 | util-linux-native \ | 34 | util-linux-native \ |
| 34 | xz-native \ | 35 | xz-native \ |
| 35 | bridge-utils \ | 36 | bridge-utils \ |
| @@ -1006,3 +1007,37 @@ do_deploy() { | |||
| 1006 | } | 1007 | } |
| 1007 | 1008 | ||
| 1008 | addtask deploy after do_populate_sysroot | 1009 | addtask deploy after do_populate_sysroot |
| 1010 | |||
| 1011 | # Enable use of menuconfig directly from bitbake and also within the devshell | ||
| 1012 | OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO" | ||
| 1013 | HOST_EXTRACFLAGS = "${BUILD_CFLAGS} ${BUILD_LDFLAGS}" | ||
| 1014 | HOSTLDFLAGS = "${BUILD_LDFLAGS}" | ||
| 1015 | TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo" | ||
| 1016 | do_devshell[depends] += "ncurses-native:do_populate_sysroot" | ||
| 1017 | |||
| 1018 | KCONFIG_CONFIG_COMMAND ??= "menuconfig" | ||
| 1019 | python do_menuconfig() { | ||
| 1020 | import shutil | ||
| 1021 | |||
| 1022 | try: | ||
| 1023 | mtime = os.path.getmtime("xen/.config") | ||
| 1024 | shutil.copy("xen/.config", "xen/.config.orig") | ||
| 1025 | except OSError: | ||
| 1026 | mtime = 0 | ||
| 1027 | |||
| 1028 | 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'), | ||
| 1029 | d.getVar('PN') + ' Configuration', d) | ||
| 1030 | |||
| 1031 | try: | ||
| 1032 | newmtime = os.path.getmtime("xen/.config") | ||
| 1033 | except OSError: | ||
| 1034 | newmtime = 0 | ||
| 1035 | |||
| 1036 | if newmtime > mtime: | ||
| 1037 | bb.note("Configuration changed, recompile will be forced") | ||
| 1038 | bb.build.write_taint('do_compile', d) | ||
| 1039 | } | ||
| 1040 | do_menuconfig[depends] += "ncurses-native:do_populate_sysroot" | ||
| 1041 | do_menuconfig[nostamp] = "1" | ||
| 1042 | do_menuconfig[dirs] = "${B}" | ||
| 1043 | addtask menuconfig after do_configure | ||
