summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-containers/runc/runc-docker/0001-Disable-building-recvtty.patch19
-rw-r--r--recipes-containers/runc/runc-docker/0001-Update-to-runtime-spec-198f23f827eea397d4331d7eb048d.patch89
-rw-r--r--recipes-containers/runc/runc-docker/0001-Use-correct-go-cross-compiler.patch85
-rw-r--r--recipes-containers/runc/runc-docker/0001-runc-docker-SIGUSR1-daemonize.patch36
-rw-r--r--recipes-containers/runc/runc-docker/0002-Remove-Platform-as-no-longer-in-OCI-spec.patch75
-rw-r--r--recipes-containers/runc/runc-docker/0003-Update-memory-specs-to-use-int64-not-uint64.patch194
-rw-r--r--recipes-containers/runc/runc-docker_git.bb10
-rw-r--r--recipes-containers/runc/runc-opencontainers_git.bb4
8 files changed, 30 insertions, 482 deletions
diff --git a/recipes-containers/runc/runc-docker/0001-Disable-building-recvtty.patch b/recipes-containers/runc/runc-docker/0001-Disable-building-recvtty.patch
index fa1f695b..8de1b170 100644
--- a/recipes-containers/runc/runc-docker/0001-Disable-building-recvtty.patch
+++ b/recipes-containers/runc/runc-docker/0001-Disable-building-recvtty.patch
@@ -9,18 +9,15 @@ Upstream-status: Inappropriate
9 Makefile | 1 - 9 Makefile | 1 -
10 1 file changed, 1 deletion(-) 10 1 file changed, 1 deletion(-)
11 11
12diff --git a/Makefile b/Makefile 12Index: git/src/import/Makefile
13index 0fcf508..24f47dc 100644 13===================================================================
14--- a/src/import/Makefile 14--- git.orig/src/import/Makefile
15+++ b/src/import/Makefile 15+++ git/src/import/Makefile
16@@ -38,7 +38,6 @@ contrib/cmd/recvtty/recvtty: $(SOURCES) 16@@ -40,7 +40,6 @@
17 17
18 static: $(SOURCES) 18 static: $(SOURCES)
19 CGO_ENABLED=1 $(GO) build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -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 cgo static_build" -installsuffix netgo -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o runc .
20- CGO_ENABLED=1 $(GO) build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty 20- CGO_ENABLED=1 $(GO) build $(EXTRA_FLAGS) -tags "$(BUILDTAGS) netgo cgo 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
21 21
22 release: 22 release:
23 @flag_list=(seccomp selinux apparmor static); \ 23 script/release.sh -r release/$(VERSION) -v $(VERSION)
24--
252.7.4
26
diff --git a/recipes-containers/runc/runc-docker/0001-Update-to-runtime-spec-198f23f827eea397d4331d7eb048d.patch b/recipes-containers/runc/runc-docker/0001-Update-to-runtime-spec-198f23f827eea397d4331d7eb048d.patch
deleted file mode 100644
index bcc76fc4..00000000
--- a/recipes-containers/runc/runc-docker/0001-Update-to-runtime-spec-198f23f827eea397d4331d7eb048d.patch
+++ /dev/null
@@ -1,89 +0,0 @@
1From e8ef6025a4f48620baf91737cd37eb5e6a40f48c Mon Sep 17 00:00:00 2001
2From: Justin Cormack <justin.cormack@docker.com>
3Date: Fri, 23 Jun 2017 17:14:59 -0700
4Subject: [PATCH 1/3] Update to runtime spec
5 198f23f827eea397d4331d7eb048d9d4c7ff7bee
6
7Updates memory limits to be int64, and removes Platform from spec.
8
9Signed-off-by: Justin Cormack <justin.cormack@docker.com>
10---
11 vendor.conf | 2 +-
12 .../opencontainers/runtime-spec/specs-go/config.go | 23 ++++++----------------
13 2 files changed, 7 insertions(+), 18 deletions(-)
14
15diff --git a/vendor.conf b/vendor.conf
16index e23e7ea7..09a8a924 100644
17--- a/src/import/vendor.conf
18+++ b/src/import/vendor.conf
19@@ -1,7 +1,7 @@
20 # OCI runtime-spec. When updating this, make sure you use a version tag rather
21 # than a commit ID so it's much more obvious what version of the spec we are
22 # using.
23-github.com/opencontainers/runtime-spec 239c4e44f2a612ed85f6db9c66247aa33f437e91
24+github.com/opencontainers/runtime-spec 198f23f827eea397d4331d7eb048d9d4c7ff7bee
25 # Core libcontainer functionality.
26 github.com/mrunalp/fileutils ed869b029674c0e9ce4c0dfa781405c2d9946d08
27 github.com/opencontainers/selinux v1.0.0-rc1
28diff --git a/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go b/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go
29index 8bf8d924..68ab112e 100644
30--- a/src/import/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go
31+++ b/src/import/vendor/github.com/opencontainers/runtime-spec/specs-go/config.go
32@@ -6,8 +6,6 @@ import "os"
33 type Spec struct {
34 // Version of the Open Container Runtime Specification with which the bundle complies.
35 Version string `json:"ociVersion"`
36- // Platform specifies the configuration's target platform.
37- Platform Platform `json:"platform"`
38 // Process configures the container process.
39 Process *Process `json:"process,omitempty"`
40 // Root configures the container's root filesystem.
41@@ -101,15 +99,6 @@ type Root struct {
42 Readonly bool `json:"readonly,omitempty"`
43 }
44
45-// Platform specifies OS and arch information for the host system that the container
46-// is created for.
47-type Platform struct {
48- // OS is the operating system.
49- OS string `json:"os"`
50- // Arch is the architecture
51- Arch string `json:"arch"`
52-}
53-
54 // Mount specifies a mount for a container.
55 type Mount struct {
56 // Destination is the absolute path where the mount will be placed in the container.
57@@ -284,15 +273,15 @@ type LinuxBlockIO struct {
58 // LinuxMemory for Linux cgroup 'memory' resource management
59 type LinuxMemory struct {
60 // Memory limit (in bytes).
61- Limit *uint64 `json:"limit,omitempty"`
62+ Limit *int64 `json:"limit,omitempty"`
63 // Memory reservation or soft_limit (in bytes).
64- Reservation *uint64 `json:"reservation,omitempty"`
65+ Reservation *int64 `json:"reservation,omitempty"`
66 // Total memory limit (memory + swap).
67- Swap *uint64 `json:"swap,omitempty"`
68+ Swap *int64 `json:"swap,omitempty"`
69 // Kernel memory limit (in bytes).
70- Kernel *uint64 `json:"kernel,omitempty"`
71+ Kernel *int64 `json:"kernel,omitempty"`
72 // Kernel memory limit for tcp (in bytes)
73- KernelTCP *uint64 `json:"kernelTCP,omitempty"`
74+ KernelTCP *int64 `json:"kernelTCP,omitempty"`
75 // How aggressive the kernel will swap memory pages.
76 Swappiness *uint64 `json:"swappiness,omitempty"`
77 }
78@@ -486,7 +475,7 @@ type WindowsNetwork struct {
79 EndpointList []string `json:"endpointList,omitempty"`
80 // Specifies if unqualified DNS name resolution is allowed.
81 AllowUnqualifiedDNSQuery bool `json:"allowUnqualifiedDNSQuery,omitempty"`
82- // Comma seperated list of DNS suffixes to use for name resolution.
83+ // Comma separated list of DNS suffixes to use for name resolution.
84 DNSSearchList []string `json:"DNSSearchList,omitempty"`
85 // Name (ID) of the container that we will share with the network stack.
86 NetworkSharedContainerName string `json:"networkSharedContainerName,omitempty"`
87--
882.11.0
89
diff --git a/recipes-containers/runc/runc-docker/0001-Use-correct-go-cross-compiler.patch b/recipes-containers/runc/runc-docker/0001-Use-correct-go-cross-compiler.patch
deleted file mode 100644
index 8f5171ab..00000000
--- a/recipes-containers/runc/runc-docker/0001-Use-correct-go-cross-compiler.patch
+++ /dev/null
@@ -1,85 +0,0 @@
1From 037c20b3b3ef5e9ead0282aa64f9b88c0c18934d Mon Sep 17 00:00:00 2001
2From: Paul Barker <pbarker@toganlabs.com>
3Date: Thu, 5 Oct 2017 13:14:40 +0000
4Subject: [PATCH] Use correct go cross-compiler
5
6We need to use '${GO}' as set by OpenEmbedded instead of just 'go'. Just using
7'go' will invoke go-native.
8
9Signed-off-by: Paul Barker <pbarker@toganlabs.com>
10Upstream-status: Inappropriate
11---
12 Makefile | 20 ++++++++++----------
13 1 file changed, 10 insertions(+), 10 deletions(-)
14
15diff --git a/Makefile b/Makefile
16index 8117892..0fcf508 100644
17--- a/src/import/Makefile
18+++ b/src/import/Makefile
19@@ -27,18 +27,18 @@ SHELL := $(shell command -v bash 2>/dev/null)
20 .DEFAULT: runc
21
22 runc: $(SOURCES)
23- go build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o runc .
24+ $(GO) build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o runc .
25
26 all: runc recvtty
27
28 recvtty: contrib/cmd/recvtty/recvtty
29
30 contrib/cmd/recvtty/recvtty: $(SOURCES)
31- go build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
32+ $(GO) build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
33
34 static: $(SOURCES)
35- CGO_ENABLED=1 go build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o runc .
36- CGO_ENABLED=1 go build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
37+ CGO_ENABLED=1 $(GO) build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o runc .
38+ CGO_ENABLED=1 $(GO) build -i $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
39
40 release:
41 @flag_list=(seccomp selinux apparmor static); \
42@@ -62,15 +62,15 @@ release:
43 CGO_ENABLED=1; \
44 }; \
45 echo "Building target: $$output"; \
46- go build -i $(EXTRA_FLAGS) -ldflags "$$ldflags $(EXTRA_LDFLAGS)" -tags "$$tags" -o "$$output" .; \
47+ $(GO) build -i $(EXTRA_FLAGS) -ldflags "$$ldflags $(EXTRA_LDFLAGS)" -tags "$$tags" -o "$$output" .; \
48 done
49
50 dbuild: runcimage
51 docker run --rm -v $(CURDIR):/go/src/$(PROJECT) --privileged $(RUNC_IMAGE) make clean all
52
53 lint:
54- go vet $(allpackages)
55- go fmt $(allpackages)
56+ $(GO) vet $(allpackages)
57+ $(GO) fmt $(allpackages)
58
59 man:
60 man/md2man-all.sh
61@@ -88,7 +88,7 @@ unittest: runcimage
62 docker run -e TESTFLAGS -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localunittest
63
64 localunittest: all
65- go test -timeout 3m -tags "$(BUILDTAGS)" ${TESTFLAGS} -v $(allpackages)
66+ $(GO) test -timeout 3m -tags "$(BUILDTAGS)" ${TESTFLAGS} -v $(allpackages)
67
68 integration: runcimage
69 docker run -e TESTFLAGS -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localintegration
70@@ -134,10 +134,10 @@ clean:
71 validate:
72 script/validate-gofmt
73 script/validate-shfmt
74- go vet $(allpackages)
75+ $(GO) vet $(allpackages)
76
77 ci: validate localtest
78
79 # memoize allpackages, so that it's executed only once and only if used
80-_allpackages = $(shell go list ./... | grep -v vendor)
81+_allpackages = $(shell $(GO) list ./... | grep -v vendor)
82 allpackages = $(if $(__allpackages),,$(eval __allpackages := $$(_allpackages)))$(__allpackages)
83--
842.7.4
85
diff --git a/recipes-containers/runc/runc-docker/0001-runc-docker-SIGUSR1-daemonize.patch b/recipes-containers/runc/runc-docker/0001-runc-docker-SIGUSR1-daemonize.patch
index b3bd0680..9ccbccb2 100644
--- a/recipes-containers/runc/runc-docker/0001-runc-docker-SIGUSR1-daemonize.patch
+++ b/recipes-containers/runc/runc-docker/0001-runc-docker-SIGUSR1-daemonize.patch
@@ -29,19 +29,19 @@ Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
29 utils_linux.go | 2 +- 29 utils_linux.go | 2 +-
30 2 files changed, 51 insertions(+), 5 deletions(-) 30 2 files changed, 51 insertions(+), 5 deletions(-)
31 31
32diff --git a/src/import/signals.go b/src/import/signals.go 32Index: git/src/import/signals.go
33index 910ea1ee..b6a23476 100644 33===================================================================
34--- a/src/import/signals.go 34--- git.orig/src/import/signals.go
35+++ b/src/import/signals.go 35+++ git/src/import/signals.go
36@@ -6,6 +6,7 @@ import ( 36@@ -6,6 +6,7 @@
37 "os" 37 "os"
38 "os/signal" 38 "os/signal"
39 "syscall" // only for Signal 39 "syscall" // only for Signal
40+ "strconv" 40+ "strconv"
41 41
42 "github.com/Sirupsen/logrus"
43 "github.com/opencontainers/runc/libcontainer" 42 "github.com/opencontainers/runc/libcontainer"
44@@ -56,9 +57,6 @@ type signalHandler struct { 43 "github.com/opencontainers/runc/libcontainer/system"
44@@ -56,9 +57,6 @@
45 func (h *signalHandler) forward(process *libcontainer.Process, tty *tty, detach bool) (int, error) { 45 func (h *signalHandler) forward(process *libcontainer.Process, tty *tty, detach bool) (int, error) {
46 // make sure we know the pid of our main process so that we can return 46 // make sure we know the pid of our main process so that we can return
47 // after it dies. 47 // after it dies.
@@ -51,7 +51,7 @@ index 910ea1ee..b6a23476 100644
51 51
52 pid1, err := process.Pid() 52 pid1, err := process.Pid()
53 if err != nil { 53 if err != nil {
54@@ -68,12 +66,60 @@ func (h *signalHandler) forward(process *libcontainer.Process, tty *tty, detach 54@@ -68,12 +66,61 @@
55 if h.notifySocket != nil { 55 if h.notifySocket != nil {
56 if detach { 56 if detach {
57 h.notifySocket.run(pid1) 57 h.notifySocket.run(pid1)
@@ -110,14 +110,15 @@ index 910ea1ee..b6a23476 100644
110+ } 110+ }
111+ return 0, nil 111+ return 0, nil
112+ } 112+ }
113 // perform the initial tty resize. 113+
114 tty.resize() 114 // Perform the initial tty resize. Always ignore errors resizing because
115 for s := range h.signals { 115 // stdout might have disappeared (due to races with when SIGHUP is sent).
116diff --git a/src/import/utils_linux.go b/src/import/utils_linux.go 116 _ = tty.resize()
117index e6d31b35..1bb80a63 100644 117Index: git/src/import/utils_linux.go
118--- a/src/import/utils_linux.go 118===================================================================
119+++ b/src/import/utils_linux.go 119--- git.orig/src/import/utils_linux.go
120@@ -308,7 +308,7 @@ func (r *runner) run(config *specs.Process) (int, error) { 120+++ git/src/import/utils_linux.go
121@@ -338,7 +338,7 @@
121 if err != nil { 122 if err != nil {
122 r.terminate(process) 123 r.terminate(process)
123 } 124 }
@@ -126,6 +127,3 @@ index e6d31b35..1bb80a63 100644
126 return 0, nil 127 return 0, nil
127 } 128 }
128 r.destroy() 129 r.destroy()
129--
1302.11.0
131
diff --git a/recipes-containers/runc/runc-docker/0002-Remove-Platform-as-no-longer-in-OCI-spec.patch b/recipes-containers/runc/runc-docker/0002-Remove-Platform-as-no-longer-in-OCI-spec.patch
deleted file mode 100644
index 7970dec3..00000000
--- a/recipes-containers/runc/runc-docker/0002-Remove-Platform-as-no-longer-in-OCI-spec.patch
+++ /dev/null
@@ -1,75 +0,0 @@
1From e1146182a8cebb5a6133a9e298a5e4acf99652e9 Mon Sep 17 00:00:00 2001
2From: Justin Cormack <justin.cormack@docker.com>
3Date: Fri, 23 Jun 2017 17:16:08 -0700
4Subject: [PATCH 2/3] Remove Platform as no longer in OCI spec
5
6This was never used, just validated, so was removed from spec.
7
8Signed-off-by: Justin Cormack <justin.cormack@docker.com>
9---
10 libcontainer/specconv/example.go | 5 -----
11 spec.go | 14 --------------
12 2 files changed, 19 deletions(-)
13
14diff --git a/libcontainer/specconv/example.go b/libcontainer/specconv/example.go
15index 33134116..d6621194 100644
16--- a/src/import/libcontainer/specconv/example.go
17+++ b/src/import/libcontainer/specconv/example.go
18@@ -2,7 +2,6 @@ package specconv
19
20 import (
21 "os"
22- "runtime"
23 "strings"
24
25 "github.com/opencontainers/runtime-spec/specs-go"
26@@ -15,10 +14,6 @@ func sPtr(s string) *string { return &s }
27 func Example() *specs.Spec {
28 return &specs.Spec{
29 Version: specs.Version,
30- Platform: specs.Platform{
31- OS: runtime.GOOS,
32- Arch: runtime.GOARCH,
33- },
34 Root: specs.Root{
35 Path: "rootfs",
36 Readonly: true,
37diff --git a/spec.go b/spec.go
38index 92d38f57..876937d2 100644
39--- a/src/import/spec.go
40+++ b/src/import/spec.go
41@@ -7,7 +7,6 @@ import (
42 "fmt"
43 "io/ioutil"
44 "os"
45- "runtime"
46
47 "github.com/opencontainers/runc/libcontainer/configs"
48 "github.com/opencontainers/runc/libcontainer/specconv"
49@@ -131,9 +130,6 @@ func loadSpec(cPath string) (spec *specs.Spec, err error) {
50 if err = json.NewDecoder(cf).Decode(&spec); err != nil {
51 return nil, err
52 }
53- if err = validatePlatform(&spec.Platform); err != nil {
54- return nil, err
55- }
56 return spec, validateProcessSpec(spec.Process)
57 }
58
59@@ -148,13 +144,3 @@ func createLibContainerRlimit(rlimit specs.LinuxRlimit) (configs.Rlimit, error)
60 Soft: rlimit.Soft,
61 }, nil
62 }
63-
64-func validatePlatform(platform *specs.Platform) error {
65- if platform.OS != runtime.GOOS {
66- return fmt.Errorf("target os %s mismatch with current os %s", platform.OS, runtime.GOOS)
67- }
68- if platform.Arch != runtime.GOARCH {
69- return fmt.Errorf("target arch %s mismatch with current arch %s", platform.Arch, runtime.GOARCH)
70- }
71- return nil
72-}
73--
742.11.0
75
diff --git a/recipes-containers/runc/runc-docker/0003-Update-memory-specs-to-use-int64-not-uint64.patch b/recipes-containers/runc/runc-docker/0003-Update-memory-specs-to-use-int64-not-uint64.patch
deleted file mode 100644
index 50a9b7fc..00000000
--- a/recipes-containers/runc/runc-docker/0003-Update-memory-specs-to-use-int64-not-uint64.patch
+++ /dev/null
@@ -1,194 +0,0 @@
1From 3d9074ead33a5c27dc20bb49457c69c6d2ae6b57 Mon Sep 17 00:00:00 2001
2From: Justin Cormack <justin.cormack@docker.com>
3Date: Fri, 23 Jun 2017 17:17:00 -0700
4Subject: [PATCH 3/3] Update memory specs to use int64 not uint64
5
6replace #1492 #1494
7fix #1422
8
9Since https://github.com/opencontainers/runtime-spec/pull/876 the memory
10specifications are now `int64`, as that better matches the visible interface where
11`-1` is a valid value. Otherwise finding the correct value was difficult as it
12was kernel dependent.
13
14Signed-off-by: Justin Cormack <justin.cormack@docker.com>
15---
16 libcontainer/cgroups/fs/memory.go | 36 +++++++++++++++++-------------------
17 libcontainer/configs/cgroup_linux.go | 10 +++++-----
18 update.go | 14 +++++++-------
19 3 files changed, 29 insertions(+), 31 deletions(-)
20
21diff --git a/libcontainer/cgroups/fs/memory.go b/libcontainer/cgroups/fs/memory.go
22index da2cc9f8..b739c631 100644
23--- a/src/import/libcontainer/cgroups/fs/memory.go
24+++ b/src/import/libcontainer/cgroups/fs/memory.go
25@@ -73,14 +73,14 @@ func EnableKernelMemoryAccounting(path string) error {
26 // until a limit is set on the cgroup and limit cannot be set once the
27 // cgroup has children, or if there are already tasks in the cgroup.
28 for _, i := range []int64{1, -1} {
29- if err := setKernelMemory(path, uint64(i)); err != nil {
30+ if err := setKernelMemory(path, i); err != nil {
31 return err
32 }
33 }
34 return nil
35 }
36
37-func setKernelMemory(path string, kernelMemoryLimit uint64) error {
38+func setKernelMemory(path string, kernelMemoryLimit int64) error {
39 if path == "" {
40 return fmt.Errorf("no such directory for %s", cgroupKernelMemoryLimit)
41 }
42@@ -88,7 +88,7 @@ func setKernelMemory(path string, kernelMemoryLimit uint64) error {
43 // kernel memory is not enabled on the system so we should do nothing
44 return nil
45 }
46- if err := ioutil.WriteFile(filepath.Join(path, cgroupKernelMemoryLimit), []byte(strconv.FormatUint(kernelMemoryLimit, 10)), 0700); err != nil {
47+ if err := ioutil.WriteFile(filepath.Join(path, cgroupKernelMemoryLimit), []byte(strconv.FormatInt(kernelMemoryLimit, 10)), 0700); err != nil {
48 // Check if the error number returned by the syscall is "EBUSY"
49 // The EBUSY signal is returned on attempts to write to the
50 // memory.kmem.limit_in_bytes file if the cgroup has children or
51@@ -106,14 +106,12 @@ func setKernelMemory(path string, kernelMemoryLimit uint64) error {
52 }
53
54 func setMemoryAndSwap(path string, cgroup *configs.Cgroup) error {
55- ulimited := -1
56-
57- // If the memory update is set to uint64(-1) we should also
58- // set swap to uint64(-1), it means unlimited memory.
59- if cgroup.Resources.Memory == uint64(ulimited) {
60- // Only set swap if it's enbled in kernel
61+ // If the memory update is set to -1 we should also
62+ // set swap to -1, it means unlimited memory.
63+ if cgroup.Resources.Memory == -1 {
64+ // Only set swap if it's enabled in kernel
65 if cgroups.PathExists(filepath.Join(path, cgroupMemorySwapLimit)) {
66- cgroup.Resources.MemorySwap = uint64(ulimited)
67+ cgroup.Resources.MemorySwap = -1
68 }
69 }
70
71@@ -128,29 +126,29 @@ func setMemoryAndSwap(path string, cgroup *configs.Cgroup) error {
72 // When update memory limit, we should adapt the write sequence
73 // for memory and swap memory, so it won't fail because the new
74 // value and the old value don't fit kernel's validation.
75- if cgroup.Resources.MemorySwap == uint64(ulimited) || memoryUsage.Limit < cgroup.Resources.MemorySwap {
76- if err := writeFile(path, cgroupMemorySwapLimit, strconv.FormatUint(cgroup.Resources.MemorySwap, 10)); err != nil {
77+ if cgroup.Resources.MemorySwap == -1 || memoryUsage.Limit < uint64(cgroup.Resources.MemorySwap) {
78+ if err := writeFile(path, cgroupMemorySwapLimit, strconv.FormatInt(cgroup.Resources.MemorySwap, 10)); err != nil {
79 return err
80 }
81- if err := writeFile(path, cgroupMemoryLimit, strconv.FormatUint(cgroup.Resources.Memory, 10)); err != nil {
82+ if err := writeFile(path, cgroupMemoryLimit, strconv.FormatInt(cgroup.Resources.Memory, 10)); err != nil {
83 return err
84 }
85 } else {
86- if err := writeFile(path, cgroupMemoryLimit, strconv.FormatUint(cgroup.Resources.Memory, 10)); err != nil {
87+ if err := writeFile(path, cgroupMemoryLimit, strconv.FormatInt(cgroup.Resources.Memory, 10)); err != nil {
88 return err
89 }
90- if err := writeFile(path, cgroupMemorySwapLimit, strconv.FormatUint(cgroup.Resources.MemorySwap, 10)); err != nil {
91+ if err := writeFile(path, cgroupMemorySwapLimit, strconv.FormatInt(cgroup.Resources.MemorySwap, 10)); err != nil {
92 return err
93 }
94 }
95 } else {
96 if cgroup.Resources.Memory != 0 {
97- if err := writeFile(path, cgroupMemoryLimit, strconv.FormatUint(cgroup.Resources.Memory, 10)); err != nil {
98+ if err := writeFile(path, cgroupMemoryLimit, strconv.FormatInt(cgroup.Resources.Memory, 10)); err != nil {
99 return err
100 }
101 }
102 if cgroup.Resources.MemorySwap != 0 {
103- if err := writeFile(path, cgroupMemorySwapLimit, strconv.FormatUint(cgroup.Resources.MemorySwap, 10)); err != nil {
104+ if err := writeFile(path, cgroupMemorySwapLimit, strconv.FormatInt(cgroup.Resources.MemorySwap, 10)); err != nil {
105 return err
106 }
107 }
108@@ -171,13 +169,13 @@ func (s *MemoryGroup) Set(path string, cgroup *configs.Cgroup) error {
109 }
110
111 if cgroup.Resources.MemoryReservation != 0 {
112- if err := writeFile(path, "memory.soft_limit_in_bytes", strconv.FormatUint(cgroup.Resources.MemoryReservation, 10)); err != nil {
113+ if err := writeFile(path, "memory.soft_limit_in_bytes", strconv.FormatInt(cgroup.Resources.MemoryReservation, 10)); err != nil {
114 return err
115 }
116 }
117
118 if cgroup.Resources.KernelMemoryTCP != 0 {
119- if err := writeFile(path, "memory.kmem.tcp.limit_in_bytes", strconv.FormatUint(cgroup.Resources.KernelMemoryTCP, 10)); err != nil {
120+ if err := writeFile(path, "memory.kmem.tcp.limit_in_bytes", strconv.FormatInt(cgroup.Resources.KernelMemoryTCP, 10)); err != nil {
121 return err
122 }
123 }
124diff --git a/libcontainer/configs/cgroup_linux.go b/libcontainer/configs/cgroup_linux.go
125index 3e0509de..e15a662f 100644
126--- a/src/import/libcontainer/configs/cgroup_linux.go
127+++ b/src/import/libcontainer/configs/cgroup_linux.go
128@@ -43,19 +43,19 @@ type Resources struct {
129 Devices []*Device `json:"devices"`
130
131 // Memory limit (in bytes)
132- Memory uint64 `json:"memory"`
133+ Memory int64 `json:"memory"`
134
135 // Memory reservation or soft_limit (in bytes)
136- MemoryReservation uint64 `json:"memory_reservation"`
137+ MemoryReservation int64 `json:"memory_reservation"`
138
139 // Total memory usage (memory + swap); set `-1` to enable unlimited swap
140- MemorySwap uint64 `json:"memory_swap"`
141+ MemorySwap int64 `json:"memory_swap"`
142
143 // Kernel memory limit (in bytes)
144- KernelMemory uint64 `json:"kernel_memory"`
145+ KernelMemory int64 `json:"kernel_memory"`
146
147 // Kernel memory limit for TCP use (in bytes)
148- KernelMemoryTCP uint64 `json:"kernel_memory_tcp"`
149+ KernelMemoryTCP int64 `json:"kernel_memory_tcp"`
150
151 // CPU shares (relative weight vs. other containers)
152 CpuShares uint64 `json:"cpu_shares"`
153diff --git a/update.go b/update.go
154index 0ea90d60..133be999 100644
155--- a/src/import/update.go
156+++ b/src/import/update.go
157@@ -124,11 +124,11 @@ other options are ignored.
158
159 r := specs.LinuxResources{
160 Memory: &specs.LinuxMemory{
161- Limit: u64Ptr(0),
162- Reservation: u64Ptr(0),
163- Swap: u64Ptr(0),
164- Kernel: u64Ptr(0),
165- KernelTCP: u64Ptr(0),
166+ Limit: i64Ptr(0),
167+ Reservation: i64Ptr(0),
168+ Swap: i64Ptr(0),
169+ Kernel: i64Ptr(0),
170+ KernelTCP: i64Ptr(0),
171 },
172 CPU: &specs.LinuxCPU{
173 Shares: u64Ptr(0),
174@@ -213,7 +213,7 @@ other options are ignored.
175 }
176 for _, pair := range []struct {
177 opt string
178- dest *uint64
179+ dest *int64
180 }{
181 {"memory", r.Memory.Limit},
182 {"memory-swap", r.Memory.Swap},
183@@ -232,7 +232,7 @@ other options are ignored.
184 } else {
185 v = -1
186 }
187- *pair.dest = uint64(v)
188+ *pair.dest = v
189 }
190 }
191 r.Pids.Limit = int64(context.Int("pids-limit"))
192--
1932.11.0
194
diff --git a/recipes-containers/runc/runc-docker_git.bb b/recipes-containers/runc/runc-docker_git.bb
index f31b82ec..9acfbae4 100644
--- a/recipes-containers/runc/runc-docker_git.bb
+++ b/recipes-containers/runc/runc-docker_git.bb
@@ -2,15 +2,11 @@ include runc.inc
2 2
3# Note: this rev is before the required protocol field, update when all components 3# Note: this rev is before the required protocol field, update when all components
4# have been updated to match. 4# have been updated to match.
5SRCREV_runc-docker = "9d6821d1b53908e249487741eccd567249ca1d99" 5SRCREV_runc-docker = "4fc53a81fb7c994640722ac585fa9ca548971871"
6SRC_URI = "git://github.com/docker/runc.git;nobranch=1;name=runc-docker \ 6SRC_URI = "git://github.com/opencontainers/runc;nobranch=1;name=runc-docker \
7 file://0001-Update-to-runtime-spec-198f23f827eea397d4331d7eb048d.patch \
8 file://0002-Remove-Platform-as-no-longer-in-OCI-spec.patch \
9 file://0003-Update-memory-specs-to-use-int64-not-uint64.patch \
10 file://0001-runc-Add-console-socket-dev-null.patch \ 7 file://0001-runc-Add-console-socket-dev-null.patch \
11 file://0001-Use-correct-go-cross-compiler.patch \
12 file://0001-Disable-building-recvtty.patch \ 8 file://0001-Disable-building-recvtty.patch \
13 file://0001-runc-docker-SIGUSR1-daemonize.patch \ 9 file://0001-runc-docker-SIGUSR1-daemonize.patch \
14 " 10 "
15 11
16RUNC_VERSION = "1.0.0-rc3" 12RUNC_VERSION = "1.0.0-rc5"
diff --git a/recipes-containers/runc/runc-opencontainers_git.bb b/recipes-containers/runc/runc-opencontainers_git.bb
index a97676b6..73ef4f00 100644
--- a/recipes-containers/runc/runc-opencontainers_git.bb
+++ b/recipes-containers/runc/runc-opencontainers_git.bb
@@ -1,8 +1,8 @@
1include runc.inc 1include runc.inc
2 2
3SRCREV = "2e7cfe036e2c6dc51ccca6eb7fa3ee6b63976dcd" 3SRCREV = "58415b4b12650291f435db8770cea48207b78afe"
4SRC_URI = " \ 4SRC_URI = " \
5 git://github.com/opencontainers/runc;branch=master \ 5 git://github.com/opencontainers/runc;branch=master \
6 file://0001-Use-correct-go-cross-compiler.patch \ 6 file://0001-Use-correct-go-cross-compiler.patch \
7 " 7 "
8RUNC_VERSION = "1.0.0-rc4" 8RUNC_VERSION = "1.0.0-rc5"