summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorParesh Bhagat <p-bhagat@ti.com>2024-02-21 16:52:18 +0530
committerRyan Eatmon <reatmon@ti.com>2024-02-21 14:33:19 -0600
commitcb1db5e822625bcae3c7104248af1f3d54842842 (patch)
tree1731e78672f34dd61cf1a13be6b7a127ff4515ea
parente8a8a90ac4aa04ecd20bb0041f77bc7384bd9b07 (diff)
downloadmeta-ti-cb1db5e822625bcae3c7104248af1f3d54842842.tar.gz
Rework jailhouse recipe to support different image build
This patch moves the jailhouse recipe general variables to a ti-jailhouse.inc file along with fetch and compile task. Jailhouse repo also contains some demo applications which can be packaged alone in filesytem and does not require packaging jailhouse module, firmware and tool. So add a new recipe jailhouse-inmate which can be used to only package those demos. The existing jailhouse recipe will contain variables and other dependencies needed for do_install task for jailhouse module, tools, demos etc. The do_install of jailhouse inmate recipe will only package demo applications. This new recipe(jailhouse-inmate) will be added to a new image in meta-arago. The new image will be used for jailhouse second linux instance or cell. Signed-off-by: Paresh Bhagat <p-bhagat@ti.com> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
-rw-r--r--meta-ti-extras/recipes-ti/jailhouse/jailhouse-arch.inc22
-rw-r--r--meta-ti-extras/recipes-ti/jailhouse/jailhouse-inmate.bb12
-rw-r--r--meta-ti-extras/recipes-ti/jailhouse/jailhouse_git.bb78
-rw-r--r--meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc87
4 files changed, 104 insertions, 95 deletions
diff --git a/meta-ti-extras/recipes-ti/jailhouse/jailhouse-arch.inc b/meta-ti-extras/recipes-ti/jailhouse/jailhouse-arch.inc
deleted file mode 100644
index 498b25ed..00000000
--- a/meta-ti-extras/recipes-ti/jailhouse/jailhouse-arch.inc
+++ /dev/null
@@ -1,22 +0,0 @@
1# Set jailhouse architecture JH_ARCH variable
2#
3# return value must match one of architectures supported by jailhouse
4#
5valid_jh_archs = "x86 arm"
6
7def map_jh_arch(a, d):
8 import re
9
10 valid_jh_archs = d.getVar('valid_jh_archs', True).split()
11
12 if re.match('(i.86|athlon|x86.64)$', a): return 'x86'
13 elif re.match('armeb$', a): return 'arm'
14 elif re.match('aarch64$', a): return 'arm64'
15 elif re.match('aarch64_be$', a): return 'arm64'
16 elif a in valid_jh_archs: return a
17 else:
18 bb.error("cannot map '%s' to a jailhouse supported architecture" % a)
19
20export JH_ARCH = "${@map_jh_arch(d.getVar('TARGET_ARCH', True), d)}"
21
22COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
diff --git a/meta-ti-extras/recipes-ti/jailhouse/jailhouse-inmate.bb b/meta-ti-extras/recipes-ti/jailhouse/jailhouse-inmate.bb
new file mode 100644
index 00000000..39654a53
--- /dev/null
+++ b/meta-ti-extras/recipes-ti/jailhouse/jailhouse-inmate.bb
@@ -0,0 +1,12 @@
1require ti-jailhouse.inc
2
3do_install() {
4
5 install -d ${D}${bindir}
6 install -m 0755 ${TOOLS_SRC_DIR}/demos/ivshmem-demo ${D}${bindir}
7
8}
9
10FILES:${PN} = " \
11 ${bindir}/ivshmem-demo \
12"
diff --git a/meta-ti-extras/recipes-ti/jailhouse/jailhouse_git.bb b/meta-ti-extras/recipes-ti/jailhouse/jailhouse_git.bb
index 70d6a0b6..98ec0e9e 100644
--- a/meta-ti-extras/recipes-ti/jailhouse/jailhouse_git.bb
+++ b/meta-ti-extras/recipes-ti/jailhouse/jailhouse_git.bb
@@ -1,49 +1,11 @@
1SUMMARY = "Linux-based partitioning hypervisor" 1require ti-jailhouse.inc
2DESCRIPTION = "Jailhouse is a partitioning Hypervisor based on Linux. It is able to run bare-metal applications or (adapted) \
3operating systems besides Linux. For this purpose, it configures CPU and device virtualization features of the hardware \
4platform in a way that none of these domains, called 'cells' here, can interfere with each other in an unacceptable way."
5HOMEPAGE = "https://github.com/siemens/jailhouse"
6SECTION = "jailhouse"
7LICENSE = "GPL-2.0-only & BSD-2-Clause"
8
9LIC_FILES_CHKSUM = " \
10 file://COPYING;md5=9fa7f895f96bde2d47fd5b7d95b6ba4d \
11"
12
13COMPATIBLE_MACHINE = "am62xx|am62pxx"
14
15TARGET_CC_ARCH += "${LDFLAGS}"
16
17PV = "0.12+git${SRCPV}"
18SRCREV = "0b29ad90f6f54105b98d6bbf35cc47fb244f7799"
19BRANCH = "master"
20
21SRC_URI = " \
22 git://git.ti.com/git/jailhouse/ti-jailhouse.git;protocol=https;branch=${BRANCH} \
23"
24 2
25DEPENDS = "virtual/kernel dtc-native python3-mako-native python3-mako make-native"
26RDEPENDS:${PN} += "\ 3RDEPENDS:${PN} += "\
27 python3-curses\ 4 python3-curses\
28 python3-datetime\ 5 python3-datetime\
29 python3-mmap\ 6 python3-mmap\
30" 7"
31 8
32require jailhouse-arch.inc
33inherit module python3native bash-completion deploy setuptools3
34
35S = "${WORKDIR}/git"
36B = "${S}"
37
38PACKAGE_ARCH = "${MACHINE_ARCH}"
39COMPATIBLE_MACHINE = "(ti-soc)"
40
41JH_DATADIR ?= "${datadir}/jailhouse"
42JH_EXEC_DIR ?= "${libexecdir}/jailhouse"
43CELL_DIR ?= "${JH_DATADIR}/cells"
44CELLCONF_DIR ?= "${JH_DATADIR}/configs"
45INMATES_DIR ?= "${JH_DATADIR}/inmates"
46
47JH_CELL_FILES ?= "*.cell" 9JH_CELL_FILES ?= "*.cell"
48JH_CELL_FILES:k3 ?= "k3-*.cell" 10JH_CELL_FILES:k3 ?= "k3-*.cell"
49JH_CELL_FILES:am62xx ?= "k3-am625-*.cell" 11JH_CELL_FILES:am62xx ?= "k3-am625-*.cell"
@@ -63,13 +25,6 @@ JH_LINUX_DEMO_CELL:am62pxx ?= "k3-am62p5-sk-linux-demo.cell"
63JH_LINUX_DEMO_CELL:j7 ?= "k3-j721e-evm-linux-demo.cell" 25JH_LINUX_DEMO_CELL:j7 ?= "k3-j721e-evm-linux-demo.cell"
64JH_LINUX_DEMO_CELL:j7200-evm ?= "k3-j7200-evm-linux-demo.cell" 26JH_LINUX_DEMO_CELL:j7200-evm ?= "k3-j7200-evm-linux-demo.cell"
65 27
66JH_SYSCONFIG_CELL ?= ""
67JH_SYSCONFIG_CELL:am62xx ?= "k3-am625-sk.cell"
68JH_SYSCONFIG_CELL:am65xx ?= "k3-am654-idk.cell"
69JH_SYSCONFIG_CELL:am62pxx ?= "k3-am62p5-sk.cell"
70JH_SYSCONFIG_CELL:j7 ?= "k3-j721e-evm.cell"
71JH_SYSCONFIG_CELL:j7200-evm ?= "k3-j7200-evm.cell"
72
73INITRAMFS_IMAGE ?= "" 28INITRAMFS_IMAGE ?= ""
74JH_RAMFS_IMAGE ?= "${INITRAMFS_IMAGE}" 29JH_RAMFS_IMAGE ?= "${INITRAMFS_IMAGE}"
75 30
@@ -80,29 +35,7 @@ JH_CMDLINE:am65xx ?= "console=ttyS1,115200n8"
80JH_CMDLINE:j7 ?= "console=ttyS3,115200n8" 35JH_CMDLINE:j7 ?= "console=ttyS3,115200n8"
81JH_CMDLINE:j7200-evm ?= "console=ttyS3,115200n8" 36JH_CMDLINE:j7200-evm ?= "console=ttyS3,115200n8"
82 37
83do_configure() {
84 if [ -d ${STAGING_DIR_HOST}/${CELLCONF_DIR} ];
85 then
86 cp ${STAGING_DIR_HOST}/${CELLCONF_DIR}/*.c ${S}/configs/
87 fi
88}
89
90USER_SPACE_CFLAGS = '${CFLAGS} -DLIBEXECDIR=\\\"${libexecdir}\\\" \
91 -DJAILHOUSE_VERSION=\\\"$JAILHOUSE_VERSION\\\" \
92 -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \
93 -I../driver'
94
95TOOLS_SRC_DIR = "${S}/tools"
96
97EXTRA_OEMAKE = "ARCH=${JH_ARCH} CROSS_COMPILE=${TARGET_PREFIX} CC="${CC}" KDIR=${STAGING_KERNEL_BUILDDIR}"
98
99do_compile() {
100 oe_runmake V=1
101}
102
103do_install() { 38do_install() {
104 # Install pyjailhouse python modules needed by the tools
105 # distutils3_do_install
106 39
107 # We want to install the python tools, but we do not want to use pip... 40 # We want to install the python tools, but we do not want to use pip...
108 # At least with v0.10, we can work around this with 41 # At least with v0.10, we can work around this with
@@ -154,7 +87,7 @@ do_install() {
154} 87}
155 88
156PACKAGE_BEFORE_PN = "kernel-module-jailhouse pyjailhouse ${PN}-tools" 89PACKAGE_BEFORE_PN = "kernel-module-jailhouse pyjailhouse ${PN}-tools"
157FILES:${PN} = "${base_libdir}/firmware ${libexecdir} ${sbindir} ${JH_DATADIR} /boot" 90
158FILES:pyjailhouse = "${PYTHON_SITEPACKAGES_DIR}" 91FILES:pyjailhouse = "${PYTHON_SITEPACKAGES_DIR}"
159FILES:${PN}-tools = "${libexecdir}/${BPN}/${BPN}-*" 92FILES:${PN}-tools = "${libexecdir}/${BPN}/${BPN}-*"
160 93
@@ -183,7 +116,6 @@ python __anonymous () {
183 d.appendVar('RDEPENDS_${PN}', ' ' + cell) 116 d.appendVar('RDEPENDS_${PN}', ' ' + cell)
184} 117}
185 118
186
187FILES:${PN} = " \ 119FILES:${PN} = " \
188 /boot/* \ 120 /boot/* \
189 /usr/libexec \ 121 /usr/libexec \
diff --git a/meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc b/meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc
new file mode 100644
index 00000000..a63891bf
--- /dev/null
+++ b/meta-ti-extras/recipes-ti/jailhouse/ti-jailhouse.inc
@@ -0,0 +1,87 @@
1SUMMARY = "Linux-based partitioning hypervisor"
2DESCRIPTION = "Jailhouse is a partitioning Hypervisor based on Linux. It is able to run bare-metal applications or (adapted) \
3operating systems besides Linux. For this purpose, it configures CPU and device virtualization features of the hardware \
4platform in a way that none of these domains, called 'cells' here, can interfere with each other in an unacceptable way."
5HOMEPAGE = "https://github.com/siemens/jailhouse"
6SECTION = "jailhouse"
7
8LICENSE = "GPL-2.0-only & BSD-2-Clause"
9
10LIC_FILES_CHKSUM = " \
11 file://COPYING;md5=9fa7f895f96bde2d47fd5b7d95b6ba4d \
12"
13
14COMPATIBLE_MACHINE = "am62xx|am62pxx"
15TARGET_CC_ARCH += "${LDFLAGS}"
16PV = "0.12+git${SRCPV}"
17SRCREV = "0b29ad90f6f54105b98d6bbf35cc47fb244f7799"
18BRANCH = "master"
19SRC_URI = " \
20 git://git.ti.com/git/jailhouse/ti-jailhouse.git;protocol=https;branch=${BRANCH} \
21"
22
23# Set jailhouse architecture JH_ARCH variable
24#
25# return value must match one of architectures supported by jailhouse
26#
27valid_jh_archs = "x86 arm"
28
29def map_jh_arch(a, d):
30 import re
31
32 valid_jh_archs = d.getVar('valid_jh_archs', True).split()
33
34 if re.match('(i.86|athlon|x86.64)$', a): return 'x86'
35 elif re.match('armeb$', a): return 'arm'
36 elif re.match('aarch64$', a): return 'arm64'
37 elif re.match('aarch64_be$', a): return 'arm64'
38 elif a in valid_jh_archs: return a
39 else:
40 bb.error("cannot map '%s' to a jailhouse supported architecture" % a)
41
42export JH_ARCH = "${@map_jh_arch(d.getVar('TARGET_ARCH', True), d)}"
43
44COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
45
46S = "${WORKDIR}/git"
47B = "${S}"
48
49DEPENDS = "virtual/kernel dtc-native python3-mako-native python3-mako make-native"
50
51inherit module python3native bash-completion deploy setuptools3
52
53PACKAGE_ARCH = "${MACHINE_ARCH}"
54COMPATIBLE_MACHINE = "(ti-soc)"
55
56JH_DATADIR ?= "${datadir}/jailhouse"
57JH_EXEC_DIR ?= "${libexecdir}/jailhouse"
58CELL_DIR ?= "${JH_DATADIR}/cells"
59CELLCONF_DIR ?= "${JH_DATADIR}/configs"
60INMATES_DIR ?= "${JH_DATADIR}/inmates"
61
62JH_SYSCONFIG_CELL ?= ""
63JH_SYSCONFIG_CELL:am62xx ?= "k3-am625-sk.cell"
64JH_SYSCONFIG_CELL:am65xx ?= "k3-am654-idk.cell"
65JH_SYSCONFIG_CELL:am62pxx ?= "k3-am62p5-sk.cell"
66JH_SYSCONFIG_CELL:j7 ?= "k3-j721e-evm.cell"
67JH_SYSCONFIG_CELL:j7200-evm ?= "k3-j7200-evm.cell"
68
69do_configure() {
70 if [ -d ${STAGING_DIR_HOST}/${CELLCONF_DIR} ];
71 then
72 cp ${STAGING_DIR_HOST}/${CELLCONF_DIR}/*.c ${S}/configs/
73 fi
74}
75
76USER_SPACE_CFLAGS = '${CFLAGS} -DLIBEXECDIR=\\\"${libexecdir}\\\" \
77 -DJAILHOUSE_VERSION=\\\"$JAILHOUSE_VERSION\\\" \
78 -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \
79 -I../driver'
80
81TOOLS_SRC_DIR = "${S}/tools"
82
83EXTRA_OEMAKE = "ARCH=${JH_ARCH} CROSS_COMPILE=${TARGET_PREFIX} CC="${CC}" KDIR=${STAGING_KERNEL_BUILDDIR}"
84
85do_compile() {
86 oe_runmake V=1
87}