summaryrefslogtreecommitdiffstats
path: root/external/meta-virtualization/recipes-containers/oci-runtime-tools
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-virtualization/recipes-containers/oci-runtime-tools')
-rw-r--r--external/meta-virtualization/recipes-containers/oci-runtime-tools/files/0001-Revert-implement-add-set-function-for-hooks-items.patch202
-rw-r--r--external/meta-virtualization/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb52
2 files changed, 254 insertions, 0 deletions
diff --git a/external/meta-virtualization/recipes-containers/oci-runtime-tools/files/0001-Revert-implement-add-set-function-for-hooks-items.patch b/external/meta-virtualization/recipes-containers/oci-runtime-tools/files/0001-Revert-implement-add-set-function-for-hooks-items.patch
new file mode 100644
index 00000000..99a9310b
--- /dev/null
+++ b/external/meta-virtualization/recipes-containers/oci-runtime-tools/files/0001-Revert-implement-add-set-function-for-hooks-items.patch
@@ -0,0 +1,202 @@
+From 2911eaabab92ec2cdea2b173c3429db4a52bee2f Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@windriver.com>
+Date: Wed, 20 Sep 2017 23:28:52 -0400
+Subject: [PATCH] Revert "implement add/set function for hooks items"
+
+This reverts commit df3a46feb971386f922c7c2c2822b88301f87cb0.
+---
+ cmd/oci-runtime-tool/generate.go | 12 ++++++------
+ generate/generate.go | 42 ++++++----------------------------------
+ 2 files changed, 12 insertions(+), 42 deletions(-)
+
+diff --git a/src/import/cmd/oci-runtime-tool/generate.go b/src/import/cmd/oci-runtime-tool/generate.go
+index ed11fe8f3729..7121ce5fe07e 100644
+--- a/src/import/cmd/oci-runtime-tool/generate.go
++++ b/src/import/cmd/oci-runtime-tool/generate.go
+@@ -354,7 +354,7 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
+ for _, postStartEnv := range postStartEnvs {
+ path, env, err := parseHookEnv(postStartEnv)
+ if err != nil {
+- return err
++ return nil
+ }
+ g.AddPostStartHookEnv(path, env)
+ }
+@@ -387,7 +387,7 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
+ for _, postStopEnv := range postStopEnvs {
+ path, env, err := parseHookEnv(postStopEnv)
+ if err != nil {
+- return err
++ return nil
+ }
+ g.AddPostStopHookEnv(path, env)
+ }
+@@ -398,7 +398,7 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
+ for _, postStopTimeout := range postStopTimeouts {
+ path, timeout, err := parseHookTimeout(postStopTimeout)
+ if err != nil {
+- return err
++ return nil
+ }
+ g.AddPostStopHookTimeout(path, timeout)
+ }
+@@ -409,7 +409,7 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
+ for _, hook := range preStartHooks {
+ path, args, err := parseHook(hook)
+ if err != nil {
+- return err
++ return nil
+ }
+ g.AddPreStartHook(path, args)
+ }
+@@ -420,7 +420,7 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
+ for _, preStartEnv := range preStartEnvs {
+ path, env, err := parseHookEnv(preStartEnv)
+ if err != nil {
+- return err
++ return nil
+ }
+ g.AddPreStartHookEnv(path, env)
+ }
+@@ -431,7 +431,7 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
+ for _, preStartTimeout := range preStartTimeouts {
+ path, timeout, err := parseHookTimeout(preStartTimeout)
+ if err != nil {
+- return err
++ return nil
+ }
+ g.AddPreStartHookTimeout(path, timeout)
+ }
+diff --git a/src/import/generate/generate.go b/src/import/generate/generate.go
+index 84762c3cbd05..ef5d2cc95b3c 100644
+--- a/src/import/generate/generate.go
++++ b/src/import/generate/generate.go
+@@ -744,39 +744,29 @@ func (g *Generator) ClearPreStartHooks() {
+ func (g *Generator) AddPreStartHook(path string, args []string) {
+ g.initSpecHooks()
+ hook := rspec.Hook{Path: path, Args: args}
+- for i, hook := range g.spec.Hooks.Prestart {
+- if hook.Path == path {
+- g.spec.Hooks.Prestart[i] = hook
+- return
+- }
+- }
+ g.spec.Hooks.Prestart = append(g.spec.Hooks.Prestart, hook)
+ }
+
+ // AddPreStartHookEnv adds envs of a prestart hook into g.spec.Hooks.Prestart.
+ func (g *Generator) AddPreStartHookEnv(path string, envs []string) {
+- g.initSpecHooks()
++ g.initSpec()
+ for i, hook := range g.spec.Hooks.Prestart {
+ if hook.Path == path {
+ g.spec.Hooks.Prestart[i].Env = envs
+ return
+ }
+ }
+- hook := rspec.Hook{Path: path, Env: envs}
+- g.spec.Hooks.Prestart = append(g.spec.Hooks.Prestart, hook)
+ }
+
+ // AddPreStartHookTimeout adds timeout of a prestart hook into g.spec.Hooks.Prestart.
+ func (g *Generator) AddPreStartHookTimeout(path string, timeout int) {
+- g.initSpecHooks()
++ g.initSpec()
+ for i, hook := range g.spec.Hooks.Prestart {
+ if hook.Path == path {
+ g.spec.Hooks.Prestart[i].Timeout = &timeout
+ return
+ }
+ }
+- hook := rspec.Hook{Path: path, Timeout: &timeout}
+- g.spec.Hooks.Prestart = append(g.spec.Hooks.Prestart, hook)
+ }
+
+ // ClearPostStopHooks clear g.spec.Hooks.Poststop.
+@@ -794,39 +784,29 @@ func (g *Generator) ClearPostStopHooks() {
+ func (g *Generator) AddPostStopHook(path string, args []string) {
+ g.initSpecHooks()
+ hook := rspec.Hook{Path: path, Args: args}
+- for i, hook := range g.spec.Hooks.Poststop {
+- if hook.Path == path {
+- g.spec.Hooks.Poststop[i] = hook
+- return
+- }
+- }
+ g.spec.Hooks.Poststop = append(g.spec.Hooks.Poststop, hook)
+ }
+
+ // AddPostStopHookEnv adds envs of a poststop hook into g.spec.Hooks.Poststop.
+ func (g *Generator) AddPostStopHookEnv(path string, envs []string) {
+- g.initSpecHooks()
++ g.initSpec()
+ for i, hook := range g.spec.Hooks.Poststop {
+ if hook.Path == path {
+ g.spec.Hooks.Poststop[i].Env = envs
+ return
+ }
+ }
+- hook := rspec.Hook{Path: path, Env: envs}
+- g.spec.Hooks.Poststop = append(g.spec.Hooks.Poststop, hook)
+ }
+
+ // AddPostStopHookTimeout adds timeout of a poststop hook into g.spec.Hooks.Poststop.
+ func (g *Generator) AddPostStopHookTimeout(path string, timeout int) {
+- g.initSpecHooks()
++ g.initSpec()
+ for i, hook := range g.spec.Hooks.Poststop {
+ if hook.Path == path {
+ g.spec.Hooks.Poststop[i].Timeout = &timeout
+ return
+ }
+ }
+- hook := rspec.Hook{Path: path, Timeout: &timeout}
+- g.spec.Hooks.Poststop = append(g.spec.Hooks.Poststop, hook)
+ }
+
+ // ClearPostStartHooks clear g.spec.Hooks.Poststart.
+@@ -844,39 +824,29 @@ func (g *Generator) ClearPostStartHooks() {
+ func (g *Generator) AddPostStartHook(path string, args []string) {
+ g.initSpecHooks()
+ hook := rspec.Hook{Path: path, Args: args}
+- for i, hook := range g.spec.Hooks.Poststart {
+- if hook.Path == path {
+- g.spec.Hooks.Poststart[i] = hook
+- return
+- }
+- }
+ g.spec.Hooks.Poststart = append(g.spec.Hooks.Poststart, hook)
+ }
+
+ // AddPostStartHookEnv adds envs of a poststart hook into g.spec.Hooks.Poststart.
+ func (g *Generator) AddPostStartHookEnv(path string, envs []string) {
+- g.initSpecHooks()
++ g.initSpec()
+ for i, hook := range g.spec.Hooks.Poststart {
+ if hook.Path == path {
+ g.spec.Hooks.Poststart[i].Env = envs
+ return
+ }
+ }
+- hook := rspec.Hook{Path: path, Env: envs}
+- g.spec.Hooks.Poststart = append(g.spec.Hooks.Poststart, hook)
+ }
+
+ // AddPostStartHookTimeout adds timeout of a poststart hook into g.spec.Hooks.Poststart.
+ func (g *Generator) AddPostStartHookTimeout(path string, timeout int) {
+- g.initSpecHooks()
++ g.initSpec()
+ for i, hook := range g.spec.Hooks.Poststart {
+ if hook.Path == path {
+ g.spec.Hooks.Poststart[i].Timeout = &timeout
+ return
+ }
+ }
+- hook := rspec.Hook{Path: path, Timeout: &timeout}
+- g.spec.Hooks.Poststart = append(g.spec.Hooks.Poststart, hook)
+ }
+
+ // AddTmpfsMount adds a tmpfs mount into g.spec.Mounts.
+--
+2.4.0.53.g8440f74
+
diff --git a/external/meta-virtualization/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb b/external/meta-virtualization/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb
new file mode 100644
index 00000000..adbfc1ef
--- /dev/null
+++ b/external/meta-virtualization/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb
@@ -0,0 +1,52 @@
+HOMEPAGE = "https://github.com/opencontainers/runtime-tools"
+SUMMARY = "oci-runtime-tool is a collection of tools for working with the OCI runtime specification"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=b355a61a394a504dacde901c958f662c"
+
+SRC_URI = "git://github.com/opencontainers/runtime-tools.git \
+ file://0001-Revert-implement-add-set-function-for-hooks-items.patch \
+ "
+
+SRCREV = "6e7da8148f4de2c9e9c9d3b345576898d4f412cb"
+PV = "0.1.0+git${SRCPV}"
+GO_IMPORT = "import"
+
+INSANE_SKIP_${PN} += "ldflags textrel"
+
+inherit goarch
+inherit go
+
+do_compile() {
+ export GOARCH="${TARGET_GOARCH}"
+ export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
+ export GOPATH="${S}/src/import:${S}/src/import/vendor"
+
+ # Pass the needed cflags/ldflags so that cgo
+ # can find the needed headers files and libraries
+ export CGO_ENABLED="1"
+ export CFLAGS=""
+ export LDFLAGS=""
+ export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+ export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
+
+ # link fixups for compilation
+ rm -f ${S}/src/import/vendor/src
+ ln -sf ./ ${S}/src/import/vendor/src
+ mkdir -p ${S}/src/import/vendor/github.com/opencontainers/runtime-tools
+ ln -sf ../../../../generate ${S}/src/import/vendor/github.com/opencontainers/runtime-tools/generate
+ ln -sf ../../../../validate ${S}/src/import/vendor/github.com/opencontainers/runtime-tools/validate
+ ln -sf ../../../../cmd ${S}/src/import/vendor/github.com/opencontainers/runtime-tools/cmd
+ ln -sf ../../../../error ${S}/src/import/vendor/github.com/opencontainers/runtime-tools/error
+ ln -sf ../../../../specerror ${S}/src/import/vendor/github.com/opencontainers/runtime-tools/specerror
+ cd ${S}/src/import
+
+ oe_runmake
+}
+
+do_install() {
+ install -d ${D}/${sbindir}
+ install ${S}/src/import/oci-runtime-tool ${D}/${sbindir}/oci-runtime-tool
+}
+
+deltask compile_ptest_base
+