summaryrefslogtreecommitdiffstats
path: root/recipes-extended/jailhouse
diff options
context:
space:
mode:
authorCristinel Panfir <cristinel.panfir@nxp.com>2020-05-12 17:02:43 +0300
committerOtavio Salvador <otavio@ossystems.com.br>2020-05-25 09:54:09 -0300
commitc7b9a8de1943e5fa094e59a7ebbfbcb2d8283b33 (patch)
tree4929954aa50ed489caa42c963b4a63c0be7764b0 /recipes-extended/jailhouse
parente5cc2b1848a74d25004e9524dc9a3ea12639ad53 (diff)
downloadmeta-freescale-c7b9a8de1943e5fa094e59a7ebbfbcb2d8283b33.tar.gz
jailhouse: Enable Jailhouse for i.MX
This is an adaptation of the original recipe https://bitbucket.org/retotech/meta-jailhouse - add recipe for Jailhouse version 0.11 - enable for mx8mq, mx8mm, mx8mn - add pyjailhouse/python tools like jailhouse-cell-linux - update to python3 classes Signed-off-by: Cristinel Panfir <cristinel.panfir@nxp.com>
Diffstat (limited to 'recipes-extended/jailhouse')
-rw-r--r--recipes-extended/jailhouse/jailhouse/0001-tools-scripts-update-shebang-to-python3.patch69
-rw-r--r--recipes-extended/jailhouse/jailhouse_0.11.bb122
2 files changed, 191 insertions, 0 deletions
diff --git a/recipes-extended/jailhouse/jailhouse/0001-tools-scripts-update-shebang-to-python3.patch b/recipes-extended/jailhouse/jailhouse/0001-tools-scripts-update-shebang-to-python3.patch
new file mode 100644
index 00000000..df2f37ad
--- /dev/null
+++ b/recipes-extended/jailhouse/jailhouse/0001-tools-scripts-update-shebang-to-python3.patch
@@ -0,0 +1,69 @@
1From f07cd0e5f32a00a4091fa964d0dae0cd46c17554 Mon Sep 17 00:00:00 2001
2From: Cristinel Panfir <cristinel.panfir@nxp.com>
3Date: Sat, 23 May 2020 08:51:31 +0000
4Subject: [PATCH] tools/scripts: update shebang to python3
5
6Upstream-Status: Pending
7
8Signed-off-by: Cristinel Panfir <cristinel.panfir@nxp.com>
9---
10 scripts/arm64-parsedump.py | 2 +-
11 tools/jailhouse-cell-linux | 2 +-
12 tools/jailhouse-cell-stats | 2 +-
13 tools/jailhouse-config-create | 2 +-
14 tools/jailhouse-hardware-check | 2 +-
15 5 files changed, 5 insertions(+), 5 deletions(-)
16
17diff --git a/scripts/arm64-parsedump.py b/scripts/arm64-parsedump.py
18index 9519eb5..c695706 100755
19--- a/scripts/arm64-parsedump.py
20+++ b/scripts/arm64-parsedump.py
21@@ -1,4 +1,4 @@
22-#!/usr/bin/env python
23+#!/usr/bin/env python3
24
25 # Jailhouse, a Linux-based partitioning hypervisor
26 #
27diff --git a/tools/jailhouse-cell-linux b/tools/jailhouse-cell-linux
28index 215932a..bcbb902 100755
29--- a/tools/jailhouse-cell-linux
30+++ b/tools/jailhouse-cell-linux
31@@ -1,4 +1,4 @@
32-#!/usr/bin/env python
33+#!/usr/bin/env python3
34
35 # Jailhouse, a Linux-based partitioning hypervisor
36 #
37diff --git a/tools/jailhouse-cell-stats b/tools/jailhouse-cell-stats
38index 2f7e966..4c5289f 100755
39--- a/tools/jailhouse-cell-stats
40+++ b/tools/jailhouse-cell-stats
41@@ -1,4 +1,4 @@
42-#!/usr/bin/env python
43+#!/usr/bin/env python3
44
45 # Jailhouse, a Linux-based partitioning hypervisor
46 #
47diff --git a/tools/jailhouse-config-create b/tools/jailhouse-config-create
48index 55601a6..9869b94 100755
49--- a/tools/jailhouse-config-create
50+++ b/tools/jailhouse-config-create
51@@ -1,4 +1,4 @@
52-#!/usr/bin/env python
53+#!/usr/bin/env python3
54 #
55 # Jailhouse, a Linux-based partitioning hypervisor
56 #
57diff --git a/tools/jailhouse-hardware-check b/tools/jailhouse-hardware-check
58index b86756a..0c8fb42 100755
59--- a/tools/jailhouse-hardware-check
60+++ b/tools/jailhouse-hardware-check
61@@ -1,4 +1,4 @@
62-#!/usr/bin/env python
63+#!/usr/bin/env python3
64
65 # Jailhouse, a Linux-based partitioning hypervisor
66 #
67--
682.7.4
69
diff --git a/recipes-extended/jailhouse/jailhouse_0.11.bb b/recipes-extended/jailhouse/jailhouse_0.11.bb
new file mode 100644
index 00000000..32a4f92f
--- /dev/null
+++ b/recipes-extended/jailhouse/jailhouse_0.11.bb
@@ -0,0 +1,122 @@
1SUMMARY = "Jailhouse, i.MX fork"
2HOMEPAGE = "https://github.com/siemens/jailhouse"
3SECTION = "jailhouse"
4LICENSE = "GPL-2.0"
5
6LIC_FILES_CHKSUM = "file://COPYING;md5=9fa7f895f96bde2d47fd5b7d95b6ba4d \
7 file://tools/root-cell-config.c.tmpl;beginline=6;endline=33;md5=2825581c1666c44a17955dc574cfbfb3 \
8 file://include/jailhouse/hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
9 file://include/jailhouse/cell-config.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
10 file://include/arch/arm/asm/jailhouse_hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
11 file://include/arch/arm64/asm/jailhouse_hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
12 file://include/arch/x86/asm/jailhouse_hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
13 file://driver/jailhouse.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
14"
15
16SRCBRANCH = "lf-5.4.y"
17SRCREV = "82d5698945eafaffa58bab3b4d6da320bf56289c"
18
19SRC_URI = "git://source.codeaurora.org/external/imx/imx-jailhouse.git;protocol=ssh;branch=${SRCBRANCH} \
20 file://0001-tools-scripts-update-shebang-to-python3.patch \
21"
22
23DEPENDS = " \
24 make-native \
25 python3-mako-native \
26 python3-mako \
27 dtc-native \
28"
29
30inherit module python3native bash-completion deploy setuptools3
31
32S = "${WORKDIR}/git"
33B = "${S}"
34
35JH_ARCH = "arm64"
36JH_DATADIR ?= "${datadir}/jailhouse"
37CELL_DIR ?= "${JH_DATADIR}/cells"
38CELLCONF_DIR ?= "${JH_DATADIR}/configs"
39INMATES_DIR ?= "${JH_DATADIR}/inmates"
40
41JH_CONFIG ?= "${S}/ci/jailhouse-config-x86.h"
42JH_CONFIG_x86 ?= "${S}/ci/jailhouse-config-x86.h"
43JH_CONFIG_x86-64 ?= "${S}/ci/jailhouse-config-x86.h"
44JH_CONFIG_arm ?= "${S}/ci/jailhouse-config-banana-pi.h"
45
46do_configure() {
47 if [ -d ${STAGING_DIR_HOST}/${CELLCONF_DIR} ];
48 then
49 cp "${STAGING_DIR_HOST}/${CELLCONF_DIR}/"*.c ${S}/configs/${ARCH}/
50 fi
51}
52
53USER_SPACE_CFLAGS = '${CFLAGS} -DLIBEXECDIR=\\\"${libexecdir}\\\" \
54 -DJAILHOUSE_VERSION=\\\"$JAILHOUSE_VERSION\\\" \
55 -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \
56 -I../driver'
57
58TOOLS_SRC_DIR = "${S}/tools"
59TOOLS_OBJ_DIR = "${S}/tools"
60
61do_compile() {
62 unset LDFLAGS
63 oe_runmake V=1 CC="${CC}" \
64 ARCH=${JH_ARCH} CROSS_COMPILE=${TARGET_PREFIX} \
65 KDIR=${STAGING_KERNEL_BUILDDIR}
66
67 cd ${TOOLS_SRC_DIR}
68 export JAILHOUSE_VERSION=$(cat ../VERSION)
69 oe_runmake V=1 \
70 CFLAGS="${USER_SPACE_CFLAGS}" \
71 src=${TOOLS_SRC_DIR} obj=${TOOLS_OBJ_DIR} \
72 ${TOOLS_OBJ_DIR}/jailhouse-config-collect ${TOOLS_OBJ_DIR}/jailhouse
73}
74
75do_install() {
76 oe_runmake \
77 PYTHON=python3 \
78 V=1 \
79 LDFLAGS="" \
80 CC="${CC}" \
81 ARCH=${JH_ARCH} \
82 CROSS_COMPILE=${TARGET_PREFIX} \
83 KDIR=${STAGING_KERNEL_BUILDDIR} \
84 DESTDIR=${D} install
85
86 install -d ${D}${CELL_DIR}
87 install ${B}/configs/${JH_ARCH}/*.cell ${D}${CELL_DIR}/
88
89 install -d ${D}${INMATES_DIR}/tools/${JH_ARCH}
90 install ${B}/inmates/demos/${JH_ARCH}/*.bin ${D}${INMATES_DIR}
91
92 install -d ${D}${JH_DATADIR}/tools
93 install ${B}/tools/jailhouse-cell-linux ${D}${JH_DATADIR}/tools
94 install ${B}/tools/jailhouse-cell-stats ${D}${JH_DATADIR}/tools
95 install ${B}/tools/jailhouse-config-collect ${D}${JH_DATADIR}/tools
96 install ${B}/tools/jailhouse-config-create ${D}${JH_DATADIR}/tools
97 install ${B}/tools/jailhouse-gcov-extract ${D}${JH_DATADIR}/tools
98 install ${B}/tools/jailhouse-hardware-check ${D}${JH_DATADIR}/tools
99 install ${B}/inmates/tools/${JH_ARCH}/linux-loader.bin ${D}${INMATES_DIR}/tools/${JH_ARCH}
100}
101
102PACKAGE_BEFORE_PN = "kernel-module-jailhouse pyjailhouse"
103
104FILES_${PN} += "${base_libdir}/firmware ${libexecdir} ${sbindir} ${JH_DATADIR}"
105FILES_pyjailhouse = "${PYTHON_SITEPACKAGES_DIR}"
106
107RDEPENDS_${PN} += " \
108 python3-curses \
109 python3-datetime \
110 python3-mmap \
111"
112
113RDEPENDS_pyjailhouse = " \
114 python3-core \
115 python3-ctypes \
116 python3-fcntl \
117 python3-shell \
118"
119
120INSANE_SKIP_${PN} = "ldflags"
121
122COMPATIBLE_MACHINE = "(mx8m)"