diff options
author | Ola Redell <ola.redell@retotech.se> | 2018-09-19 18:36:53 +0200 |
---|---|---|
committer | Ola Redell <ola.redell@retotech.se> | 2018-09-19 18:36:53 +0200 |
commit | 80d553539345dde697032148788b4e1cd529dcc0 (patch) | |
tree | 236be9ccb942f3ac06b40c61d78ab3208ff32ff5 | |
parent | ae7608e59c336d97d550ba4c08a927b58d3703e7 (diff) | |
download | meta-jailhouse-80d553539345dde697032148788b4e1cd529dcc0.tar.gz |
hacky fix for building jailhouse 0.9+ with git recipe
-rw-r--r-- | conf/layer.conf | 2 | ||||
-rw-r--r-- | recipes-jailhouse/jailhouse/jailhouse-defs.inc | 2 | ||||
-rw-r--r-- | recipes-jailhouse/jailhouse/jailhouse-git/no-kbuild-of-tools.patch (renamed from recipes-jailhouse/jailhouse/jailhouse-git/0004-no-kbuild-of-tools.patch) | 6 | ||||
-rw-r--r-- | recipes-jailhouse/jailhouse/jailhouse-git/tools-makefile-man-pages.patch | 13 | ||||
-rw-r--r-- | recipes-jailhouse/jailhouse/jailhouse-git/tools-makefile.patch (renamed from recipes-jailhouse/jailhouse/jailhouse-git/0005-tools-makefile.patch) | 20 | ||||
-rw-r--r-- | recipes-jailhouse/jailhouse/jailhouse.inc | 22 | ||||
-rw-r--r-- | recipes-jailhouse/jailhouse/jailhouse_git.bb | 11 |
7 files changed, 50 insertions, 26 deletions
diff --git a/conf/layer.conf b/conf/layer.conf index c81174e..5826443 100644 --- a/conf/layer.conf +++ b/conf/layer.conf | |||
@@ -8,3 +8,5 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ | |||
8 | BBFILE_COLLECTIONS += "jailhouse" | 8 | BBFILE_COLLECTIONS += "jailhouse" |
9 | BBFILE_PATTERN_jailhouse = "^${LAYERDIR}/" | 9 | BBFILE_PATTERN_jailhouse = "^${LAYERDIR}/" |
10 | BBFILE_PRIORITY_jailhouse = "6" | 10 | BBFILE_PRIORITY_jailhouse = "6" |
11 | |||
12 | LAYERSERIES_COMPAT_jailhouse = "sumo" \ No newline at end of file | ||
diff --git a/recipes-jailhouse/jailhouse/jailhouse-defs.inc b/recipes-jailhouse/jailhouse/jailhouse-defs.inc index 8dd30e3..0c8eb40 100644 --- a/recipes-jailhouse/jailhouse/jailhouse-defs.inc +++ b/recipes-jailhouse/jailhouse/jailhouse-defs.inc | |||
@@ -22,4 +22,4 @@ def map_jh_arch(a, d): | |||
22 | else: | 22 | else: |
23 | bb.error("cannot map '%s' to a jailhouse supported architecture" % a) | 23 | bb.error("cannot map '%s' to a jailhouse supported architecture" % a) |
24 | 24 | ||
25 | export JH_ARCH = "${@map_jh_arch(d.getVar('TARGET_ARCH', True), d)}" | 25 | JH_ARCH = "${@map_jh_arch(d.getVar('TARGET_ARCH', True), d)}" |
diff --git a/recipes-jailhouse/jailhouse/jailhouse-git/0004-no-kbuild-of-tools.patch b/recipes-jailhouse/jailhouse/jailhouse-git/no-kbuild-of-tools.patch index 30d3b6d..a7c9f99 100644 --- a/recipes-jailhouse/jailhouse/jailhouse-git/0004-no-kbuild-of-tools.patch +++ b/recipes-jailhouse/jailhouse/jailhouse-git/no-kbuild-of-tools.patch | |||
@@ -2,9 +2,9 @@ Index: git/Kbuild | |||
2 | =================================================================== | 2 | =================================================================== |
3 | --- git.orig/Kbuild | 3 | --- git.orig/Kbuild |
4 | +++ git/Kbuild | 4 | +++ git/Kbuild |
5 | @@ -53,7 +53,7 @@ $(obj)/driver $(obj)/hypervisor: $(GEN_V | 5 | @@ -41,7 +41,7 @@ GEN_VERSION_H := $(obj)/hypervisor/inclu |
6 | 6 | $(GEN_VERSION_H): $(src)/Makefile FORCE | |
7 | endif | 7 | $(call filechk,version) |
8 | 8 | ||
9 | -subdir-y := driver hypervisor configs inmates tools | 9 | -subdir-y := driver hypervisor configs inmates tools |
10 | +subdir-y := driver hypervisor configs inmates | 10 | +subdir-y := driver hypervisor configs inmates |
diff --git a/recipes-jailhouse/jailhouse/jailhouse-git/tools-makefile-man-pages.patch b/recipes-jailhouse/jailhouse/jailhouse-git/tools-makefile-man-pages.patch new file mode 100644 index 0000000..75e676f --- /dev/null +++ b/recipes-jailhouse/jailhouse/jailhouse-git/tools-makefile-man-pages.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | Index: git/tools/Makefile | ||
2 | =================================================================== | ||
3 | --- git.orig/tools/Makefile | ||
4 | +++ git/tools/Makefile | ||
5 | @@ -122,7 +122,7 @@ targets += $(MAN8_PAGES) | ||
6 | always += $(MAN8_PAGES) | ||
7 | |||
8 | $(obj)/%.8: $(src)/%.8.in | ||
9 | - $(call if_changed,gen_man) | ||
10 | + sed 's/$${VERSION}/$(shell cat $(src)/../VERSION)/g' $< > $@ | ||
11 | |||
12 | install-bin: $(BINARIES) $(DESTDIR)$(sbindir) | ||
13 | $(INSTALL_PROGRAM) $^ | ||
diff --git a/recipes-jailhouse/jailhouse/jailhouse-git/0005-tools-makefile.patch b/recipes-jailhouse/jailhouse/jailhouse-git/tools-makefile.patch index ea041a9..e2b170e 100644 --- a/recipes-jailhouse/jailhouse/jailhouse-git/0005-tools-makefile.patch +++ b/recipes-jailhouse/jailhouse/jailhouse-git/tools-makefile.patch | |||
@@ -2,16 +2,16 @@ Index: git/tools/Makefile | |||
2 | =================================================================== | 2 | =================================================================== |
3 | --- git.orig/tools/Makefile | 3 | --- git.orig/tools/Makefile |
4 | +++ git/tools/Makefile | 4 | +++ git/tools/Makefile |
5 | @@ -19,7 +19,7 @@ LINUXINCLUDE := -I$(src)/../driver | 5 | @@ -23,7 +23,7 @@ KBUILD_CFLAGS := -g -O3 -DLIBEXECDIR=\"$ |
6 | KBUILD_CFLAGS := -g -O3 -DLIBEXECDIR=\"$(libexecdir)\" \ | 6 | -D__LINUX_COMPILER_TYPES_H \ |
7 | -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \ | ||
8 | -DJAILHOUSE_VERSION=\"$(shell cat $(src)/../VERSION)\" $(EXTRA_CFLAGS) | 7 | -DJAILHOUSE_VERSION=\"$(shell cat $(src)/../VERSION)\" $(EXTRA_CFLAGS) |
8 | # prior to 4.19 | ||
9 | -LDFLAGS := | 9 | -LDFLAGS := |
10 | + | 10 | +#LDFLAGS := |
11 | GCOV_PROFILE := n | 11 | # since 4.19 |
12 | KBUILD_LDFLAGS := | ||
12 | 13 | ||
13 | BINARIES := jailhouse | 14 | @@ -101,7 +101,7 @@ endef |
14 | @@ -57,7 +57,7 @@ endef | ||
15 | targets += jailhouse.o | 15 | targets += jailhouse.o |
16 | 16 | ||
17 | $(obj)/jailhouse: $(obj)/jailhouse.o | 17 | $(obj)/jailhouse: $(obj)/jailhouse.o |
@@ -20,7 +20,7 @@ Index: git/tools/Makefile | |||
20 | 20 | ||
21 | CFLAGS_jailhouse-gcov-extract.o := -I$(src)/../hypervisor/include \ | 21 | CFLAGS_jailhouse-gcov-extract.o := -I$(src)/../hypervisor/include \ |
22 | -I$(src)/../hypervisor/arch/$(SRCARCH)/include | 22 | -I$(src)/../hypervisor/arch/$(SRCARCH)/include |
23 | @@ -68,10 +68,11 @@ targets += jailhouse-gcov-extract.o | 23 | @@ -112,10 +112,11 @@ targets += jailhouse-gcov-extract.o |
24 | always += jailhouse-gcov-extract | 24 | always += jailhouse-gcov-extract |
25 | 25 | ||
26 | $(obj)/jailhouse-gcov-extract: $(obj)/jailhouse-gcov-extract.o | 26 | $(obj)/jailhouse-gcov-extract: $(obj)/jailhouse-gcov-extract.o |
@@ -32,5 +32,5 @@ Index: git/tools/Makefile | |||
32 | + $< -g $@; \ | 32 | + $< -g $@; \ |
33 | + chmod +x $@ | 33 | + chmod +x $@ |
34 | 34 | ||
35 | install-bin: $(BINARIES) $(DESTDIR)$(sbindir) | 35 | targets += $(MAN8_PAGES) |
36 | $(INSTALL_PROGRAM) $^ | 36 | always += $(MAN8_PAGES) |
diff --git a/recipes-jailhouse/jailhouse/jailhouse.inc b/recipes-jailhouse/jailhouse/jailhouse.inc index e916196..49ac544 100644 --- a/recipes-jailhouse/jailhouse/jailhouse.inc +++ b/recipes-jailhouse/jailhouse/jailhouse.inc | |||
@@ -35,34 +35,42 @@ do_configure() { | |||
35 | 35 | ||
36 | USER_SPACE_CFLAGS = '${CFLAGS} -DLIBEXECDIR=\\\"${libexecdir}\\\" \ | 36 | USER_SPACE_CFLAGS = '${CFLAGS} -DLIBEXECDIR=\\\"${libexecdir}\\\" \ |
37 | -DJAILHOUSE_VERSION=\\\"$JAILHOUSE_VERSION\\\" \ | 37 | -DJAILHOUSE_VERSION=\\\"$JAILHOUSE_VERSION\\\" \ |
38 | -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes -Werror \ | 38 | -Wall -Wextra -Wmissing-declarations -Wmissing-prototypes \ |
39 | -Werror -D__LINUX_COMPILER_TYPES_H \ | ||
39 | -I../driver' | 40 | -I../driver' |
40 | 41 | ||
41 | TOOLS_SRC_DIR = "${S}/tools" | 42 | TOOLS_SRC_DIR = "${S}/tools" |
42 | TOOLS_OBJ_DIR = "${S}/tools" | 43 | TOOLS_OBJ_DIR = "${S}/tools" |
43 | 44 | ||
45 | export LDFLAGS = "" | ||
46 | |||
44 | do_compile() { | 47 | do_compile() { |
45 | oe_runmake V=0 \ | 48 | oe_runmake V=1 \ |
46 | ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} \ | 49 | ARCH=${JH_ARCH} CROSS_COMPILE=${TARGET_PREFIX} \ |
47 | KDIR=${STAGING_KERNEL_BUILDDIR} | 50 | KDIR=${STAGING_KERNEL_BUILDDIR} |
48 | 51 | ||
49 | cd ${TOOLS_SRC_DIR} | 52 | cd ${TOOLS_SRC_DIR} |
50 | export JAILHOUSE_VERSION=$(cat ../VERSION) | 53 | export JAILHOUSE_VERSION=$(cat ../VERSION) |
51 | oe_runmake V=0 \ | 54 | oe_runmake V=1 \ |
52 | CFLAGS="${USER_SPACE_CFLAGS}" \ | 55 | CFLAGS="${USER_SPACE_CFLAGS}" \ |
53 | src=${TOOLS_SRC_DIR} obj=${TOOLS_OBJ_DIR} \ | 56 | src=${TOOLS_SRC_DIR} obj=${TOOLS_OBJ_DIR} \ |
54 | ${TOOLS_OBJ_DIR}/jailhouse-config-collect ${TOOLS_OBJ_DIR}/jailhouse | 57 | ${TOOLS_OBJ_DIR}/jailhouse-cell-linux \ |
58 | ${TOOLS_OBJ_DIR}/jailhouse-cell-stats \ | ||
59 | ${TOOLS_OBJ_DIR}/jailhouse-config-collect \ | ||
60 | ${TOOLS_OBJ_DIR}/jailhouse.8 ${TOOLS_OBJ_DIR}/jailhouse-cell.8 \ | ||
61 | ${TOOLS_OBJ_DIR}/jailhouse-enable.8 \ | ||
62 | ${TOOLS_OBJ_DIR}/jailhouse | ||
55 | } | 63 | } |
56 | 64 | ||
57 | do_install() { | 65 | do_install() { |
58 | oe_runmake \ | 66 | oe_runmake \ |
59 | ARCH=${TARGET_ARCH} \ | 67 | ARCH=${JH_ARCH} \ |
60 | CROSS_COMPILE=${TARGET_PREFIX} \ | 68 | CROSS_COMPILE=${TARGET_PREFIX} \ |
61 | KDIR=${STAGING_KERNEL_BUILDDIR} \ | 69 | KDIR=${STAGING_KERNEL_BUILDDIR} \ |
62 | DESTDIR=${D} install | 70 | DESTDIR=${D} install |
63 | 71 | ||
64 | install -d ${D}${CELL_DIR} | 72 | install -d ${D}${CELL_DIR} |
65 | install ${B}/configs/*.cell ${D}${CELL_DIR}/ | 73 | install ${B}/configs/${JH_ARCH}/*.cell ${D}${CELL_DIR}/ |
66 | 74 | ||
67 | install -d ${D}${INMATES_DIR} | 75 | install -d ${D}${INMATES_DIR} |
68 | install ${B}/inmates/demos/${JH_ARCH}/*.bin ${D}${INMATES_DIR} | 76 | install ${B}/inmates/demos/${JH_ARCH}/*.bin ${D}${INMATES_DIR} |
diff --git a/recipes-jailhouse/jailhouse/jailhouse_git.bb b/recipes-jailhouse/jailhouse/jailhouse_git.bb index 907dc8c..5432047 100644 --- a/recipes-jailhouse/jailhouse/jailhouse_git.bb +++ b/recipes-jailhouse/jailhouse/jailhouse_git.bb | |||
@@ -3,13 +3,14 @@ require jailhouse.inc | |||
3 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-git:" | 3 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-git:" |
4 | 4 | ||
5 | SRC_URI = "git://github.com/siemens/jailhouse.git;protocol=git \ | 5 | SRC_URI = "git://github.com/siemens/jailhouse.git;protocol=git \ |
6 | file://0004-no-kbuild-of-tools.patch \ | 6 | file://no-kbuild-of-tools.patch \ |
7 | file://0005-tools-makefile.patch \ | 7 | file://tools-makefile.patch \ |
8 | " | 8 | file://tools-makefile-man-pages.patch" |
9 | |||
9 | 10 | ||
10 | SRCREV = "${AUTOREV}" | 11 | SRCREV = "${AUTOREV}" |
11 | PV = "0.8-git${SRCPV}" | 12 | PV = "0.9-git${SRCPV}" |
12 | 13 | ||
13 | CELLS = "" | 14 | CELLS = "" |
14 | 15 | ||
15 | DEFAULT_PREFERENCE = "-1" | 16 | #DEFAULT_PREFERENCE = "-1" |