summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2019-08-07 09:14:44 +0800
committerBruce Ashfield <bruce.ashfield@gmail.com>2019-08-12 11:03:01 -0400
commit0ca391c1c20125fbe0385058c1db0be04539275b (patch)
treeb64ef943d12b4f5411dc5301ecaa9e37b69fbe50
parent7de381880415b20aba3a0840207e9983af489421 (diff)
downloadmeta-virtualization-0ca391c1c20125fbe0385058c1db0be04539275b.tar.gz
runc: add PACKAGECONFIG to allow building as static or not
Add a new PACKAGECONFIG, static, which when enabled will build runc as static. Default to enable it. We need this because we should allow users to build runc as not static so that when docker's cgroup driver is set to systemd, we don't get error. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/runc/files/0001-Makefile-respect-GOBUILDFLAGS-for-runc-and-remove-re.patch35
-rw-r--r--recipes-containers/runc/runc-docker/0001-build-drop-recvtty-and-use-GOBUILDFLAGS.patch22
-rw-r--r--recipes-containers/runc/runc-docker_git.bb2
-rw-r--r--recipes-containers/runc/runc-opencontainers_git.bb1
-rw-r--r--recipes-containers/runc/runc.inc10
5 files changed, 45 insertions, 25 deletions
diff --git a/recipes-containers/runc/files/0001-Makefile-respect-GOBUILDFLAGS-for-runc-and-remove-re.patch b/recipes-containers/runc/files/0001-Makefile-respect-GOBUILDFLAGS-for-runc-and-remove-re.patch
new file mode 100644
index 00000000..94cbb4cb
--- /dev/null
+++ b/recipes-containers/runc/files/0001-Makefile-respect-GOBUILDFLAGS-for-runc-and-remove-re.patch
@@ -0,0 +1,35 @@
1From d2c47a973f354ffd505bb4e809c59e57b543726d Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 6 Aug 2019 19:01:45 +0800
4Subject: [PATCH] Makefile: respect GOBUILDFLAGS for runc and remove recvtty
5 from static
6
7Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
8---
9 Makefile | 3 +--
10 1 file changed, 1 insertion(+), 2 deletions(-)
11
12diff --git a/Makefile b/Makefile
13index 0f26a1c8..a0c6b40b 100644
14--- a/src/import/Makefile
15+++ b/src/import/Makefile
16@@ -30,7 +30,7 @@ SHELL := $(shell command -v bash 2>/dev/null)
17 .DEFAULT: runc
18
19 runc: $(SOURCES)
20- $(GO) build -buildmode=pie $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o runc .
21+ $(GO) build $(GOBUILDFLAGS) $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o runc .
22
23 all: runc recvtty
24
25@@ -41,7 +41,6 @@ contrib/cmd/recvtty/recvtty: $(SOURCES)
26
27 static: $(SOURCES)
28 CGO_ENABLED=1 $(GO) build $(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo osusergo static_build" -installsuffix netgo -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o runc .
29- CGO_ENABLED=1 $(GO) build $(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo osusergo static_build" -installsuffix netgo -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
30
31 release:
32 script/release.sh -r release/$(VERSION) -v $(VERSION)
33--
342.17.1
35
diff --git a/recipes-containers/runc/runc-docker/0001-build-drop-recvtty-and-use-GOBUILDFLAGS.patch b/recipes-containers/runc/runc-docker/0001-build-drop-recvtty-and-use-GOBUILDFLAGS.patch
deleted file mode 100644
index 9ba99571..00000000
--- a/recipes-containers/runc/runc-docker/0001-build-drop-recvtty-and-use-GOBUILDFLAGS.patch
+++ /dev/null
@@ -1,22 +0,0 @@
1From a9a2b9e72027d0b2357f6dfe8b154762aaa8dd02 Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@windriver.com>
3Date: Thu, 19 Apr 2018 16:39:41 -0400
4Subject: [PATCH] build: drop recvtty and use GOBUILDFLAGS
5
6Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
7---
8 Makefile | 3 +--
9 1 file changed, 1 insertion(+), 2 deletions(-)
10
11Index: git/src/import/Makefile
12===================================================================
13--- git.orig/src/import/Makefile
14+++ git/src/import/Makefile
15@@ -41,7 +41,6 @@
16
17 static: $(SOURCES)
18 CGO_ENABLED=1 $(GO) build $(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo osusergo static_build" -installsuffix netgo -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o runc .
19- CGO_ENABLED=1 $(GO) build $(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo osusergo static_build" -installsuffix netgo -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
20
21 release:
22 script/release.sh -r release/$(VERSION) -v $(VERSION)
diff --git a/recipes-containers/runc/runc-docker_git.bb b/recipes-containers/runc/runc-docker_git.bb
index 2bf62224..c9f460b2 100644
--- a/recipes-containers/runc/runc-docker_git.bb
+++ b/recipes-containers/runc/runc-docker_git.bb
@@ -5,7 +5,7 @@ include runc.inc
5SRCREV_runc-docker = "425e105d5a03fabd737a126ad93d62a9eeede87f" 5SRCREV_runc-docker = "425e105d5a03fabd737a126ad93d62a9eeede87f"
6SRC_URI = "git://github.com/opencontainers/runc;nobranch=1;name=runc-docker \ 6SRC_URI = "git://github.com/opencontainers/runc;nobranch=1;name=runc-docker \
7 file://0001-runc-Add-console-socket-dev-null.patch \ 7 file://0001-runc-Add-console-socket-dev-null.patch \
8 file://0001-build-drop-recvtty-and-use-GOBUILDFLAGS.patch \ 8 file://0001-Makefile-respect-GOBUILDFLAGS-for-runc-and-remove-re.patch \
9 file://0001-runc-docker-SIGUSR1-daemonize.patch \ 9 file://0001-runc-docker-SIGUSR1-daemonize.patch \
10 " 10 "
11 11
diff --git a/recipes-containers/runc/runc-opencontainers_git.bb b/recipes-containers/runc/runc-opencontainers_git.bb
index 76ab7941..361bc94b 100644
--- a/recipes-containers/runc/runc-opencontainers_git.bb
+++ b/recipes-containers/runc/runc-opencontainers_git.bb
@@ -3,5 +3,6 @@ include runc.inc
3SRCREV = "652297c7c7e6c94e8d064ad5916c32891a6fd388" 3SRCREV = "652297c7c7e6c94e8d064ad5916c32891a6fd388"
4SRC_URI = " \ 4SRC_URI = " \
5 git://github.com/opencontainers/runc;branch=master \ 5 git://github.com/opencontainers/runc;branch=master \
6 file://0001-Makefile-respect-GOBUILDFLAGS-for-runc-and-remove-re.patch \
6 " 7 "
7RUNC_VERSION = "1.0.0-rc8" 8RUNC_VERSION = "1.0.0-rc8"
diff --git a/recipes-containers/runc/runc.inc b/recipes-containers/runc/runc.inc
index 46fd09dc..41ea41be 100644
--- a/recipes-containers/runc/runc.inc
+++ b/recipes-containers/runc/runc.inc
@@ -14,8 +14,10 @@ inherit go
14inherit goarch 14inherit goarch
15inherit pkgconfig 15inherit pkgconfig
16 16
17PACKAGECONFIG ??= "" 17PACKAGECONFIG ??= "static"
18PACKAGECONFIG[seccomp] = "seccomp,,libseccomp" 18PACKAGECONFIG[seccomp] = "seccomp,,libseccomp"
19# This PACKAGECONFIG serves the purpose of whether building runc as static or not
20PACKAGECONFIG[static] = ""
19 21
20PROVIDES += "virtual/runc" 22PROVIDES += "virtual/runc"
21RPROVIDES_${PN} = "virtual/runc" 23RPROVIDES_${PN} = "virtual/runc"
@@ -54,7 +56,11 @@ do_compile() {
54 export CFLAGS="" 56 export CFLAGS=""
55 export LDFLAGS="" 57 export LDFLAGS=""
56 58
57 oe_runmake static 59 if ${@bb.utils.contains('PACKAGECONFIG', 'static', 'true', 'false', d)}; then
60 oe_runmake static
61 else
62 oe_runmake runc
63 fi
58} 64}
59 65
60do_install() { 66do_install() {