diff options
3 files changed, 26 insertions, 131 deletions
diff --git a/recipes-containers/podman/podman/0001-Rename-BUILDFLAGS-to-GOBUILDFLAGS.patch b/recipes-containers/podman/podman/0001-Rename-BUILDFLAGS-to-GOBUILDFLAGS.patch index e27e1fa8..14b2714f 100644 --- a/recipes-containers/podman/podman/0001-Rename-BUILDFLAGS-to-GOBUILDFLAGS.patch +++ b/recipes-containers/podman/podman/0001-Rename-BUILDFLAGS-to-GOBUILDFLAGS.patch | |||
@@ -18,39 +18,25 @@ Index: import/Makefile | |||
18 | =================================================================== | 18 | =================================================================== |
19 | --- import.orig/Makefile | 19 | --- import.orig/Makefile |
20 | +++ import/Makefile | 20 | +++ import/Makefile |
21 | @@ -69,7 +69,7 @@ | 21 | @@ -242,7 +242,7 @@ |
22 | # triggered. | ||
23 | SOURCES = $(shell find . -path './.*' -prune -o \( \( -name '*.go' -o -name '*.c' \) -a ! -name '*_test.go' \) -print) | ||
24 | |||
25 | -BUILDFLAGS := -mod=vendor $(BUILDFLAGS) | ||
26 | +GOBUILDFLAGS := -mod=vendor $(GOBUILDFLAGS) | ||
27 | |||
28 | BUILDTAGS_CROSS ?= containers_image_openpgp exclude_graphdriver_btrfs exclude_graphdriver_devicemapper exclude_graphdriver_overlay | ||
29 | CONTAINER_RUNTIME := $(shell command -v podman 2> /dev/null || echo docker) | ||
30 | @@ -264,11 +264,11 @@ | ||
31 | 22 | ||
32 | .PHONY: test/checkseccomp/checkseccomp | 23 | .PHONY: test/checkseccomp/checkseccomp |
33 | test/checkseccomp/checkseccomp: .gopathok $(wildcard test/checkseccomp/*.go) | 24 | test/checkseccomp/checkseccomp: $(wildcard test/checkseccomp/*.go) |
34 | - $(GOCMD) build $(BUILDFLAGS) $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' -tags "$(BUILDTAGS)" -o $@ ./test/checkseccomp | 25 | - $(GOCMD) build $(BUILDFLAGS) $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' -tags "$(BUILDTAGS)" -o $@ ./test/checkseccomp |
35 | + $(GOCMD) build $(GOBUILDFLAGS) $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' -tags "$(BUILDTAGS)" -o $@ ./test/checkseccomp | 26 | + $(GOCMD) build $(GOBUILDFLAGS) $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' -tags "$(BUILDTAGS)" -o $@ ./test/checkseccomp |
36 | 27 | ||
37 | .PHONY: test/testvol/testvol | 28 | .PHONY: test/testvol/testvol |
38 | test/testvol/testvol: .gopathok $(wildcard test/testvol/*.go) | 29 | test/testvol/testvol: $(wildcard test/testvol/*.go) |
39 | - $(GOCMD) build $(BUILDFLAGS) $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' -o $@ ./test/testvol | 30 | @@ -254,7 +254,7 @@ |
40 | + $(GOCMD) build $(GOBUILDFLAGS) $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' -o $@ ./test/testvol | ||
41 | |||
42 | .PHONY: volume-plugin-test-image | ||
43 | volume-plugin-test-img: | ||
44 | @@ -276,7 +276,7 @@ | ||
45 | 31 | ||
46 | .PHONY: test/goecho/goecho | 32 | .PHONY: test/goecho/goecho |
47 | test/goecho/goecho: .gopathok $(wildcard test/goecho/*.go) | 33 | test/goecho/goecho: $(wildcard test/goecho/*.go) |
48 | - $(GOCMD) build $(BUILDFLAGS) $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' -o $@ ./test/goecho | 34 | - $(GOCMD) build $(BUILDFLAGS) $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' -o $@ ./test/goecho |
49 | + $(GOCMD) build $(GOBUILDFLAGS) $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' -o $@ ./test/goecho | 35 | + $(GOCMD) build $(GOBUILDFLAGS) $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' -o $@ ./test/goecho |
50 | 36 | ||
51 | test/version/version: .gopathok version/version.go | 37 | test/version/version: version/version.go |
52 | $(GO) build -o $@ ./test/version/ | 38 | $(GO) build -o $@ ./test/version/ |
53 | @@ -318,7 +318,7 @@ | 39 | @@ -296,7 +296,7 @@ |
54 | distro for journald support." | 40 | distro for journald support." |
55 | endif | 41 | endif |
56 | $(GOCMD) build \ | 42 | $(GOCMD) build \ |
@@ -59,17 +45,17 @@ Index: import/Makefile | |||
59 | $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' \ | 45 | $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' \ |
60 | -tags "$(BUILDTAGS)" \ | 46 | -tags "$(BUILDTAGS)" \ |
61 | -o $@ ./cmd/podman | 47 | -o $@ ./cmd/podman |
62 | @@ -329,7 +329,7 @@ | 48 | @@ -308,7 +308,7 @@ |
63 | 49 | # '|' is to ignore SRCBINDIR mtime; see: info make 'Types of Prerequisites' | |
64 | $(SRCBINDIR)/podman$(BINSFX): $(SRCBINDIR) .gopathok $(SOURCES) go.mod go.sum | 50 | $(SRCBINDIR)/podman$(BINSFX): $(SOURCES) go.mod go.sum | $(SRCBINDIR) |
65 | $(GOCMD) build \ | 51 | $(GOCMD) build \ |
66 | - $(BUILDFLAGS) \ | 52 | - $(BUILDFLAGS) \ |
67 | + $(GOBUILDFLAGS) \ | 53 | + $(GOBUILDFLAGS) \ |
68 | $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' \ | 54 | $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' \ |
69 | -tags "${REMOTETAGS}" \ | 55 | -tags "${REMOTETAGS}" \ |
70 | -o $@ ./cmd/podman | 56 | -o $@ ./cmd/podman |
71 | @@ -339,7 +339,7 @@ | 57 | @@ -318,7 +318,7 @@ |
72 | GOOS=$(GOOS) \ | 58 | GOOS=linux \ |
73 | GOARCH=$(GOARCH) \ | 59 | GOARCH=$(GOARCH) \ |
74 | $(GO) build \ | 60 | $(GO) build \ |
75 | - $(BUILDFLAGS) \ | 61 | - $(BUILDFLAGS) \ |
@@ -77,7 +63,7 @@ Index: import/Makefile | |||
77 | $(GO_LDFLAGS) '$(LDFLAGS_PODMAN_STATIC)' \ | 63 | $(GO_LDFLAGS) '$(LDFLAGS_PODMAN_STATIC)' \ |
78 | -tags "${REMOTETAGS}" \ | 64 | -tags "${REMOTETAGS}" \ |
79 | -o $@ ./cmd/podman | 65 | -o $@ ./cmd/podman |
80 | @@ -374,7 +374,7 @@ | 66 | @@ -338,7 +338,7 @@ |
81 | CGO_ENABLED=0 \ | 67 | CGO_ENABLED=0 \ |
82 | GOOS=windows \ | 68 | GOOS=windows \ |
83 | $(GO) build \ | 69 | $(GO) build \ |
@@ -86,7 +72,7 @@ Index: import/Makefile | |||
86 | -ldflags -H=windowsgui \ | 72 | -ldflags -H=windowsgui \ |
87 | -o bin/windows/winpath.exe \ | 73 | -o bin/windows/winpath.exe \ |
88 | ./cmd/winpath | 74 | ./cmd/winpath |
89 | @@ -393,14 +393,14 @@ | 75 | @@ -349,14 +349,14 @@ |
90 | GOOS=darwin \ | 76 | GOOS=darwin \ |
91 | GOARCH=$(GOARCH) \ | 77 | GOARCH=$(GOARCH) \ |
92 | $(GO) build \ | 78 | $(GO) build \ |
@@ -95,7 +81,7 @@ Index: import/Makefile | |||
95 | -o bin/darwin/podman-mac-helper \ | 81 | -o bin/darwin/podman-mac-helper \ |
96 | ./cmd/podman-mac-helper | 82 | ./cmd/podman-mac-helper |
97 | 83 | ||
98 | bin/rootlessport: .gopathok $(SOURCES) go.mod go.sum | 84 | bin/rootlessport: $(SOURCES) go.mod go.sum |
99 | CGO_ENABLED=$(CGO_ENABLED) \ | 85 | CGO_ENABLED=$(CGO_ENABLED) \ |
100 | $(GO) build \ | 86 | $(GO) build \ |
101 | - $(BUILDFLAGS) \ | 87 | - $(BUILDFLAGS) \ |
@@ -103,7 +89,7 @@ Index: import/Makefile | |||
103 | -o $@ ./cmd/rootlessport | 89 | -o $@ ./cmd/rootlessport |
104 | 90 | ||
105 | .PHONY: rootlessport | 91 | .PHONY: rootlessport |
106 | @@ -423,7 +423,7 @@ | 92 | @@ -379,7 +379,7 @@ |
107 | GOARCH="$${TARGET##*.}"; \ | 93 | GOARCH="$${TARGET##*.}"; \ |
108 | CGO_ENABLED=0 \ | 94 | CGO_ENABLED=0 \ |
109 | $(GO) build \ | 95 | $(GO) build \ |
@@ -112,12 +98,12 @@ Index: import/Makefile | |||
112 | $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' \ | 98 | $(GO_LDFLAGS) '$(LDFLAGS_PODMAN)' \ |
113 | -tags '$(BUILDTAGS_CROSS)' \ | 99 | -tags '$(BUILDTAGS_CROSS)' \ |
114 | -o "$@" ./cmd/podman | 100 | -o "$@" ./cmd/podman |
115 | @@ -871,7 +871,7 @@ | 101 | @@ -830,7 +830,7 @@ |
102 | |||
116 | .PHONY: .install.ginkgo | 103 | .PHONY: .install.ginkgo |
117 | .install.ginkgo: .gopathok | 104 | .install.ginkgo: |
118 | if [ ! -x "$(GOBIN)/ginkgo" ]; then \ | 105 | - $(GO) install $(BUILDFLAGS) ./vendor/github.com/onsi/ginkgo/ginkgo |
119 | - $(GO) install $(BUILDFLAGS) ./vendor/github.com/onsi/ginkgo/ginkgo ; \ | 106 | + $(GO) install $(GOBUILDFLAGS) ./vendor/github.com/onsi/ginkgo/ginkgo |
120 | + $(GO) install $(GOBUILDFLAGS) ./vendor/github.com/onsi/ginkgo/ginkgo ; \ | ||
121 | fi | ||
122 | 107 | ||
123 | .PHONY: .install.gitvalidation | 108 | .PHONY: .install.golangci-lint |
109 | .install.golangci-lint: | ||
diff --git a/recipes-containers/podman/podman/0002-Define-ActKillThread-equal-to-ActKill.patch b/recipes-containers/podman/podman/0002-Define-ActKillThread-equal-to-ActKill.patch deleted file mode 100644 index ba51d4ac..00000000 --- a/recipes-containers/podman/podman/0002-Define-ActKillThread-equal-to-ActKill.patch +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | From f2aa0359bcc776239bda8a4eb84957b97ef55c35 Mon Sep 17 00:00:00 2001 | ||
2 | From: Tonis Tiigi <tonistiigi@gmail.com> | ||
3 | Date: Fri, 28 Jan 2022 14:44:56 -0800 | ||
4 | Subject: [PATCH] Define ActKillThread equal to ActKill | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | These constants are equal in libseccomp but Go definitions | ||
10 | were defined separately. This resulted in dead code that | ||
11 | never executed due to identical case statements in switch. | ||
12 | Go can usually detect these error cases and refuses to build | ||
13 | but for some reason this detection doesn’t work with cgo+gcc. | ||
14 | Clang detects the equal constants correctly and therefore | ||
15 | libseccomp-golang builds with clang broke after ActKillThread | ||
16 | was added. | ||
17 | |||
18 | In order to fix the clang build only removal of the | ||
19 | switch case is needed. But I assumed that the setter/getter | ||
20 | logic is supposed to work for ActKillThread as well | ||
21 | and only way to ensure that is to set them equal like they | ||
22 | are in C. | ||
23 | |||
24 | Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com> | ||
25 | Signed-off-by: Sebastiaan van Stijn <github@gone.nl> | ||
26 | Acked-by: Tom Hromatka <tom.hromatka@oracle.com> | ||
27 | Signed-off-by: Paul Moore <paul@paul-moore.com> | ||
28 | Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com> | ||
29 | Upstream-status: Backport [https://github.com/seccomp/libseccomp-golang/commit/c35397d0ea8f285a0be78693bb2fd37b06952453] | ||
30 | --- | ||
31 | seccomp.go | 8 ++++---- | ||
32 | seccomp_internal.go | 4 ---- | ||
33 | 2 files changed, 4 insertions(+), 8 deletions(-) | ||
34 | |||
35 | diff --git a/seccomp.go b/seccomp.go | ||
36 | index e9b92e2..32f6ab2 100644 | ||
37 | --- a/seccomp.go | ||
38 | +++ b/seccomp.go | ||
39 | @@ -214,14 +214,14 @@ const ( | ||
40 | // This action is only usable when libseccomp API level 3 or higher is | ||
41 | // supported. | ||
42 | ActLog ScmpAction = iota | ||
43 | - // ActKillThread kills the thread that violated the rule. It is the same as ActKill. | ||
44 | - // All other threads from the same thread group will continue to execute. | ||
45 | - ActKillThread ScmpAction = iota | ||
46 | // ActKillProcess kills the process that violated the rule. | ||
47 | // All threads in the thread group are also terminated. | ||
48 | // This action is only usable when libseccomp API level 3 or higher is | ||
49 | // supported. | ||
50 | ActKillProcess ScmpAction = iota | ||
51 | + // ActKillThread kills the thread that violated the rule. It is the same as ActKill. | ||
52 | + // All other threads from the same thread group will continue to execute. | ||
53 | + ActKillThread = ActKill | ||
54 | ) | ||
55 | |||
56 | const ( | ||
57 | @@ -394,7 +394,7 @@ func (a ScmpCompareOp) String() string { | ||
58 | // String returns a string representation of a seccomp match action | ||
59 | func (a ScmpAction) String() string { | ||
60 | switch a & 0xFFFF { | ||
61 | - case ActKill, ActKillThread: | ||
62 | + case ActKillThread: | ||
63 | return "Action: Kill thread" | ||
64 | case ActKillProcess: | ||
65 | return "Action: Kill process" | ||
66 | diff --git a/seccomp_internal.go b/seccomp_internal.go | ||
67 | index 8dc7b29..8fc9914 100644 | ||
68 | --- a/seccomp_internal.go | ||
69 | +++ b/seccomp_internal.go | ||
70 | @@ -612,8 +612,6 @@ func (a ScmpCompareOp) toNative() C.int { | ||
71 | func actionFromNative(a C.uint32_t) (ScmpAction, error) { | ||
72 | aTmp := a & 0xFFFF | ||
73 | switch a & 0xFFFF0000 { | ||
74 | - case C.C_ACT_KILL: | ||
75 | - return ActKill, nil | ||
76 | case C.C_ACT_KILL_PROCESS: | ||
77 | return ActKillProcess, nil | ||
78 | case C.C_ACT_KILL_THREAD: | ||
79 | @@ -638,8 +636,6 @@ func actionFromNative(a C.uint32_t) (ScmpAction, error) { | ||
80 | // Only use with sanitized actions, no error handling | ||
81 | func (a ScmpAction) toNative() C.uint32_t { | ||
82 | switch a & 0xFFFF { | ||
83 | - case ActKill: | ||
84 | - return C.C_ACT_KILL | ||
85 | case ActKillProcess: | ||
86 | return C.C_ACT_KILL_PROCESS | ||
87 | case ActKillThread: | ||
88 | -- | ||
89 | 2.25.1 | ||
90 | |||
diff --git a/recipes-containers/podman/podman_git.bb b/recipes-containers/podman/podman_git.bb index e9991920..355e0e09 100644 --- a/recipes-containers/podman/podman_git.bb +++ b/recipes-containers/podman/podman_git.bb | |||
@@ -17,11 +17,10 @@ DEPENDS = " \ | |||
17 | ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ | 17 | ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ |
18 | " | 18 | " |
19 | 19 | ||
20 | SRCREV = "cedbbfa543651a13055a1fe093a4d0a2a28ccdfd" | 20 | SRCREV = "754ec89a8a185d308ca5ed08afaf34d6cbda08da" |
21 | SRC_URI = " \ | 21 | SRC_URI = " \ |
22 | git://github.com/containers/libpod.git;branch=v4.1;protocol=https \ | 22 | git://github.com/containers/libpod.git;branch=v4.2;protocol=https \ |
23 | file://0001-Rename-BUILDFLAGS-to-GOBUILDFLAGS.patch;patchdir=src/import \ | 23 | file://0001-Rename-BUILDFLAGS-to-GOBUILDFLAGS.patch;patchdir=src/import \ |
24 | file://0002-Define-ActKillThread-equal-to-ActKill.patch;patchdir=src/import/vendor/github.com/seccomp/libseccomp-golang \ | ||
25 | ${@bb.utils.contains('PACKAGECONFIG', 'rootless', 'file://50-podman-rootless.conf', '', d)} \ | 24 | ${@bb.utils.contains('PACKAGECONFIG', 'rootless', 'file://50-podman-rootless.conf', '', d)} \ |
26 | " | 25 | " |
27 | 26 | ||
@@ -32,7 +31,7 @@ GO_IMPORT = "import" | |||
32 | 31 | ||
33 | S = "${WORKDIR}/git" | 32 | S = "${WORKDIR}/git" |
34 | 33 | ||
35 | PV = "4.1.0+git${SRCPV}" | 34 | PV = "4.2.0+git${SRCPV}" |
36 | 35 | ||
37 | PACKAGES =+ "${PN}-contrib" | 36 | PACKAGES =+ "${PN}-contrib" |
38 | 37 | ||