diff options
| author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2018-10-04 09:34:16 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2018-11-05 10:22:54 -0500 |
| commit | d9c64d8aa0d7c5ca8d55e1443684c243b01186f0 (patch) | |
| tree | e8dd7866dfd9e089abd5e7e8efea02a198f131cc | |
| parent | 100fb480e7fa7646682891307a9091e07e7981cd (diff) | |
| download | meta-virtualization-d9c64d8aa0d7c5ca8d55e1443684c243b01186f0.tar.gz | |
kata: WIP
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
| -rw-r--r-- | recipes-core/kata-containers/kata-agent_git.bb | 39 | ||||
| -rw-r--r-- | recipes-core/kata-containers/kata-proxy_git.bb | 34 | ||||
| -rw-r--r-- | recipes-core/kata-containers/kata-runtime_git.bb | 59 | ||||
| -rw-r--r-- | recipes-core/kata-containers/kata-shim_git.bb | 34 |
4 files changed, 166 insertions, 0 deletions
diff --git a/recipes-core/kata-containers/kata-agent_git.bb b/recipes-core/kata-containers/kata-agent_git.bb new file mode 100644 index 00000000..3632ee52 --- /dev/null +++ b/recipes-core/kata-containers/kata-agent_git.bb | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | DESCRIPTION = "Agent run inside a virtual machine, which spawns containers and processes" | ||
| 2 | HOMEPAGE = "https://github.com/kata-containers/agent" | ||
| 3 | LICENSE = "Apache-2.0" | ||
| 4 | LIC_FILES_CHKSUM = "file://src/github.com/kata-containers/agent/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" | ||
| 5 | |||
| 6 | GO_IMPORT = "github.com/kata-containers/agent" | ||
| 7 | SRCREV = "e03f7d7453fabffb17e1540f28666c26178d3cbf" | ||
| 8 | SRC_URI = "git://${GO_IMPORT}.git \ | ||
| 9 | " | ||
| 10 | |||
| 11 | RDEPENDS_${PN}-dev_append = "bash" | ||
| 12 | |||
| 13 | S = "${WORKDIR}/git" | ||
| 14 | |||
| 15 | inherit go | ||
| 16 | |||
| 17 | do_compile() { | ||
| 18 | # Pass the needed cflags/ldflags so that cgo | ||
| 19 | # can find the needed headers files and libraries | ||
| 20 | export GOARCH=${TARGET_GOARCH} | ||
| 21 | export CGO_ENABLED="1" | ||
| 22 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 23 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 24 | |||
| 25 | cd ${S}/src/${GO_IMPORT} | ||
| 26 | oe_runmake kata-agent | ||
| 27 | } | ||
| 28 | |||
| 29 | do_install() { | ||
| 30 | mkdir -p ${D}/${bindir}/ | ||
| 31 | cp ${WORKDIR}/git/src/${GO_IMPORT}/kata-agent ${D}/${bindir} | ||
| 32 | |||
| 33 | mkdir -p ${D}/${systemd_unitdir}/system | ||
| 34 | cp ${WORKDIR}/git/src/${GO_IMPORT}/kata-agent.service ${D}/${systemd_unitdir}/system | ||
| 35 | } | ||
| 36 | |||
| 37 | deltask compile_ptest_base | ||
| 38 | |||
| 39 | FILES_${PN} += "${systemd_unitdir}/*" \ No newline at end of file | ||
diff --git a/recipes-core/kata-containers/kata-proxy_git.bb b/recipes-core/kata-containers/kata-proxy_git.bb new file mode 100644 index 00000000..8de0bfcf --- /dev/null +++ b/recipes-core/kata-containers/kata-proxy_git.bb | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | DESCRIPTION = " Kata Containers stdio proxy component" | ||
| 2 | HOMEPAGE = "https://github.com/kata-containers/proxy" | ||
| 3 | LICENSE = "Apache-2.0" | ||
| 4 | LIC_FILES_CHKSUM = "file://src/github.com/kata-containers/proxy/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" | ||
| 5 | |||
| 6 | GO_IMPORT = "github.com/kata-containers/proxy" | ||
| 7 | SRCREV = "1148847739f9a9f47b92e34e4f309dc109d4dba9" | ||
| 8 | SRC_URI = "git://${GO_IMPORT}.git \ | ||
| 9 | " | ||
| 10 | |||
| 11 | RDEPENDS_${PN}-dev_append = "bash" | ||
| 12 | |||
| 13 | S = "${WORKDIR}/git" | ||
| 14 | |||
| 15 | inherit go | ||
| 16 | |||
| 17 | do_compile() { | ||
| 18 | # Pass the needed cflags/ldflags so that cgo | ||
| 19 | # can find the needed headers files and libraries | ||
| 20 | export GOARCH=${TARGET_GOARCH} | ||
| 21 | export CGO_ENABLED="1" | ||
| 22 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 23 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 24 | |||
| 25 | cd ${S}/src/${GO_IMPORT} | ||
| 26 | oe_runmake kata-proxy | ||
| 27 | } | ||
| 28 | |||
| 29 | do_install() { | ||
| 30 | mkdir -p ${D}/${libexecdir}/kata-containers | ||
| 31 | cp ${WORKDIR}/git/src/${GO_IMPORT}/kata-proxy ${D}/${libexecdir}/kata-containers | ||
| 32 | } | ||
| 33 | |||
| 34 | deltask compile_ptest_base | ||
diff --git a/recipes-core/kata-containers/kata-runtime_git.bb b/recipes-core/kata-containers/kata-runtime_git.bb new file mode 100644 index 00000000..4f250f19 --- /dev/null +++ b/recipes-core/kata-containers/kata-runtime_git.bb | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | DESCRIPTION = " The Command-Line Interface (CLI) part of the Kata Containers runtime component" | ||
| 2 | HOMEPAGE = "https://github.com/kata-containers/runtime" | ||
| 3 | LICENSE = "Apache-2.0" | ||
| 4 | LIC_FILES_CHKSUM = "file://src/github.com/kata-containers/runtime/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" | ||
| 5 | |||
| 6 | GO_IMPORT = "github.com/kata-containers/runtime" | ||
| 7 | SRCREV = "f4cf2137be58c3778d87a8ee8e258e68d1ede888" | ||
| 8 | SRC_URI = "git://${GO_IMPORT}.git \ | ||
| 9 | " | ||
| 10 | RDEPENDS_${PN}-dev_append = "bash" | ||
| 11 | RDEPENDS_${PN} = " \ | ||
| 12 | qemu \ | ||
| 13 | hyperstart \ | ||
| 14 | " | ||
| 15 | |||
| 16 | # grpc | ||
| 17 | |||
| 18 | S = "${WORKDIR}/git" | ||
| 19 | |||
| 20 | inherit go | ||
| 21 | |||
| 22 | do_compile() { | ||
| 23 | # Pass the needed cflags/ldflags so that cgo | ||
| 24 | # can find the needed headers files and libraries | ||
| 25 | export GOARCH=${TARGET_GOARCH} | ||
| 26 | export CGO_ENABLED="1" | ||
| 27 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 28 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 29 | |||
| 30 | cd ${S}/src/${GO_IMPORT} | ||
| 31 | oe_runmake runtime | ||
| 32 | } | ||
| 33 | |||
| 34 | do_install() { | ||
| 35 | mkdir -p ${D}/${bindir} | ||
| 36 | cp ${WORKDIR}/git/src/${GO_IMPORT}/kata-runtime ${D}/${bindir} | ||
| 37 | |||
| 38 | mkdir -p ${D}/${datadir}/defaults/kata-containers/ | ||
| 39 | cp ${WORKDIR}/git/src/${GO_IMPORT}/cli/config/configuration.toml ${D}/${datadir}/defaults/kata-containers/ | ||
| 40 | |||
| 41 | sed -e 's|/usr/bin/qemu-lite-system-x86_64|/usr/bin/qemu-system-x86_64|' -i ${D}/${datadir}/defaults/kata-containers/configuration.toml | ||
| 42 | sed -e 's|/usr/share/kata-containers/vmlinuz.container|/var/lib/hyper/kernel|' -i ${D}/${datadir}/defaults/kata-containers/configuration.toml | ||
| 43 | sed -e 's|/usr/share/kata-containers/kata-containers-initrd.img|/var/lib/hyper/hyper-initrd.img|' -i ${D}/${datadir}/defaults/kata-containers/configuration.toml | ||
| 44 | sed -e 's/^\(image =.*\)/# \1/g' -i ${D}/${datadir}/defaults/kata-containers/configuration.toml | ||
| 45 | |||
| 46 | # TODO: modify the config file for the configured kernel and fix the location of the qemu-system-binary | ||
| 47 | |||
| 48 | # /usr/share/defaults/kata-containers/configuration.toml: file /usr/libexec/kata-containers/kata-shim does not exist | ||
| 49 | # fork/exec /usr/libexec/kata-containers/kata-proxy: no such file or directory | ||
| 50 | |||
| 51 | #64 mknod /dev/kvm c 10 232 | ||
| 52 | #68 kata-runtime --log=/dev/stdout run --bundle /opt/container/cube-server foo | ||
| 53 | |||
| 54 | |||
| 55 | } | ||
| 56 | |||
| 57 | FILES_${PN} += "${datadir}/defaults/kata-containers/*" | ||
| 58 | |||
| 59 | deltask compile_ptest_base | ||
diff --git a/recipes-core/kata-containers/kata-shim_git.bb b/recipes-core/kata-containers/kata-shim_git.bb new file mode 100644 index 00000000..fb55a8e7 --- /dev/null +++ b/recipes-core/kata-containers/kata-shim_git.bb | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | DESCRIPTION = " Handle stdio and signals of the container process" | ||
| 2 | HOMEPAGE = "https://github.com/kata-containers/shim" | ||
| 3 | LICENSE = "Apache-2.0" | ||
| 4 | LIC_FILES_CHKSUM = "file://src/github.com/kata-containers/shim/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" | ||
| 5 | |||
| 6 | GO_IMPORT = "github.com/kata-containers/shim" | ||
| 7 | SRCREV = "bcc35aeca3ef6fa0976005c9e93525906aefed2f" | ||
| 8 | SRC_URI = "git://${GO_IMPORT}.git \ | ||
| 9 | " | ||
| 10 | |||
| 11 | RDEPENDS_${PN}-dev_append = "bash" | ||
| 12 | |||
| 13 | S = "${WORKDIR}/git" | ||
| 14 | |||
| 15 | inherit go | ||
| 16 | |||
| 17 | do_compile() { | ||
| 18 | # Pass the needed cflags/ldflags so that cgo | ||
| 19 | # can find the needed headers files and libraries | ||
| 20 | export GOARCH=${TARGET_GOARCH} | ||
| 21 | export CGO_ENABLED="1" | ||
| 22 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 23 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 24 | |||
| 25 | cd ${S}/src/${GO_IMPORT} | ||
| 26 | oe_runmake kata-shim | ||
| 27 | } | ||
| 28 | |||
| 29 | do_install() { | ||
| 30 | mkdir -p ${D}/${libexecdir}/kata-containers | ||
| 31 | cp ${WORKDIR}/git/src/${GO_IMPORT}/kata-shim ${D}/${libexecdir}/kata-containers | ||
| 32 | } | ||
| 33 | |||
| 34 | deltask compile_ptest_base | ||
