diff options
author | Paul Barker <paul@paulbarker.me.uk> | 2016-06-19 09:48:46 +0100 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2016-06-21 09:40:01 -0400 |
commit | f53bca5f88a0760e902de532a369d0c1b85efce6 (patch) | |
tree | 51f832e0ea7b29736eb585f8643bd85c5cd1141b /recipes-networking/netns | |
parent | 0ce0b5cc747c56ea9e4737ecd0b98633b29b17d2 (diff) | |
download | meta-virtualization-f53bca5f88a0760e902de532a369d0c1b85efce6.tar.gz |
netns: New recipe
netns is a runc hook for setting up simple bridge networking within containers.
See README.md (or https://github.com/jfrazelle/netns/blob/master/README.md) for
instructions on how to use netns.
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-networking/netns')
-rw-r--r-- | recipes-networking/netns/netns_git.bb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/recipes-networking/netns/netns_git.bb b/recipes-networking/netns/netns_git.bb new file mode 100644 index 00000000..073022e5 --- /dev/null +++ b/recipes-networking/netns/netns_git.bb | |||
@@ -0,0 +1,44 @@ | |||
1 | HOMEPAGE = "https://github.com/jfrazelle/netns" | ||
2 | SUMMARY = "Runc hook for setting up default bridge networking." | ||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=20ce4c6a4f32d6ee4a68e3a7506db3f1" | ||
5 | DEPENDS = "go-cross" | ||
6 | |||
7 | SRC_URI = "git://github.com/jfrazelle/netns;branch=master" | ||
8 | SRCREV = "2804050eeab661bfa75c3aa06bdcf60273b02ca7" | ||
9 | PV = "0.1.0+git${SRCPV}" | ||
10 | |||
11 | S = "${WORKDIR}/git" | ||
12 | |||
13 | inherit go-osarchmap | ||
14 | |||
15 | do_compile() { | ||
16 | export GOARCH="${TARGET_GOARCH}" | ||
17 | |||
18 | # Setup vendor directory so that it can be used in GOPATH. | ||
19 | # | ||
20 | # Go looks in a src directory under any directory in GOPATH but netns | ||
21 | # uses 'vendor' instead of 'vendor/src'. We can fix this with a symlink. | ||
22 | # | ||
23 | # We also need to link in the ipallocator directory as that is not under | ||
24 | # a src directory. | ||
25 | ln -sfn . "${S}/vendor/src" | ||
26 | mkdir -p "${S}/vendor/src/github.com/jfrazelle/netns" | ||
27 | ln -sfn "${S}/ipallocator" "${S}/vendor/src/github.com/jfrazelle/netns/ipallocator" | ||
28 | export GOPATH="${S}/vendor" | ||
29 | |||
30 | # Pass the needed cflags/ldflags so that cgo | ||
31 | # can find the needed headers files and libraries | ||
32 | export CGO_ENABLED="1" | ||
33 | export CFLAGS="" | ||
34 | export LDFLAGS="" | ||
35 | export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
36 | export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
37 | |||
38 | oe_runmake static | ||
39 | } | ||
40 | |||
41 | do_install() { | ||
42 | install -d ${D}/${sbindir} | ||
43 | install ${S}/netns ${D}/${sbindir}/netns | ||
44 | } | ||