diff options
Diffstat (limited to 'recipes-jailhouse/jailhouse/jailhouse.inc')
-rw-r--r-- | recipes-jailhouse/jailhouse/jailhouse.inc | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/recipes-jailhouse/jailhouse/jailhouse.inc b/recipes-jailhouse/jailhouse/jailhouse.inc new file mode 100644 index 0000000..2c30725 --- /dev/null +++ b/recipes-jailhouse/jailhouse/jailhouse.inc | |||
@@ -0,0 +1,82 @@ | |||
1 | SUMMARY = "Jailhouse" | ||
2 | HOMEPAGE = "https://github.com/siemens/jailhouse" | ||
3 | SECTION = "jailhouse" | ||
4 | LICENSE = "GPL-2.0 & BSD-2-Clause" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=9fa7f895f96bde2d47fd5b7d95b6ba4d \ | ||
6 | file://tools/root-cell-config.c.tmpl;beginline=6;endline=33;md5=2825581c1666c44a17955dc574cfbfb3 \ | ||
7 | file://hypervisor/include/jailhouse/hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \ | ||
8 | file://hypervisor/include/jailhouse/cell-config.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \ | ||
9 | file://hypervisor/arch/arm/include/asm/jailhouse_hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \ | ||
10 | file://hypervisor/arch/x86/include/asm/jailhouse_hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \ | ||
11 | file://driver/jailhouse.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3" | ||
12 | |||
13 | DEPENDS = "virtual/kernel make-native python-mako-native dtc-native python-mako" | ||
14 | |||
15 | S ="${WORKDIR}/git" | ||
16 | |||
17 | JH_DATADIR="${datadir}/jailhouse" | ||
18 | CELL_DIR ?= "${JH_DATADIR}/cells" | ||
19 | CELLCONF_DIR ?= "${JH_DATADIR}/configs" | ||
20 | INMATES_DIR ?= "${JH_DATADIR}/inmates" | ||
21 | |||
22 | export PACKAGECONFIG_CONFARGS | ||
23 | |||
24 | inherit module pythonnative bash-completion | ||
25 | |||
26 | do_configure() { | ||
27 | # Copy all cell configs included through PACKAGECONFIG | ||
28 | for arg in $(echo $PACKAGECONFIG_CONFARGS); do | ||
29 | if conf=$(echo $arg | grep -o "with-.*$"); | ||
30 | then | ||
31 | cp "${STAGING_DIR_HOST}/${CELLCONF_DIR}/${conf#with-}.c" ${S}/configs/ | ||
32 | fi | ||
33 | done | ||
34 | } | ||
35 | |||
36 | USER_SPACE_CFLAGS = '${CFLAGS} -DLIBEXECDIR=\\\"${libexecdir}\\\" \ | ||
37 | -DJAILHOUSE_VERSION=\\\"$JAILHOUSE_VERSION\\\" \ | ||
38 | -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \ | ||
39 | -I../driver' | ||
40 | |||
41 | TOOLS_SRC_DIR = "${S}/tools" | ||
42 | TOOLS_OBJ_DIR = "${S}/tools" | ||
43 | |||
44 | do_compile() { | ||
45 | oe_runmake V=1 \ | ||
46 | ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} \ | ||
47 | KDIR=${STAGING_KERNEL_BUILDDIR} | ||
48 | |||
49 | cd ${TOOLS_SRC_DIR} | ||
50 | export JAILHOUSE_VERSION=$(cat ../VERSION) | ||
51 | oe_runmake V=1 \ | ||
52 | CFLAGS="${USER_SPACE_CFLAGS}" \ | ||
53 | src=${TOOLS_SRC_DIR} obj=${TOOLS_OBJ_DIR} \ | ||
54 | ${TOOLS_OBJ_DIR}/jailhouse-config-collect ${TOOLS_OBJ_DIR}/jailhouse | ||
55 | } | ||
56 | |||
57 | do_install() { | ||
58 | oe_runmake \ | ||
59 | ARCH=${TARGET_ARCH} \ | ||
60 | CROSS_COMPILE=${TARGET_PREFIX} \ | ||
61 | KDIR=${STAGING_KERNEL_BUILDDIR} \ | ||
62 | DESTDIR=${D} install | ||
63 | |||
64 | install -d ${D}${CELL_DIR} | ||
65 | install ${B}/configs/*.cell ${D}${CELL_DIR}/ | ||
66 | |||
67 | install -d ${D}${INMATES_DIR} | ||
68 | install ${B}/inmates/demos/${TARGET_ARCH}/*.bin ${D}${INMATES_DIR} | ||
69 | } | ||
70 | |||
71 | PACKAGE_BEFORE_PN = "kernel-module-jailhouse" | ||
72 | FILES_${PN} = "${base_libdir}/firmware ${libexecdir} ${sbindir} ${JH_DATADIR}" | ||
73 | |||
74 | PACKAGECONFIG ??= "freertos-cell freertos-demo1-cell freertos-demo3-cell freertos-ivshmem-demo" | ||
75 | PACKAGECONFIG[freertos-cell] = \ | ||
76 | "--with-freertos-cell,,freertos-cell,freertos-cell" | ||
77 | PACKAGECONFIG[freertos-demo1-cell] = \ | ||
78 | "--with-freertos-demo1-cell,,freertos-demo1-cell,freertos-demo1-cell" | ||
79 | PACKAGECONFIG[freertos-demo3-cell] = \ | ||
80 | "--with-freertos-demo3-cell,,freertos-demo3-cell,freertos-demo3-cell" | ||
81 | PACKAGECONFIG[freertos-ivshmem-demo] = \ | ||
82 | "--with-freertos-ivshmem-demo,,freertos-ivshmem-demo,freertos-ivshmem-demo" | ||