diff options
author | Ola Redell <ola.redell@retotech.se> | 2017-11-15 13:37:10 +0100 |
---|---|---|
committer | Ola Redell <ola.redell@retotech.se> | 2017-11-15 13:37:10 +0100 |
commit | 0c23c22067355c0b3c3660e14507d79915edea7e (patch) | |
tree | 8d18ed05f5292f1d18a941170b05a6022c945b5f /recipes-jailhouse/jailhouse/jailhouse-defs.inc | |
download | meta-jailhouse-0c23c22067355c0b3c3660e14507d79915edea7e.tar.gz |
Initial commit
Diffstat (limited to 'recipes-jailhouse/jailhouse/jailhouse-defs.inc')
-rw-r--r-- | recipes-jailhouse/jailhouse/jailhouse-defs.inc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/recipes-jailhouse/jailhouse/jailhouse-defs.inc b/recipes-jailhouse/jailhouse/jailhouse-defs.inc new file mode 100644 index 0000000..8dd30e3 --- /dev/null +++ b/recipes-jailhouse/jailhouse/jailhouse-defs.inc | |||
@@ -0,0 +1,25 @@ | |||
1 | JH_DATADIR ?= "${datadir}/jailhouse" | ||
2 | CELL_DIR ?= "${JH_DATADIR}/cells" | ||
3 | CELLCONF_DIR ?= "${JH_DATADIR}/configs" | ||
4 | INMATES_DIR ?= "${JH_DATADIR}/inmates" | ||
5 | |||
6 | # Set jailhouse architecture JH_ARCH variable | ||
7 | # | ||
8 | # return value must match one of architectures supported by jailhouse | ||
9 | # | ||
10 | valid_jh_archs = "x86 arm" | ||
11 | |||
12 | def map_jh_arch(a, d): | ||
13 | import re | ||
14 | |||
15 | valid_jh_archs = d.getVar('valid_jh_archs', True).split() | ||
16 | |||
17 | if re.match('(i.86|athlon|x86.64)$', a): return 'x86' | ||
18 | elif re.match('armeb$', a): return 'arm' | ||
19 | elif re.match('aarch64$', a): return 'arm64' | ||
20 | elif re.match('aarch64_be$', a): return 'arm64' | ||
21 | elif a in valid_jh_archs: return a | ||
22 | else: | ||
23 | bb.error("cannot map '%s' to a jailhouse supported architecture" % a) | ||
24 | |||
25 | export JH_ARCH = "${@map_jh_arch(d.getVar('TARGET_ARCH', True), d)}" | ||