aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-extended
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
parente5cc2b1848a74d25004e9524dc9a3ea12639ad53 (diff)
downloadmeta-freescale-c7b9a8de1943e5fa094e59a7ebbfbcb2d8283b33.tar.gz
meta-freescale-c7b9a8de1943e5fa094e59a7ebbfbcb2d8283b33.tar.bz2
meta-freescale-c7b9a8de1943e5fa094e59a7ebbfbcb2d8283b33.zip
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')
-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 @@
+From f07cd0e5f32a00a4091fa964d0dae0cd46c17554 Mon Sep 17 00:00:00 2001
+From: Cristinel Panfir <cristinel.panfir@nxp.com>
+Date: Sat, 23 May 2020 08:51:31 +0000
+Subject: [PATCH] tools/scripts: update shebang to python3
+
+Upstream-Status: Pending
+
+Signed-off-by: Cristinel Panfir <cristinel.panfir@nxp.com>
+---
+ scripts/arm64-parsedump.py | 2 +-
+ tools/jailhouse-cell-linux | 2 +-
+ tools/jailhouse-cell-stats | 2 +-
+ tools/jailhouse-config-create | 2 +-
+ tools/jailhouse-hardware-check | 2 +-
+ 5 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/scripts/arm64-parsedump.py b/scripts/arm64-parsedump.py
+index 9519eb5..c695706 100755
+--- a/scripts/arm64-parsedump.py
++++ b/scripts/arm64-parsedump.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # Jailhouse, a Linux-based partitioning hypervisor
+ #
+diff --git a/tools/jailhouse-cell-linux b/tools/jailhouse-cell-linux
+index 215932a..bcbb902 100755
+--- a/tools/jailhouse-cell-linux
++++ b/tools/jailhouse-cell-linux
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # Jailhouse, a Linux-based partitioning hypervisor
+ #
+diff --git a/tools/jailhouse-cell-stats b/tools/jailhouse-cell-stats
+index 2f7e966..4c5289f 100755
+--- a/tools/jailhouse-cell-stats
++++ b/tools/jailhouse-cell-stats
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # Jailhouse, a Linux-based partitioning hypervisor
+ #
+diff --git a/tools/jailhouse-config-create b/tools/jailhouse-config-create
+index 55601a6..9869b94 100755
+--- a/tools/jailhouse-config-create
++++ b/tools/jailhouse-config-create
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ #
+ # Jailhouse, a Linux-based partitioning hypervisor
+ #
+diff --git a/tools/jailhouse-hardware-check b/tools/jailhouse-hardware-check
+index b86756a..0c8fb42 100755
+--- a/tools/jailhouse-hardware-check
++++ b/tools/jailhouse-hardware-check
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+
+ # Jailhouse, a Linux-based partitioning hypervisor
+ #
+--
+2.7.4
+
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 @@
+SUMMARY = "Jailhouse, i.MX fork"
+HOMEPAGE = "https://github.com/siemens/jailhouse"
+SECTION = "jailhouse"
+LICENSE = "GPL-2.0"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=9fa7f895f96bde2d47fd5b7d95b6ba4d \
+ file://tools/root-cell-config.c.tmpl;beginline=6;endline=33;md5=2825581c1666c44a17955dc574cfbfb3 \
+ file://include/jailhouse/hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
+ file://include/jailhouse/cell-config.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
+ file://include/arch/arm/asm/jailhouse_hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
+ file://include/arch/arm64/asm/jailhouse_hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
+ file://include/arch/x86/asm/jailhouse_hypercall.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
+ file://driver/jailhouse.h;beginline=9;endline=36;md5=2825581c1666c44a17955dc574cfbfb3 \
+"
+
+SRCBRANCH = "lf-5.4.y"
+SRCREV = "82d5698945eafaffa58bab3b4d6da320bf56289c"
+
+SRC_URI = "git://source.codeaurora.org/external/imx/imx-jailhouse.git;protocol=ssh;branch=${SRCBRANCH} \
+ file://0001-tools-scripts-update-shebang-to-python3.patch \
+"
+
+DEPENDS = " \
+ make-native \
+ python3-mako-native \
+ python3-mako \
+ dtc-native \
+"
+
+inherit module python3native bash-completion deploy setuptools3
+
+S = "${WORKDIR}/git"
+B = "${S}"
+
+JH_ARCH = "arm64"
+JH_DATADIR ?= "${datadir}/jailhouse"
+CELL_DIR ?= "${JH_DATADIR}/cells"
+CELLCONF_DIR ?= "${JH_DATADIR}/configs"
+INMATES_DIR ?= "${JH_DATADIR}/inmates"
+
+JH_CONFIG ?= "${S}/ci/jailhouse-config-x86.h"
+JH_CONFIG_x86 ?= "${S}/ci/jailhouse-config-x86.h"
+JH_CONFIG_x86-64 ?= "${S}/ci/jailhouse-config-x86.h"
+JH_CONFIG_arm ?= "${S}/ci/jailhouse-config-banana-pi.h"
+
+do_configure() {
+ if [ -d ${STAGING_DIR_HOST}/${CELLCONF_DIR} ];
+ then
+ cp "${STAGING_DIR_HOST}/${CELLCONF_DIR}/"*.c ${S}/configs/${ARCH}/
+ fi
+}
+
+USER_SPACE_CFLAGS = '${CFLAGS} -DLIBEXECDIR=\\\"${libexecdir}\\\" \
+ -DJAILHOUSE_VERSION=\\\"$JAILHOUSE_VERSION\\\" \
+ -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \
+ -I../driver'
+
+TOOLS_SRC_DIR = "${S}/tools"
+TOOLS_OBJ_DIR = "${S}/tools"
+
+do_compile() {
+ unset LDFLAGS
+ oe_runmake V=1 CC="${CC}" \
+ ARCH=${JH_ARCH} CROSS_COMPILE=${TARGET_PREFIX} \
+ KDIR=${STAGING_KERNEL_BUILDDIR}
+
+ cd ${TOOLS_SRC_DIR}
+ export JAILHOUSE_VERSION=$(cat ../VERSION)
+ oe_runmake V=1 \
+ CFLAGS="${USER_SPACE_CFLAGS}" \
+ src=${TOOLS_SRC_DIR} obj=${TOOLS_OBJ_DIR} \
+ ${TOOLS_OBJ_DIR}/jailhouse-config-collect ${TOOLS_OBJ_DIR}/jailhouse
+}
+
+do_install() {
+ oe_runmake \
+ PYTHON=python3 \
+ V=1 \
+ LDFLAGS="" \
+ CC="${CC}" \
+ ARCH=${JH_ARCH} \
+ CROSS_COMPILE=${TARGET_PREFIX} \
+ KDIR=${STAGING_KERNEL_BUILDDIR} \
+ DESTDIR=${D} install
+
+ install -d ${D}${CELL_DIR}
+ install ${B}/configs/${JH_ARCH}/*.cell ${D}${CELL_DIR}/
+
+ install -d ${D}${INMATES_DIR}/tools/${JH_ARCH}
+ install ${B}/inmates/demos/${JH_ARCH}/*.bin ${D}${INMATES_DIR}
+
+ install -d ${D}${JH_DATADIR}/tools
+ install ${B}/tools/jailhouse-cell-linux ${D}${JH_DATADIR}/tools
+ install ${B}/tools/jailhouse-cell-stats ${D}${JH_DATADIR}/tools
+ install ${B}/tools/jailhouse-config-collect ${D}${JH_DATADIR}/tools
+ install ${B}/tools/jailhouse-config-create ${D}${JH_DATADIR}/tools
+ install ${B}/tools/jailhouse-gcov-extract ${D}${JH_DATADIR}/tools
+ install ${B}/tools/jailhouse-hardware-check ${D}${JH_DATADIR}/tools
+ install ${B}/inmates/tools/${JH_ARCH}/linux-loader.bin ${D}${INMATES_DIR}/tools/${JH_ARCH}
+}
+
+PACKAGE_BEFORE_PN = "kernel-module-jailhouse pyjailhouse"
+
+FILES_${PN} += "${base_libdir}/firmware ${libexecdir} ${sbindir} ${JH_DATADIR}"
+FILES_pyjailhouse = "${PYTHON_SITEPACKAGES_DIR}"
+
+RDEPENDS_${PN} += " \
+ python3-curses \
+ python3-datetime \
+ python3-mmap \
+"
+
+RDEPENDS_pyjailhouse = " \
+ python3-core \
+ python3-ctypes \
+ python3-fcntl \
+ python3-shell \
+"
+
+INSANE_SKIP_${PN} = "ldflags"
+
+COMPATIBLE_MACHINE = "(mx8m)"