Skip to contentSkip to conversation

runc-opencontainers: Drop obsolete patch

PATCH In review Paul Barker 2 participants 4 messages May 8, 2018 – May 9, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 runc-opencontainers: Drop obsolete patch

The upstream Makefile now calls $(GO) instead of just go so this patch isn't needed anymore.

---
 .../0001-Use-correct-go-cross-compiler.patch       | 85 ----------------------
 recipes-containers/runc/runc-opencontainers_git.bb |  1 -
 2 files changed, 86 deletions(-)
 delete mode 100644 recipes-containers/runc/runc-opencontainers/0001-Use-correct-go-cross-compiler.patch
recipes-containers/runc/runc-opencontainers/0001-Use-correct-go-cross-compiler.patch deleted +0 -85
deleted file mode 100644
index 67d7014..0000000
@@ -1,85 +0,0 @@
-From 621e5e9a196daaaf5eb430a413fe51218cf42c89 Mon Sep 17 00:00:00 2001
-From: Paul Barker <[email protected]>
-Date: Wed, 4 Oct 2017 15:45:27 +0000
-Subject: [PATCH] Use correct go cross-compiler
-
-We need to use '${GO}' as set by OpenEmbedded instead of just 'go'. Just using
-'go' will invoke go-native.
-
-Signed-off-by: Paul Barker <[email protected]>
-Upstream-status: Inappropriate
----
- Makefile | 20 ++++++++++----------
- 1 file changed, 10 insertions(+), 10 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 6781ac7..74e551d 100644
---- a/src/import/Makefile
-+++ b/src/import/Makefile
-@@ -27,18 +27,18 @@ SHELL := $(shell command -v bash 2>/dev/null)
- .DEFAULT: runc
- 
- runc: $(SOURCES)
--	go build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o runc .
-+	$(GO) build -i $(EXTRA_FLAGS) -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -tags "$(BUILDTAGS)" -o runc .
- 
- all: runc recvtty
- 
- recvtty: contrib/cmd/recvtty/recvtty
- 
- contrib/cmd/recvtty/recvtty: $(SOURCES)
--	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
-+	$(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
- 
- static: $(SOURCES)
--	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 .
--	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
-+	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 .
-+	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
- 
- release:
- 	@flag_list=(seccomp selinux apparmor static); \
-@@ -62,15 +62,15 @@ release:
- 			CGO_ENABLED=1; \
- 		}; \
- 		echo "Building target: $$output"; \
--		go build -i $(EXTRA_FLAGS) -ldflags "$$ldflags $(EXTRA_LDFLAGS)" -tags "$$tags" -o "$$output" .; \
-+		$(GO) build -i $(EXTRA_FLAGS) -ldflags "$$ldflags $(EXTRA_LDFLAGS)" -tags "$$tags" -o "$$output" .; \
- 	done
- 
- dbuild: runcimage
- 	docker run --rm -v $(CURDIR):/go/src/$(PROJECT) --privileged $(RUNC_IMAGE) make clean all
- 
- lint:
--	go vet $(allpackages)
--	go fmt $(allpackages)
-+	$(GO) vet $(allpackages)
-+	$(GO) fmt $(allpackages)
- 
- man:
- 	man/md2man-all.sh
-@@ -88,7 +88,7 @@ unittest: runcimage
- 	docker run -e TESTFLAGS -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localunittest
- 
- localunittest: all
--	go test -timeout 3m -tags "$(BUILDTAGS)" ${TESTFLAGS} -v $(allpackages)
-+	$(GO) test -timeout 3m -tags "$(BUILDTAGS)" ${TESTFLAGS} -v $(allpackages)
- 
- integration: runcimage
- 	docker run -e TESTFLAGS -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localintegration
-@@ -133,10 +133,10 @@ clean:
- 
- validate:
- 	script/validate-gofmt
--	go vet $(allpackages)
-+	$(GO) vet $(allpackages)
- 
- ci: validate localtest
- 
- # memoize allpackages, so that it's executed only once and only if used
--_allpackages = $(shell go list ./... | grep -v vendor)
-+_allpackages = $(shell $(GO) list ./... | grep -v vendor)
- allpackages = $(if $(__allpackages),,$(eval __allpackages := $$(_allpackages)))$(__allpackages)
--- 
-2.7.4
-
recipes-containers/runc/runc-opencontainers_git.bb +0 -1
index 73ef4f0..ed48abf 100644
@@ -3,6 +3,5 @@ include runc.inc
 SRCREV = "58415b4b12650291f435db8770cea48207b78afe"
 SRC_URI = " \
     git://github.com/opencontainers/runc;branch=master \
-    file://0001-Use-correct-go-cross-compiler.patch \
     "
 RUNC_VERSION = "1.0.0-rc5"
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 netns: Update to v0.4.0

The netns project has been moved into the 'genuinetools' organisation and so URLs have been updated. The copyright line in the license file has been updated to reference "The Genuinetools Authors".

The patch name has been updated to make it more suitable for submission upstream.

---
 .../0001-Allow-selection-of-go-compiler.patch      | 107 +++++++++++++++++++++
 recipes-networking/netns/netns_git.bb              |  16 +--
 2 files changed, 115 insertions(+), 8 deletions(-)
 create mode 100644 recipes-networking/netns/files/0001-Allow-selection-of-go-compiler.patch
recipes-networking/netns/files/0001-Allow-selection-of-go-compiler.patch new file +107 -0
new file mode 100644
index 0000000..84fb9a4
@@ -0,0 +1,107 @@
+From 6576f228339b7931e05a8e861f085f483817806b Mon Sep 17 00:00:00 2001
+From: Paul Barker <[email protected]>
+Date: Tue, 8 May 2018 11:01:14 +0000
+Subject: [PATCH] Allow selection of go compiler
+
+By running `make GO=/path/to/go` we can now select the appropriate go compiler
+to use. This also makes it possible to cross compile netns more easily.
+
+Signed-off-by: Paul Barker <[email protected]>
+Upstream-status: Pending
+---
+ Makefile | 25 ++++++++++++++-----------
+ 1 file changed, 14 insertions(+), 11 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 3a22f3e..476cb9b 100644
+--- a/src/import/Makefile
++++ b/src/import/Makefile
+@@ -23,6 +23,9 @@ CTIMEVAR=-X $(PKG)/version.GITCOMMIT=$(GITCOMMIT) -X $(PKG)/version.VERSION=$(VE
+ GO_LDFLAGS=-ldflags "-w $(CTIMEVAR)"
+ GO_LDFLAGS_STATIC=-ldflags "-w $(CTIMEVAR) -extldflags -static"
+ 
++# Set our default go compiler
++GO := go
++
+ # List the GOOS and GOARCH to build
+ GOOSARCHES = linux/arm linux/arm64 linux/amd64 linux/386
+ 
+@@ -33,12 +36,12 @@ build: $(NAME) ## Builds a dynamic executable or package
+ 
+ $(NAME): *.go VERSION.txt
+ 	@echo "+ $@"
+-	go build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) .
++	$(GO) build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) .
+ 
+ .PHONY: static
+ static: ## Builds a static executable
+ 	@echo "+ $@"
+-	CGO_ENABLED=0 go build \
++	CGO_ENABLED=0 $(GO) build \
+ 				-tags "$(BUILDTAGS) static_build" \
+ 				${GO_LDFLAGS_STATIC} -o $(NAME) .
+ 
+@@ -55,23 +58,23 @@ lint: ## Verifies `golint` passes
+ .PHONY: test
+ test: ## Runs the go tests
+ 	@echo "+ $@"
+-	@go test -v -tags "$(BUILDTAGS) cgo" $(shell go list ./... | grep -v vendor)
++	@$(GO) test -v -tags "$(BUILDTAGS) cgo" $(shell $(GO) list ./... | grep -v vendor)
+ 
+ .PHONY: vet
+ vet: ## Verifies `go vet` passes
+ 	@echo "+ $@"
+-	@go vet $(shell go list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
++	@$(GO) vet $(shell $(GO) list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
+ 
+ .PHONY: staticcheck
+ staticcheck: ## Verifies `staticcheck` passes
+ 	@echo "+ $@"
+-	@staticcheck $(shell go list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
++	@staticcheck $(shell $(GO) list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
+ 
+ .PHONY: cover
+ cover: ## Runs go test with coverage
+ 	@echo "" > coverage.txt
+-	@for d in $(shell go list ./... | grep -v vendor); do \
+-		go test -race -coverprofile=profile.out -covermode=atomic "$$d"; \
++	@for d in $(shell $(GO) list ./... | grep -v vendor); do \
++		$(GO) test -race -coverprofile=profile.out -covermode=atomic "$$d"; \
+ 		if [ -f profile.out ]; then \
+ 			cat profile.out >> coverage.txt; \
+ 			rm profile.out; \
+@@ -81,11 +84,11 @@ cover: ## Runs go test with coverage
+ .PHONY: install
+ install: ## Installs the executable or package
+ 	@echo "+ $@"
+-	go install -a -tags "$(BUILDTAGS)" ${GO_LDFLAGS} .
++	$(GO) install -a -tags "$(BUILDTAGS)" ${GO_LDFLAGS} .
+ 
+ define buildpretty
+ mkdir -p $(BUILDDIR)/$(1)/$(2);
+-GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build \
++GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build \
+ 	 -o $(BUILDDIR)/$(1)/$(2)/$(NAME) \
+ 	 -a -tags "$(BUILDTAGS) static_build netgo" \
+ 	 -installsuffix netgo ${GO_LDFLAGS_STATIC} .;
+@@ -99,7 +102,7 @@ cross: *.go VERSION.txt ## Builds the cross-compiled binaries, creating a clean
+ 	$(foreach GOOSARCH,$(GOOSARCHES), $(call buildpretty,$(subst /,,$(dir $(GOOSARCH))),$(notdir $(GOOSARCH))))
+ 
+ define buildrelease
+-GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build \
++GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build \
+ 	 -o $(BUILDDIR)/$(NAME)-$(1)-$(2) \
+ 	 -a -tags "$(BUILDTAGS) static_build netgo" \
+ 	 -installsuffix netgo ${GO_LDFLAGS_STATIC} .;
+@@ -115,7 +118,7 @@ release: *.go VERSION.txt ## Builds the cross-compiled binaries, naming them in
+ .PHONY: bump-version
+ BUMP := patch
+ bump-version: ## Bump the version in the version file. Set BUMP to [ patch | major | minor ]
+-	@go get -u github.com/jessfraz/junk/sembump # update sembump tool
++	@$(GO) get -u github.com/jessfraz/junk/sembump # update sembump tool
+ 	$(eval NEW_VERSION = $(shell sembump --kind $(BUMP) $(VERSION)))
+ 	@echo "Bumping VERSION.txt from $(VERSION) to $(NEW_VERSION)"
+ 	echo $(NEW_VERSION) > VERSION.txt
+-- 
+2.7.4
+
recipes-networking/netns/netns_git.bb +8 -8
index d35836e..82a961b 100644
@@ -1,13 +1,13 @@
 HOMEPAGE = "https://github.com/jfrazelle/netns"
 SUMMARY = "Runc hook for setting up default bridge networking."
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=20ce4c6a4f32d6ee4a68e3a7506db3f1"
+LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=48ef0979a2bcc3fae14ff30b8a7f5dbf"
 
-SRC_URI = "git://github.com/jessfraz/netns;branch=master \
-           file://0001-Use-correct-go-cross-compiler.patch \
+SRC_URI = "git://github.com/genuinetools/netns;branch=master \
+           file://0001-Allow-selection-of-go-compiler.patch \
           "
-SRCREV = "74e23a0e5c4e7ac011aafcc4623586c196f1b3ef"
-PV = "0.2.1"
+SRCREV = "0da6ab0997707024debe68c91e940c9168041bf8"
+PV = "0.4.0"
 GO_IMPORT = "import"
 
 S = "${WORKDIR}/git"
@@ -26,9 +26,9 @@ do_compile() {
 	# We also need to link in the ipallocator and version directories as
 	# they are not under the src directory.
 	ln -sfn . "${S}/src/import/vendor/src"
-	mkdir -p "${S}/src/import/vendor/src/github.com/jessfraz/netns"
-	ln -sfn "${S}/src/import/ipallocator" "${S}/src/import/vendor/src/github.com/jessfraz/netns/ipallocator"
-	ln -sfn "${S}/src/import/version" "${S}/src/import/vendor/src/github.com/jessfraz/netns/version"
+	mkdir -p "${S}/src/import/vendor/src/github.com/genuinetools/netns"
+	ln -sfn "${S}/src/import/ipallocator" "${S}/src/import/vendor/src/github.com/genuinetools/netns/ipallocator"
+	ln -sfn "${S}/src/import/version" "${S}/src/import/vendor/src/github.com/genuinetools/netns/version"
 	export GOPATH="${S}/src/import/vendor"
 
 	# Pass the needed cflags/ldflags so that cgo
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH 2/2] netns: Update to v0.4.0

Quoted 8 lines · Paul Barker

The netns project has been moved into the 'genuinetools' organisation and so URLs have been updated. The copyright line in the license file has been updated to reference "The Genuinetools Authors".

The patch name has been updated to make it more suitable for submission upstream.

Serves me right for messing with gitconfig. I end up with the incorrect email address in my patch. *facepalm*

Should be:

Quoted 158 lines
---
 .../0001-Allow-selection-of-go-compiler.patch      | 107 +++++++++++++++++++++
 recipes-networking/netns/netns_git.bb              |  16 +--
 2 files changed, 115 insertions(+), 8 deletions(-)
 create mode 100644 recipes-networking/netns/files/0001-Allow-selection-of-go-compiler.patch
recipes-networking/netns/files/0001-Allow-selection-of-go-compiler.patch new file +107 -0
new file mode 100644
index 0000000..84fb9a4
@@ -0,0 +1,107 @@
+From 6576f228339b7931e05a8e861f085f483817806b Mon Sep 17 00:00:00 2001
+From: Paul Barker <[email protected]>
+Date: Tue, 8 May 2018 11:01:14 +0000
+Subject: [PATCH] Allow selection of go compiler
+
+By running `make GO=/path/to/go` we can now select the appropriate go compiler
+to use. This also makes it possible to cross compile netns more easily.
+
+Signed-off-by: Paul Barker <[email protected]>
+Upstream-status: Pending
+---
+ Makefile | 25 ++++++++++++++-----------
+ 1 file changed, 14 insertions(+), 11 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 3a22f3e..476cb9b 100644
+--- a/src/import/Makefile
++++ b/src/import/Makefile
+@@ -23,6 +23,9 @@ CTIMEVAR=-X $(PKG)/version.GITCOMMIT=$(GITCOMMIT) -X $(PKG)/version.VERSION=$(VE
+ GO_LDFLAGS=-ldflags "-w $(CTIMEVAR)"
+ GO_LDFLAGS_STATIC=-ldflags "-w $(CTIMEVAR) -extldflags -static"
+
++# Set our default go compiler
++GO := go
++
+ # List the GOOS and GOARCH to build
+ GOOSARCHES = linux/arm linux/arm64 linux/amd64 linux/386
+
+@@ -33,12 +36,12 @@ build: $(NAME) ## Builds a dynamic executable or package
+
+ $(NAME): *.go VERSION.txt
+       @echo "+ $@"
+-      go build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) .
++      $(GO) build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) .
+
+ .PHONY: static
+ static: ## Builds a static executable
+       @echo "+ $@"
+-      CGO_ENABLED=0 go build \
++      CGO_ENABLED=0 $(GO) build \
+                               -tags "$(BUILDTAGS) static_build" \
+                               ${GO_LDFLAGS_STATIC} -o $(NAME) .
+
+@@ -55,23 +58,23 @@ lint: ## Verifies `golint` passes
+ .PHONY: test
+ test: ## Runs the go tests
+       @echo "+ $@"
+-      @go test -v -tags "$(BUILDTAGS) cgo" $(shell go list ./... | grep -v vendor)
++      @$(GO) test -v -tags "$(BUILDTAGS) cgo" $(shell $(GO) list ./... | grep -v vendor)
+
+ .PHONY: vet
+ vet: ## Verifies `go vet` passes
+       @echo "+ $@"
+-      @go vet $(shell go list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
++      @$(GO) vet $(shell $(GO) list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
+
+ .PHONY: staticcheck
+ staticcheck: ## Verifies `staticcheck` passes
+       @echo "+ $@"
+-      @staticcheck $(shell go list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
++      @staticcheck $(shell $(GO) list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
+
+ .PHONY: cover
+ cover: ## Runs go test with coverage
+       @echo "" > coverage.txt
+-      @for d in $(shell go list ./... | grep -v vendor); do \
+-              go test -race -coverprofile=profile.out -covermode=atomic "$$d"; \
++      @for d in $(shell $(GO) list ./... | grep -v vendor); do \
++              $(GO) test -race -coverprofile=profile.out -covermode=atomic "$$d"; \
+               if [ -f profile.out ]; then \
+                       cat profile.out >> coverage.txt; \
+                       rm profile.out; \
+@@ -81,11 +84,11 @@ cover: ## Runs go test with coverage
+ .PHONY: install
+ install: ## Installs the executable or package
+       @echo "+ $@"
+-      go install -a -tags "$(BUILDTAGS)" ${GO_LDFLAGS} .
++      $(GO) install -a -tags "$(BUILDTAGS)" ${GO_LDFLAGS} .
+
+ define buildpretty
+ mkdir -p $(BUILDDIR)/$(1)/$(2);
+-GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build \
++GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build \
+        -o $(BUILDDIR)/$(1)/$(2)/$(NAME) \
+        -a -tags "$(BUILDTAGS) static_build netgo" \
+        -installsuffix netgo ${GO_LDFLAGS_STATIC} .;
+@@ -99,7 +102,7 @@ cross: *.go VERSION.txt ## Builds the cross-compiled binaries, creating a clean
+       $(foreach GOOSARCH,$(GOOSARCHES), $(call buildpretty,$(subst /,,$(dir $(GOOSARCH))),$(notdir $(GOOSARCH))))
+
+ define buildrelease
+-GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build \
++GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build \
+        -o $(BUILDDIR)/$(NAME)-$(1)-$(2) \
+        -a -tags "$(BUILDTAGS) static_build netgo" \
+        -installsuffix netgo ${GO_LDFLAGS_STATIC} .;
+@@ -115,7 +118,7 @@ release: *.go VERSION.txt ## Builds the cross-compiled binaries, naming them in
+ .PHONY: bump-version
+ BUMP := patch
+ bump-version: ## Bump the version in the version file. Set BUMP to [ patch | major | minor ]
+-      @go get -u github.com/jessfraz/junk/sembump # update sembump tool
++      @$(GO) get -u github.com/jessfraz/junk/sembump # update sembump tool
+       $(eval NEW_VERSION = $(shell sembump --kind $(BUMP) $(VERSION)))
+       @echo "Bumping VERSION.txt from $(VERSION) to $(NEW_VERSION)"
+       echo $(NEW_VERSION) > VERSION.txt
+--
+2.7.4
+
recipes-networking/netns/netns_git.bb +8 -9
index d35836e..82a961b 100644
@@ -1,13 +1,13 @@
 HOMEPAGE = "https://github.com/jfrazelle/netns"
 SUMMARY = "Runc hook for setting up default bridge networking."
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=20ce4c6a4f32d6ee4a68e3a7506db3f1"
+LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=48ef0979a2bcc3fae14ff30b8a7f5dbf"
 
-SRC_URI = "git://github.com/jessfraz/netns;branch=master \
-           file://0001-Use-correct-go-cross-compiler.patch \
+SRC_URI = "git://github.com/genuinetools/netns;branch=master \
+           file://0001-Allow-selection-of-go-compiler.patch \
           "
-SRCREV = "74e23a0e5c4e7ac011aafcc4623586c196f1b3ef"
-PV = "0.2.1"
+SRCREV = "0da6ab0997707024debe68c91e940c9168041bf8"
+PV = "0.4.0"
 GO_IMPORT = "import"
 
 S = "${WORKDIR}/git"
@@ -26,9 +26,9 @@ do_compile() {
        # We also need to link in the ipallocator and version directories as
        # they are not under the src directory.
        ln -sfn . "${S}/src/import/vendor/src"
-       mkdir -p "${S}/src/import/vendor/src/github.com/jessfraz/netns"
-       ln -sfn "${S}/src/import/ipallocator" "${S}/src/import/vendor/src/github.com/jessfraz/netns/ipallocator"
-       ln -sfn "${S}/src/import/version" "${S}/src/import/vendor/src/github.com/jessfraz/netns/version"
+       mkdir -p "${S}/src/import/vendor/src/github.com/genuinetools/netns"
+       ln -sfn "${S}/src/import/ipallocator" "${S}/src/import/vendor/src/github.com/genuinetools/netns/ipallocator"
+       ln -sfn "${S}/src/import/version" "${S}/src/import/vendor/src/github.com/genuinetools/netns/version"
        export GOPATH="${S}/src/import/vendor"
 
        # Pass the needed cflags/ldflags so that cgo
--

2.7.4

Signature · 2 lines
Paul Barker
Togán Labs Ltd
#3 lore raw

Re: [PATCH 2/2] netns: Update to v0.4.0

Quoted 7 lines · Paul Barker
Quoted 1 line · Paul Barker

The netns project has been moved into the 'genuinetools' organisation

and so

Quoted 1 line

URLs have been updated. The copyright line in the license file has been

updated

Quoted 2 lines

to reference "The Genuinetools Authors".

Quoted 8 lines
Quoted 4 lines

The patch name has been updated to make it more suitable for submission upstream.

Serves me right for messing with gitconfig. I end up with the incorrect email address in my patch. *facepalm*

No worries. Applied, amended and pushed.

Bruce

Quoted 205 lines

Should be:

Quoted 2 lines
---
 .../0001-Allow-selection-of-go-compiler.patch      | 107

+++++++++++++++++++++

Quoted 3 lines
 recipes-networking/netns/netns_git.bb              |  16 +--
 2 files changed, 115 insertions(+), 8 deletions(-)
 create mode 100644 recipes-networking/netns/

files/0001-Allow-selection-of-go-compiler.patch

Review

Quoted 2 lines
(quoted diff) +0 -0

b/recipes-networking/netns/files/0001-Allow-selection-of-go-compiler.patch

recipes-networking/netns/files/0001-Allow-selection-of-

Quoted 4 lines

new file mode 100644
index 0000000..84fb9a4

recipes-networking/netns/files/0001-Allow-selection-of- new file +0 -0

go-compiler.patch

recipes-networking/netns/files/0001-Allow-selection-of- line 6

Quoted 7 lines
recipes-networking/netns/files/0001-Allow-selection-of- new file +6 -0
@@ -0,0 +1,107 @@
+From 6576f228339b7931e05a8e861f085f483817806b Mon Sep 17 00:00:00 2001
+From: Paul Barker <[email protected]>
+Date: Tue, 8 May 2018 11:01:14 +0000
+Subject: [PATCH] Allow selection of go compiler
+
+By running `make GO=/path/to/go` we can now select the appropriate go

compiler

recipes-networking/netns/files/0001-Allow-selection-of- line 19

Quoted 13 lines
recipes-networking/netns/files/0001-Allow-selection-of- new file +13 -0
+to use. This also makes it possible to cross compile netns more easily.
+
+Signed-off-by: Paul Barker <[email protected]>
+Upstream-status: Pending
+---
+ Makefile | 25 ++++++++++++++-----------
+ 1 file changed, 14 insertions(+), 11 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 3a22f3e..476cb9b 100644
+--- a/src/import/Makefile
++++ b/src/import/Makefile
+@@ -23,6 +23,9 @@ CTIMEVAR=-X $(PKG)/version.GITCOMMIT=$(GITCOMMIT) -X

$(PKG)/version.VERSION=$(VE

recipes-networking/netns/files/0001-Allow-selection-of- line 29

Quoted 10 lines
recipes-networking/netns/files/0001-Allow-selection-of- new file +10 -0
+ GO_LDFLAGS=-ldflags "-w $(CTIMEVAR)"
+ GO_LDFLAGS_STATIC=-ldflags "-w $(CTIMEVAR) -extldflags -static"
+
++# Set our default go compiler
++GO := go
++
+ # List the GOOS and GOARCH to build
+ GOOSARCHES = linux/arm linux/arm64 linux/amd64 linux/386
+
+@@ -33,12 +36,12 @@ build: $(NAME) ## Builds a dynamic executable or

package

Quoted 9 lines
recipes-networking/netns/files/0001-Allow-selection-of- new file +9 -0
+
+ $(NAME): *.go VERSION.txt
+       @echo "+ $@"
+-      go build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) .
++      $(GO) build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) .
+
+ .PHONY: static
+ static: ## Builds a static executable
+       @echo "+ $@"

recipes-networking/netns/files/0001-Allow-selection-of- line 48

Quoted 10 lines
recipes-networking/netns/files/0001-Allow-selection-of- new file +10 -0
+-      CGO_ENABLED=0 go build \
++      CGO_ENABLED=0 $(GO) build \
+                               -tags "$(BUILDTAGS) static_build" \
+                               ${GO_LDFLAGS_STATIC} -o $(NAME) .
+
+@@ -55,23 +58,23 @@ lint: ## Verifies `golint` passes
+ .PHONY: test
+ test: ## Runs the go tests
+       @echo "+ $@"
+-      @go test -v -tags "$(BUILDTAGS) cgo" $(shell go list ./... |

grep -v vendor)

recipes-networking/netns/files/0001-Allow-selection-of- line 49

Quoted 1 line
recipes-networking/netns/files/0001-Allow-selection-of- new file +1 -0
++      @$(GO) test -v -tags "$(BUILDTAGS) cgo" $(shell $(GO) list ./...

| grep -v vendor)

recipes-networking/netns/files/0001-Allow-selection-of- line 54

Quoted 5 lines
recipes-networking/netns/files/0001-Allow-selection-of- new file +5 -0
+
+ .PHONY: vet
+ vet: ## Verifies `go vet` passes
+       @echo "+ $@"
+-      @go vet $(shell go list ./... | grep -v vendor) | grep -v
'.pb.go:' | tee /dev/stderr
> ++      @$(GO) vet $(shell $(GO) list ./... | grep -v vendor) | grep -v
'.pb.go:' | tee /dev/stderr

recipes-networking/netns/files/0001-Allow-selection-of- line 59

Quoted 5 lines
recipes-networking/netns/files/0001-Allow-selection-of- new file +5 -0
+
+ .PHONY: staticcheck
+ staticcheck: ## Verifies `staticcheck` passes
+       @echo "+ $@"
+-      @staticcheck $(shell go list ./... | grep -v vendor) | grep -v

'.pb.go:' | tee /dev/stderr

recipes-networking/netns/files/0001-Allow-selection-of- line 60

Quoted 1 line
recipes-networking/netns/files/0001-Allow-selection-of- new file +1 -0
++      @staticcheck $(shell $(GO) list ./... | grep -v vendor) | grep

-v '.pb.go:' | tee /dev/stderr

recipes-networking/netns/files/0001-Allow-selection-of- line 66

Quoted 6 lines
recipes-networking/netns/files/0001-Allow-selection-of- new file +6 -0
+
+ .PHONY: cover
+ cover: ## Runs go test with coverage
+       @echo "" > coverage.txt
+-      @for d in $(shell go list ./... | grep -v vendor); do \
+-              go test -race -coverprofile=profile.out

-covermode=atomic "$$d"; \

recipes-networking/netns/files/0001-Allow-selection-of- line 68

Quoted 2 lines
recipes-networking/netns/files/0001-Allow-selection-of- new file +2 -0
++      @for d in $(shell $(GO) list ./... | grep -v vendor); do \
++              $(GO) test -race -coverprofile=profile.out

-covermode=atomic "$$d"; \

Quoted 8 lines
recipes-networking/netns/files/0001-Allow-selection-of- new file +8 -0
+               if [ -f profile.out ]; then \
+                       cat profile.out >> coverage.txt; \
+                       rm profile.out; \
+@@ -81,11 +84,11 @@ cover: ## Runs go test with coverage
+ .PHONY: install
+ install: ## Installs the executable or package
+       @echo "+ $@"
+-      go install -a -tags "$(BUILDTAGS)" ${GO_LDFLAGS} .

recipes-networking/netns/files/0001-Allow-selection-of- line 86

Quoted 10 lines
recipes-networking/netns/files/0001-Allow-selection-of- new file +10 -0
++      $(GO) install -a -tags "$(BUILDTAGS)" ${GO_LDFLAGS} .
+
+ define buildpretty
+ mkdir -p $(BUILDDIR)/$(1)/$(2);
+-GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build \
++GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build \
+        -o $(BUILDDIR)/$(1)/$(2)/$(NAME) \
+        -a -tags "$(BUILDTAGS) static_build netgo" \
+        -installsuffix netgo ${GO_LDFLAGS_STATIC} .;
+@@ -99,7 +102,7 @@ cross: *.go VERSION.txt ## Builds the cross-compiled

binaries, creating a clean

recipes-networking/netns/files/0001-Allow-selection-of- line 87

Quoted 1 line
recipes-networking/netns/files/0001-Allow-selection-of- new file +1 -0
+       $(foreach GOOSARCH,$(GOOSARCHES), $(call buildpretty,$(subst

/,,$(dir $(GOOSARCH))),$(notdir $(GOOSARCH))))

recipes-networking/netns/files/0001-Allow-selection-of- line 95

Quoted 8 lines
recipes-networking/netns/files/0001-Allow-selection-of- new file +8 -0
+
+ define buildrelease
+-GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build \
++GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build \
+        -o $(BUILDDIR)/$(NAME)-$(1)-$(2) \
+        -a -tags "$(BUILDTAGS) static_build netgo" \
+        -installsuffix netgo ${GO_LDFLAGS_STATIC} .;
+@@ -115,7 +118,7 @@ release: *.go VERSION.txt ## Builds the

cross-compiled binaries, naming them in

recipes-networking/netns/files/0001-Allow-selection-of- line 98

Quoted 3 lines
recipes-networking/netns/files/0001-Allow-selection-of- new file +3 -0
+ .PHONY: bump-version
+ BUMP := patch
+ bump-version: ## Bump the version in the version file. Set BUMP to [

patch | major | minor ]

recipes-networking/netns/files/0001-Allow-selection-of- line 99

Quoted 1 line
recipes-networking/netns/files/0001-Allow-selection-of- new file +1 -0
+-      @go get -u github.com/jessfraz/junk/sembump # update sembump

tool

recipes-networking/netns/files/0001-Allow-selection-of- line 100

Quoted 1 line
recipes-networking/netns/files/0001-Allow-selection-of- new file +1 -0
++      @$(GO) get -u github.com/jessfraz/junk/sembump # update sembump

tool

Review

Quoted 7 lines
recipes-networking/netns/files/0001-Allow-selection-of- new file +6 -0
+       $(eval NEW_VERSION = $(shell sembump --kind $(BUMP) $(VERSION)))
+       @echo "Bumping VERSION.txt from $(VERSION) to $(NEW_VERSION)"
+       echo $(NEW_VERSION) > VERSION.txt
+--
+2.7.4
+
(quoted diff) +0 -0

b/recipes-networking/netns/netns_git.bb

recipes-networking/netns/netns_git.bb line 4

Quoted 8 lines

index d35836e..82a961b 100644

recipes-networking/netns/netns_git.bb +0 -1
@@ -1,13 +1,13 @@
 HOMEPAGE = "https://github.com/jfrazelle/netns"
 SUMMARY = "Runc hook for setting up default bridge networking."
 LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=

20ce4c6a4f32d6ee4a68e3a7506db3f1"

recipes-networking/netns/netns_git.bb line 4

Quoted 1 line
recipes-networking/netns/netns_git.bb +1 -0
+LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=

48ef0979a2bcc3fae14ff30b8a7f5dbf"

Quoted 14 lines
recipes-networking/netns/netns_git.bb +4 -4
-SRC_URI = "git://github.com/jessfraz/netns;branch=master \
-           file://0001-Use-correct-go-cross-compiler.patch \
+SRC_URI = "git://github.com/genuinetools/netns;branch=master \
+           file://0001-Allow-selection-of-go-compiler.patch \
           "
-SRCREV = "74e23a0e5c4e7ac011aafcc4623586c196f1b3ef"
-PV = "0.2.1"
+SRCREV = "0da6ab0997707024debe68c91e940c9168041bf8"
+PV = "0.4.0"
 GO_IMPORT = "import"
 
 S = "${WORKDIR}/git"

recipes-networking/netns/netns_git.bb do_compile() { · line 26

Quoted 1 line
recipes-networking/netns/netns_git.bb +0 -0
@@ -26,9 +26,9 @@ do_compile() {
        # We also need to link in the ipallocator and version

directories as

recipes-networking/netns/netns_git.bb do_compile() {

Quoted 4 lines
recipes-networking/netns/netns_git.bb +0 -2
        # they are not under the src directory.
        ln -sfn . "${S}/src/import/vendor/src"
-       mkdir -p "${S}/src/import/vendor/src/github.com/jessfraz/netns"
-       ln -sfn "${S}/src/import/ipallocator"

"${S}/src/import/vendor/src/github.com/jessfraz/netns/ipallocator"

recipes-networking/netns/netns_git.bb do_compile() { · line 31

Quoted 1 line
recipes-networking/netns/netns_git.bb +0 -1
-       ln -sfn "${S}/src/import/version" "${S}/src/import/vendor/src/gi

thub.com/jessfraz/netns/version"

recipes-networking/netns/netns_git.bb do_compile() { · line 29

Quoted 1 line
recipes-networking/netns/netns_git.bb +1 -0
+       mkdir -p "${S}/src/import/vendor/src/gi

thub.com/genuinetools/netns"

recipes-networking/netns/netns_git.bb do_compile() { · line 30

Quoted 1 line
recipes-networking/netns/netns_git.bb +1 -0
+       ln -sfn "${S}/src/import/ipallocator"

"${S}/src/import/vendor/src/github.com/genuinetools/netns/ipallocator"

recipes-networking/netns/netns_git.bb do_compile() { · line 31

Quoted 1 line
recipes-networking/netns/netns_git.bb +1 -0
+       ln -sfn "${S}/src/import/version" "${S}/src/import/vendor/src/gi

thub.com/genuinetools/netns/version"

Quoted 6 lines
recipes-networking/netns/netns_git.bb +0 -1
        export GOPATH="${S}/src/import/vendor"
 
        # Pass the needed cflags/ldflags so that cgo
--

2.7.4

--
Paul Barker
Togán Labs Ltd
--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"