diff options
Diffstat (limited to 'recipes-extended/xen/xen-hypervisor.inc')
| -rw-r--r-- | recipes-extended/xen/xen-hypervisor.inc | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/recipes-extended/xen/xen-hypervisor.inc b/recipes-extended/xen/xen-hypervisor.inc new file mode 100644 index 00000000..c0df1580 --- /dev/null +++ b/recipes-extended/xen/xen-hypervisor.inc | |||
| @@ -0,0 +1,94 @@ | |||
| 1 | SUMMARY = "Xen hypervisor" | ||
| 2 | DESCRIPTION = "The Xen hypervisor" | ||
| 3 | |||
| 4 | # This recipe is for just the Xen hypervisor. | ||
| 5 | # Separate recipes are used to build Xen and its components: | ||
| 6 | # this allows for varying the target architecture or toolchain used | ||
| 7 | # to build the different components. eg. 32-bit tools and a 64-bit hypervisor. | ||
| 8 | |||
| 9 | inherit deploy | ||
| 10 | |||
| 11 | PACKAGES = " \ | ||
| 12 | ${PN} \ | ||
| 13 | ${PN}-dbg \ | ||
| 14 | ${PN}-efi \ | ||
| 15 | " | ||
| 16 | |||
| 17 | FILES_${PN} = " \ | ||
| 18 | /boot/xen-* \ | ||
| 19 | /boot/xen \ | ||
| 20 | /boot/xen-*.gz \ | ||
| 21 | /boot/xen.gz \ | ||
| 22 | /boot/xen-syms-* \ | ||
| 23 | " | ||
| 24 | |||
| 25 | FILES_${PN}-dbg += "${libdir}/debug/*" | ||
| 26 | |||
| 27 | FILES_${PN}-efi = " \ | ||
| 28 | /boot/xen.efi \ | ||
| 29 | ${exec_prefix}/lib64/efi/xen* \ | ||
| 30 | " | ||
| 31 | |||
| 32 | do_configure() { | ||
| 33 | do_configure_common | ||
| 34 | } | ||
| 35 | |||
| 36 | do_compile() { | ||
| 37 | oe_runmake xen | ||
| 38 | } | ||
| 39 | |||
| 40 | do_install() { | ||
| 41 | oe_runmake DESTDIR="${D}" install-xen | ||
| 42 | } | ||
| 43 | |||
| 44 | do_deploy() { | ||
| 45 | install -d ${DEPLOYDIR} | ||
| 46 | |||
| 47 | if [ -f ${D}/boot/xen ]; then | ||
| 48 | install -m 0644 ${D}/boot/xen ${DEPLOYDIR}/xen-${MACHINE} | ||
| 49 | fi | ||
| 50 | |||
| 51 | if [ -f ${D}/boot/xen.gz ]; then | ||
| 52 | install -m 0644 ${D}/boot/xen.gz ${DEPLOYDIR}/xen-${MACHINE}.gz | ||
| 53 | fi | ||
| 54 | |||
| 55 | if [ -f ${D}/usr/lib64/efi/xen.efi ]; then | ||
| 56 | install -m 0644 ${D}/usr/lib64/efi/xen.efi ${DEPLOYDIR}/xen-${MACHINE}.efi | ||
| 57 | fi | ||
| 58 | } | ||
| 59 | |||
| 60 | addtask deploy after do_populate_sysroot | ||
| 61 | |||
| 62 | # Enable use of menuconfig directly from bitbake and also within the devshell | ||
| 63 | OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO" | ||
| 64 | HOST_EXTRACFLAGS = "${BUILD_CFLAGS} ${BUILD_LDFLAGS}" | ||
| 65 | HOSTLDFLAGS = "${BUILD_LDFLAGS}" | ||
| 66 | TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo" | ||
| 67 | do_devshell[depends] += "ncurses-native:do_populate_sysroot" | ||
| 68 | |||
| 69 | KCONFIG_CONFIG_COMMAND ??= "menuconfig" | ||
| 70 | python do_menuconfig() { | ||
| 71 | import shutil | ||
| 72 | |||
| 73 | try: | ||
| 74 | mtime = os.path.getmtime("xen/.config") | ||
| 75 | shutil.copy("xen/.config", "xen/.config.orig") | ||
| 76 | except OSError: | ||
| 77 | mtime = 0 | ||
| 78 | |||
| 79 | 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'), | ||
| 80 | d.getVar('PN') + ' Configuration', d) | ||
| 81 | |||
| 82 | try: | ||
| 83 | newmtime = os.path.getmtime("xen/.config") | ||
| 84 | except OSError: | ||
| 85 | newmtime = 0 | ||
| 86 | |||
| 87 | if newmtime > mtime: | ||
| 88 | bb.note("Configuration changed, recompile will be forced") | ||
| 89 | bb.build.write_taint('do_compile', d) | ||
| 90 | } | ||
| 91 | do_menuconfig[depends] += "ncurses-native:do_populate_sysroot" | ||
| 92 | do_menuconfig[nostamp] = "1" | ||
| 93 | do_menuconfig[dirs] = "${B}" | ||
| 94 | addtask menuconfig after do_configure | ||
