lakitu: Upgrade containerd to 1.4.0-rc.0

To support remote snapshotters, we need to upgrade containerd to 1.4.0.

BUG=b/159133692
TEST=tryjob
RELEASE_NOTE=Upgraded containerd to 1.4.0-rc.0.

Change-Id: I32015ea36edeff3fef8f4a68dfd179a4f4dce4e9
diff --git a/overlay-lakitu/app-emulation/containerd/Manifest b/overlay-lakitu/app-emulation/containerd/Manifest
index 7211c3b..cf4075d 100644
--- a/overlay-lakitu/app-emulation/containerd/Manifest
+++ b/overlay-lakitu/app-emulation/containerd/Manifest
@@ -1 +1 @@
-DIST containerd-1.3.4.tar.gz 5700890 BLAKE2B 9d5642399eafbf3df25d2bdb6ffeb8e98362e9f2c6cdcd7a64fff12bad40f58fa97451228a607def408cc8a8cfbfce67c47fcfdf86865d8086d0b7aad7595d5a SHA512 b186d5aef3e5a0d35c12dcc3cfa5d48a9602f6278c4650942859a1ab6abd1299d33a1bc623376955a834a2626491196b604591d92a05d39745dfc33ff51ad5aa
+DIST containerd-1.4.0_rc0.tar.gz 6073516 BLAKE2B 8d5ce4499e2520666abba6868796d390e17b13782c00966a64b8b6f3d5db0068485077f99033f86f015c6cbfadf8ef2d496e6010d258bd2c20b551a13cbf68dd SHA512 df50f6a73a4926bac975d3e2e665535edf8b813298bfeaaae95b8e721525c72a48ccb6ee4b623db1109110427f7065a650b4e2935c18153e5d707d83ac3be745
diff --git a/overlay-lakitu/app-emulation/containerd/containerd-1.3.4-r1.ebuild b/overlay-lakitu/app-emulation/containerd/containerd-1.3.4-r1.ebuild
deleted file mode 120000
index e0c68cb..0000000
--- a/overlay-lakitu/app-emulation/containerd/containerd-1.3.4-r1.ebuild
+++ /dev/null
@@ -1 +0,0 @@
-containerd-1.3.4.ebuild
\ No newline at end of file
diff --git a/overlay-lakitu/app-emulation/containerd/containerd-1.4.0_rc0-r1.ebuild b/overlay-lakitu/app-emulation/containerd/containerd-1.4.0_rc0-r1.ebuild
new file mode 120000
index 0000000..b4bef80
--- /dev/null
+++ b/overlay-lakitu/app-emulation/containerd/containerd-1.4.0_rc0-r1.ebuild
@@ -0,0 +1 @@
+containerd-1.4.0_rc0.ebuild
\ No newline at end of file
diff --git a/overlay-lakitu/app-emulation/containerd/containerd-1.3.4.ebuild b/overlay-lakitu/app-emulation/containerd/containerd-1.4.0_rc0.ebuild
similarity index 91%
rename from overlay-lakitu/app-emulation/containerd/containerd-1.3.4.ebuild
rename to overlay-lakitu/app-emulation/containerd/containerd-1.4.0_rc0.ebuild
index 3cc5d53..a0149dc 100644
--- a/overlay-lakitu/app-emulation/containerd/containerd-1.3.4.ebuild
+++ b/overlay-lakitu/app-emulation/containerd/containerd-1.4.0_rc0.ebuild
@@ -12,7 +12,7 @@
 else
 	MY_PV="${PV/_rc/-rc.}"
 	EGIT_COMMIT="v${MY_PV}"
-	CONTAINERD_COMMIT="814b7956fafc7a0980ea07e950f983d0837e5578"
+	CONTAINERD_COMMIT="85b15eff4581d7e5e3bccb40fdd4f35b6946f545"
 	SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
 	KEYWORDS="*"
 	inherit golang-vcs-snapshot
@@ -39,12 +39,12 @@
 PATCHES=(
 	# lakitu: uses Go cross compiler in the builder (i.e. ${GO}) rather than
 	# the default go compiler in the builders (i.e. go).
-	"${FILESDIR}"/1.3.4-use-Go-cross-compiler.patch
+	"${FILESDIR}"/1.4.0-Read-the-Go-tool-to-use-from-the-environment.patch
 	# lakitu: three changes in containerd.service:
 	# 1. always restart containerd
 	# 2. set containerd path to /usr/bin/containerd
 	# 3. set OOM score to -999
-	"${FILESDIR}"/1.3.4-customize-containerd-service.patch
+	"${FILESDIR}"/1.4.0-customize-containerd-service.patch
 )
 
 RESTRICT="test"
diff --git a/overlay-lakitu/app-emulation/containerd/files/1.3.4-use-Go-cross-compiler.patch b/overlay-lakitu/app-emulation/containerd/files/1.4.0-Read-the-Go-tool-to-use-from-the-environment.patch
similarity index 67%
rename from overlay-lakitu/app-emulation/containerd/files/1.3.4-use-Go-cross-compiler.patch
rename to overlay-lakitu/app-emulation/containerd/files/1.4.0-Read-the-Go-tool-to-use-from-the-environment.patch
index 070c80a..1e22c0e 100644
--- a/overlay-lakitu/app-emulation/containerd/files/1.3.4-use-Go-cross-compiler.patch
+++ b/overlay-lakitu/app-emulation/containerd/files/1.4.0-Read-the-Go-tool-to-use-from-the-environment.patch
@@ -1,19 +1,20 @@
-From 938d5549a669ceb93e54b1b6f57f56c4ebff7c4e Mon Sep 17 00:00:00 2001
-From: Vaibhav Rustagi <vaibhavrustagi@google.com>
-Date: Fri, 17 Apr 2020 11:44:15 -0700
-Subject: [PATCH] go-cross-compiler-patch
+From c0b8b443576b8a369870e425262c456e1c3a58c5 Mon Sep 17 00:00:00 2001
+From: Robert Kolchmeyer <rkolchmeyer@google.com>
+Date: Wed, 1 Jul 2020 13:56:06 -0700
+Subject: [PATCH 1/2] Read the Go tool to use from the environment.
 
+We need to pass in the ChromeOS cross compiler.
 ---
- Makefile | 44 ++++++++++++++++++++++----------------------
- 1 file changed, 22 insertions(+), 22 deletions(-)
+ Makefile | 42 +++++++++++++++++++++---------------------
+ 1 file changed, 21 insertions(+), 21 deletions(-)
 
 diff --git a/Makefile b/Makefile
-index c1ea1dde..335d986d 100644
+index f2592adf..9febd026 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -24,9 +24,9 @@ VERSION=$(shell git describe --match 'v[0-9]*' --dirty='.m' --always)
- REVISION=$(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi)
+@@ -25,9 +25,9 @@ REVISION=$(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet
  PACKAGE=github.com/containerd/containerd
+ SHIM_CGO_ENABLED ?= 0
  
 -ifneq "$(strip $(shell command -v go 2>/dev/null))" ""
 -	GOOS ?= $(shell go env GOOS)
@@ -24,7 +25,7 @@
  else
  	ifeq ($(GOOS),)
  		# approximate GOOS for the platform if we don't have Go and GOOS isn't
-@@ -68,7 +68,7 @@ RELEASE=containerd-$(VERSION:v%=%).${GOOS}-${GOARCH}
+@@ -69,7 +69,7 @@ RELEASE=containerd-$(VERSION:v%=%).${GOOS}-${GOARCH}
  PKG=github.com/containerd/containerd
  
  # Project packages.
@@ -33,16 +34,7 @@
  INTEGRATION_PACKAGE=${PKG}
  TEST_REQUIRES_ROOT_PACKAGES=$(filter \
      ${PACKAGES}, \
-@@ -115,7 +115,7 @@ GO_GCFLAGS=$(shell				\
- 
- BINARIES=$(addprefix bin/,$(COMMANDS))
- 
--# Flags passed to `go test`
-+# Flags passed to `${GO} test`
- TESTFLAGS ?= $(TESTFLAGS_RACE) $(EXTRA_TESTFLAGS)
- TESTFLAGS_PARALLEL ?= 8
- 
-@@ -135,7 +135,7 @@ AUTHORS: .mailmap .git/HEAD
+@@ -136,7 +136,7 @@ AUTHORS: .mailmap .git/HEAD
  
  generate: protos
  	@echo "$(WHALE) $@"
@@ -51,7 +43,7 @@
  
  protos: bin/protoc-gen-gogoctrd ## generate protobuf
  	@echo "$(WHALE) $@"
-@@ -160,44 +160,44 @@ proto-fmt: ## check format of proto files
+@@ -161,31 +161,31 @@ proto-fmt: ## check format of proto files
  	@test -z "$$(find . -path ./vendor -prune -o -name '*.proto' -type f -exec grep -Hn "Meta meta = " {} \; | grep -v '(gogoproto.nullable) = false' | tee /dev/stderr)" || \
  		(echo "$(ONI) meta fields in proto files must have option (gogoproto.nullable) = false" && false)
  
@@ -83,30 +75,33 @@
  
  FORCE:
  
+ define BUILD_BINARY =
+ @echo "$(WHALE) $@"
+-@go build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@ ${GO_LDFLAGS} ${GO_TAGS}  ./$<
++@${GO} build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@ ${GO_LDFLAGS} ${GO_TAGS}  ./$<
+ endef
+ 
  # Build a binary from a cmd.
- bin/%: cmd/% FORCE
- 	@echo "$(WHALE) $@${BINARY_SUFFIX}"
--	@go build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@${BINARY_SUFFIX} ${GO_LDFLAGS} ${GO_TAGS}  ./$<
-+	@${GO} build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@${BINARY_SUFFIX} ${GO_LDFLAGS} ${GO_TAGS}  ./$<
+@@ -194,15 +194,15 @@ bin/%: cmd/% FORCE
  
  bin/containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
  	@echo "$(WHALE) bin/containerd-shim"
--	@CGO_ENABLED=0 go build ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
-+	@CGO_ENABLED=0 ${GO} build ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
+-	@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
++	@CGO_ENABLED=${SHIM_CGO_ENABLED} ${GO} build ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
  
  bin/containerd-shim-runc-v1: cmd/containerd-shim-runc-v1 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
  	@echo "$(WHALE) bin/containerd-shim-runc-v1"
--	@CGO_ENABLED=0 go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1
-+	@CGO_ENABLED=0 ${GO} build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1
+-	@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1
++	@CGO_ENABLED=${SHIM_CGO_ENABLED} ${GO} build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v1 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v1
  
  bin/containerd-shim-runc-v2: cmd/containerd-shim-runc-v2 FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
  	@echo "$(WHALE) bin/containerd-shim-runc-v2"
--	@CGO_ENABLED=0 go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2
-+	@CGO_ENABLED=0 ${GO} build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2
+-	@CGO_ENABLED=${SHIM_CGO_ENABLED} go build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2
++	@CGO_ENABLED=${SHIM_CGO_ENABLED} ${GO} build ${GO_BUILD_FLAGS} -o bin/containerd-shim-runc-v2 ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim-runc-v2
  
  binaries: $(BINARIES) ## build binaries
  	@echo "$(WHALE) $@"
-@@ -213,11 +213,11 @@ genman: man/containerd.8 man/ctr.8
+@@ -218,11 +218,11 @@ genman: man/containerd.8 man/ctr.8
  
  man/containerd.8: FORCE
  	@echo "$(WHALE) $@"
@@ -120,7 +115,7 @@
  
  man/%: docs/man/%.md FORCE
  	@echo "$(WHALE) $@"
-@@ -279,9 +279,9 @@ uninstall:
+@@ -284,9 +284,9 @@ uninstall:
  coverage: ## generate coverprofiles from the unit tests, except tests that require root
  	@echo "$(WHALE) $@"
  	@rm -f coverage.txt
@@ -132,7 +127,7 @@
  			-cover \
  			-coverprofile=profile.out \
  			-covermode=atomic $$pkg || exit; \
-@@ -293,9 +293,9 @@ coverage: ## generate coverprofiles from the unit tests, except tests that requi
+@@ -298,9 +298,9 @@ coverage: ## generate coverprofiles from the unit tests, except tests that requi
  
  root-coverage: ## generate coverage profiles for unit tests that require root
  	@echo "$(WHALE) $@"
@@ -145,5 +140,5 @@
  			-coverprofile=profile.out \
  			-covermode=atomic $$pkg -test.root || exit; \
 -- 
-2.26.1.301.g55bc3eb7cb9-goog
+2.27.0.212.ge8ba1cc988-goog
 
diff --git a/overlay-lakitu/app-emulation/containerd/files/1.3.4-customize-containerd-service.patch b/overlay-lakitu/app-emulation/containerd/files/1.4.0-customize-containerd-service.patch
similarity index 84%
rename from overlay-lakitu/app-emulation/containerd/files/1.3.4-customize-containerd-service.patch
rename to overlay-lakitu/app-emulation/containerd/files/1.4.0-customize-containerd-service.patch
index 8222a59..5016ac7 100644
--- a/overlay-lakitu/app-emulation/containerd/files/1.3.4-customize-containerd-service.patch
+++ b/overlay-lakitu/app-emulation/containerd/files/1.4.0-customize-containerd-service.patch
@@ -1,7 +1,7 @@
-From f6d05d79a753bbe1141876bf4e19e0c5014df5f6 Mon Sep 17 00:00:00 2001
+From 8d4bffa5708bdb38787e3e7cda36a4f3c26a3bb0 Mon Sep 17 00:00:00 2001
 From: Vaibhav Rustagi <vaibhavrustagi@google.com>
 Date: Fri, 17 Apr 2020 12:10:40 -0700
-Subject: [PATCH] customize-containerd-service
+Subject: [PATCH 2/2] customize-containerd-service
 
 ---
  containerd.service | 4 +++-
@@ -28,5 +28,5 @@
  # in the kernel. We recommend using cgroups to do container-local accounting.
  LimitNPROC=infinity
 -- 
-2.26.1.301.g55bc3eb7cb9-goog
+2.27.0.212.ge8ba1cc988-goog