From d3115d045b74d506b82f8e5a94f5c12de68a980f Mon Sep 17 00:00:00 2001
From: Tobias Klauser <tklauser@distanz.ch>
Date: Thu, 13 Feb 2020 11:09:40 +0100
Subject: [PATCH 02/10] make: remove the need for go-bindata

Use of go-bindata dates back from times when people ran Cilium as static
binary. This has become uncommon and users either use the container
image or a package manager which will both ship /var/lib/cilium directly
so there is no need to unpack any assets via the binary.

For people still wanting to use Cilium as a static binary, e.g. for
local development provide the `install-bpf` Makefile target to install
the BPF assets into `/var/lib/cilium`.

This saves ~380 kB in the resulting cilium-agent binary:

  == daemon/cilium-agent ==
  bss                                7752192     7752160         -32
  data                                894041      651280     -242761
  dec                               64545230    64166071     -379159
  hex                                3d8e1ce     3d318b7      -5c917
  text                              55898997    55762631     -136366

Updates #10056
Fixes #10075

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 .travis/prepare.sh                            |  1 -
 CODEOWNERS                                    | 43 +++++++++++++++++++
 Dockerfile.builder                            |  6 +--
 .../contributing/development/dev_setup.rst    |  2 -
 Makefile                                      | 14 +++---
 Makefile.defs                                 |  9 +++-
 contrib/packaging/deb/Dockerfile              |  2 -
 contrib/packaging/rpm/Dockerfile              |  2 +-
 contrib/packaging/rpm/cilium.spec.envsubst    |  2 -
 contrib/scripts/bindata.sh                    | 43 -------------------
 contrib/scripts/check-fmt.sh                  |  3 +-
 contrib/scripts/fix-sha.sh                    | 13 ------
 contrib/shell/util.sh                         | 30 -------------
 daemon/Makefile                               | 27 +-----------
 daemon/bpf.sha                                |  2 -
 daemon/daemon_main.go                         | 21 +++------
 pkg/datapath/linux/requirements.go            |  3 ++
 test/docker-compose.yml                       |  2 +-
 test/packet/scripts/install.sh                |  1 -
 19 files changed, 72 insertions(+), 154 deletions(-)
 delete mode 100755 contrib/scripts/bindata.sh
 delete mode 100755 contrib/scripts/fix-sha.sh
 delete mode 100644 daemon/bpf.sha

diff --git a/.travis/prepare.sh b/.travis/prepare.sh
index 3b5c75994..b5e045599 100755
--- a/.travis/prepare.sh
+++ b/.travis/prepare.sh
@@ -15,6 +15,5 @@ NEWPATH="/usr/local/clang/bin"
 export PATH="$NEWPATH:$PATH"
 
 # disable go modules to avoid downloading all dependencies when doing go get
-GO111MODULE=off go get github.com/cilium/go-bindata/go-bindata
 GO111MODULE=off go get golang.org/x/tools/cmd/cover
 GO111MODULE=off go get github.com/mattn/goveralls
diff --git a/CODEOWNERS b/CODEOWNERS
index 2ca3943f5..18d3a89ca 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -27,6 +27,49 @@
 # is not properly picked up in Github.
 * @cilium/janitors
 api/ @cilium/api
+bpf/ @cilium/bpf
+bugtool/cmd/ @cilium/cli
+cilium/ @cilium/cli
+cilium-health/cmd/ @cilium/cli
+cilium-health/launch/ @cilium/health
+contrib/packaging/deb/ @eloycoto
+contrib/packaging/docker/ @aanm @ianvernon
+contrib/vagrant @cilium/ci
+daemon/ @cilium/agent
+daemon/datapath.* @cilium/bpf
+daemon/endpoint.* @cilium/endpoint
+daemon/health.* @cilium/health
+daemon/ipcache.* @cilium/ipcache
+daemon/k8s_watcher.* @cilium/kubernetes
+daemon/loadbalancer.* @cilium/loadbalancer
+daemon/metrics.* @cilium/metrics
+daemon/policy.* @cilium/policy
+daemon/prefilter.go @cilium/bpf
+daemon/proxy.go @cilium/proxy
+daemon/requirements.go @cilium/bpf
+daemon/state.go @cilium/endpoint
+daemon/sysctl.* @cilium/bpf
+Documentation/ @cilium/docs
+Documentation/bpf.rst @scanf @borkmann
+Documentation/contributing.rst @cilium/contributing
+envoy/ @cilium/proxy
+examples/ @cilium/docs
+examples/getting-started/Vagrantfile @cilium/ci
+examples/kubernetes/ @cilium/kubernetes
+examples/kubernetes-ingress/ @cilium/kubernetes
+examples/mesos/Vagrantfile @cilium/ci
+examples/minikube/ @cilium/kubernetes
+ginkgo.Jenkinsfile @cilium/ci
+kubernetes-upstream.Jenkinsfile @cilium/ci
+ginkgo-all.Jenkinsfile @cilium/ci
+ginkgo-kubernetes-all.Jenkinsfile @cilium/ci
+install/kubernetes/ @cilium/kubernetes
+Jenkinsfile @cilium/ci
+Jenkinsfile.nightly @cilium/ci
+operator/ @cilium/operator
+pkg/annotation @cilium/kubernetes
+pkg/apierror/ @cilium/api
+pkg/apipanic/ @cilium/api
 pkg/apisocket/ @cilium/api
 pkg/monitor/payload @cilium/api
 pkg/policy/api/ @cilium/api
diff --git a/Dockerfile.builder b/Dockerfile.builder
index 5190100af..78bf0e752 100644
--- a/Dockerfile.builder
+++ b/Dockerfile.builder
@@ -56,8 +56,4 @@ RUN curl -sfL https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz | tar
         go get -d -u github.com/gordonklaus/ineffassign && \
         cd /go/src/github.com/gordonklaus/ineffassign && \
         git checkout -b 1003c8bd00dc2869cb5ca5282e6ce33834fed514 1003c8bd00dc2869cb5ca5282e6ce33834fed514 && \
-        go install && \
-        go get -d github.com/cilium/go-bindata/... && \
-        cd /go/src/github.com/cilium/go-bindata && \
-        git checkout -b e950ad39c6092155a6d89f04c90b1c46d8c97d49 e950ad39c6092155a6d89f04c90b1c46d8c97d49 && \
-        go install github.com/cilium/go-bindata/go-bindata
+        go install
diff --git a/Documentation/contributing/development/dev_setup.rst b/Documentation/contributing/development/dev_setup.rst
index 4bd8e59b7..e9d0371b6 100644
--- a/Documentation/contributing/development/dev_setup.rst
+++ b/Documentation/contributing/development/dev_setup.rst
@@ -30,8 +30,6 @@ contribute to Cilium:
 +----------------------------------------------------------------------------------+--------------------------+-------------------------------------------------------------------------------+
 | `go <https://golang.org/dl/>`_                                                   | |GO_RELEASE|             | N/A (OS-specific)                                                             |
 +----------------------------------------------------------------------------------+--------------------------+-------------------------------------------------------------------------------+
-| `go-bindata <https://github.com/cilium/go-bindata>`_                             | ``a0ff2567cfb``          | ``go get -u github.com/cilium/go-bindata/...``                                |
-+----------------------------------------------------------------------------------+--------------------------+-------------------------------------------------------------------------------+
 + `ginkgo <https://github.com/onsi/ginkgo>`__                                      | >= 1.4.0                 | ``go get -u github.com/onsi/ginkgo/ginkgo``                                   |
 +----------------------------------------------------------------------------------+--------------------------+-------------------------------------------------------------------------------+
 + `gomega <https://github.com/onsi/gomega>`_                                       | >= 1.2.0                 | ``go get -u github.com/onsi/gomega``                                          |
diff --git a/Makefile b/Makefile
index 4db582c89..fca5de25a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,4 @@
 include Makefile.defs
-include daemon/bpf.sha
 
 SUBDIRS_CILIUM_CONTAINER := proxylib envoy plugins/cilium-cni bpf cilium daemon cilium-health bugtool
 ifdef LIBNETWORK_PLUGIN
@@ -12,9 +11,6 @@ TESTPKGS_EVAL := $(subst github.com/cilium/cilium/,,$(shell $(CGO_DISABLED) $(GO
 TESTPKGS ?= $(TESTPKGS_EVAL)
 GOLANGVERSION := $(shell $(GO) version 2>/dev/null | grep -Eo '(go[0-9].[0-9])')
 GOLANG_SRCFILES := $(shell for pkg in $(subst github.com/cilium/cilium/,,$(GOFILES)); do find $$pkg -name *.go -print; done | grep -v vendor | sort | uniq)
-BPF_FILES_EVAL := $(shell git ls-files $(ROOT_DIR)/bpf/ | grep -v .gitignore | tr "\n" ' ')
-BPF_FILES ?= $(BPF_FILES_EVAL)
-BPF_SRCFILES := $(subst ../,,$(BPF_FILES))
 
 SWAGGER_VERSION := v0.20.1
 SWAGGER := $(CONTAINER_ENGINE_FULL) run --rm -v $(CURDIR):$(CURDIR) -w $(CURDIR) --entrypoint swagger quay.io/goswagger/swagger:$(SWAGGER_VERSION)
@@ -148,7 +144,6 @@ unit-tests: start-kvstores
 	$(QUIET) $(MAKE) -C tools/maptool/
 	$(QUIET) $(MAKE) -C test/bpf/
 	test/bpf/unit-test
-	$(QUIET) $(MAKE) -C daemon/ check-bindata
 ifeq ($(SKIP_VET),"false")
 	$(MAKE) govet
 endif
@@ -191,11 +186,16 @@ clean: clean-container
 	-$(MAKE) -C ./contrib/packaging/rpm clean
 	-rm -f GIT_VERSION
 
-install:
+install-bpf:
+	$(INSTALL) -m 0750 -d $(DESTDIR)$(LOCALSTATEDIR)/lib/cilium
+	-rm -f $(DESTDIR)$(LOCALSTATEDIR)/lib/cilium/bpf
+	$(foreach bpfsrc,$(BPF_SRCFILES), $(INSTALL) -D -m 0644 $(bpfsrc) $(DESTDIR)$(LOCALSTATEDIR)/lib/cilium/$(bpfsrc);)
+
+install: install-bpf
 	$(INSTALL) -m 0755 -d $(DESTDIR)$(BINDIR)
 	for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
 
-install-container:
+install-container: install-bpf
 	$(INSTALL) -m 0755 -d $(DESTDIR)$(BINDIR)
 	for i in $(SUBDIRS_CILIUM_CONTAINER); do $(MAKE) -C $$i install; done
 
diff --git a/Makefile.defs b/Makefile.defs
index f59ee3cfc..2e472a839 100644
--- a/Makefile.defs
+++ b/Makefile.defs
@@ -10,6 +10,7 @@ BINDIR?=$(PREFIX)/bin
 CNIBINDIR?=/opt/cni/bin
 CNICONFDIR?=/etc/cni/net.d
 LIBDIR?=$(PREFIX)/lib
+LOCALSTATEDIR?=/var
 RUNDIR?=/var/run
 CONFDIR?=/etc
 
@@ -34,7 +35,13 @@ GOLDFLAGS = -X "github.com/cilium/cilium/pkg/version.Version=$(BUILD)"
 
 CILIUM_ENVOY_SHA=$(shell grep -o "FROM.*cilium/cilium-envoy:[0-9a-fA-F]*" $(ROOT_DIR)/Dockerfile | cut -d : -f 2)
 GOLDFLAGS += -X "github.com/cilium/cilium/pkg/envoy.RequiredEnvoyVersionSHA=$(CILIUM_ENVOY_SHA)"
-GOLDFLAGS += -X "github.com/cilium/cilium/pkg/datapath/loader.DatapathSHA=$(GO_BINDATA_SHA1SUM)"
+
+BPF_FILES_EVAL := $(shell git ls-files $(ROOT_DIR)/bpf/ | grep -v .gitignore | tr "\n" ' ')
+BPF_FILES ?= $(BPF_FILES_EVAL)
+BPF_SRCFILES := $(subst ../,,$(BPF_FILES))
+
+CILIUM_DATAPATH_SHA=$(shell cat $(BPF_FILES) | sha1sum | awk '{print $$1}')
+GOLDFLAGS += -X "github.com/cilium/cilium/pkg/datapath/loader.DatapathSHA=$(CILIUM_DATAPATH_SHA)"
 
 # Set DOCKER_IMAGE_TAG with "latest" by default
 ifeq ($(DOCKER_IMAGE_TAG),)
diff --git a/contrib/packaging/deb/Dockerfile b/contrib/packaging/deb/Dockerfile
index 740d1334f..993b66aa2 100644
--- a/contrib/packaging/deb/Dockerfile
+++ b/contrib/packaging/deb/Dockerfile
@@ -19,8 +19,6 @@ RUN apt-get update && \
 ENV GOPATH /go
 ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
 
-RUN go get -u github.com/cilium/go-bindata/...
-
 RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
 WORKDIR $GOPATH
 
diff --git a/contrib/packaging/rpm/Dockerfile b/contrib/packaging/rpm/Dockerfile
index d3e534830..e93ac4320 100644
--- a/contrib/packaging/rpm/Dockerfile
+++ b/contrib/packaging/rpm/Dockerfile
@@ -6,7 +6,7 @@ RUN curl -sSL -o /etc/yum.repos.d/vbatts-bazel-fedora-28.repo \
 	https://copr.fedorainfracloud.org/coprs/vbatts/bazel/repo/fedora-28/vbatts-bazel-fedora-28.repo
 
 RUN dnf -y update && \
-	dnf -y install fedora-packager fedora-review golang go-bindata gettext \
+	dnf -y install fedora-packager fedora-review golang gettext \
 		git glibc-devel.x86_64 glibc-devel.i686 cmake bazel libtool wget \
 		clang make gcc-c++ elfutils-libelf-devel libstdc++-static && \
     mkdir -p /opt/cilium/
diff --git a/contrib/packaging/rpm/cilium.spec.envsubst b/contrib/packaging/rpm/cilium.spec.envsubst
index 9c334bb61..cb35465f2 100644
--- a/contrib/packaging/rpm/cilium.spec.envsubst
+++ b/contrib/packaging/rpm/cilium.spec.envsubst
@@ -59,7 +59,6 @@ Requires:      docker-engine >= 1.12, glibc-devel(x86-32), iproute >= 4.10, clan
 BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
 
 BuildRequires: golang
-BuildRequires: go-bindata
 BuildRequires: glibc-devel(x86-32)
 BuildRequires: cmake
 BuildRequires: bazel
@@ -107,7 +106,6 @@ echo "%{version}.%{release}" > VERSION
 
 export PKG_BUILD=1
 
-make -C daemon apply-bindata
 make V=1 proxylib plugins bpf cilium daemon monitor cilium-health bugtool tools operator
 
 %install
diff --git a/contrib/scripts/bindata.sh b/contrib/scripts/bindata.sh
deleted file mode 100755
index 6a4a36f61..000000000
--- a/contrib/scripts/bindata.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-arg1=$1
-
-BINDATA_FILE=bindata.go
-REQUIRED_GO_VERSION=$(cat ../GO_VERSION)
-
-if [[ "$arg1" == "apply" ]]; then
-  NEW_SHA1SUM=`sha1sum ${BINDATA_FILE} | awk '{ print $1}'`
-  GO_VERSION_USED=`go version | awk '{ print $3 }'`
-  BPF_FILES=`git ls-files ../bpf/ | grep -v .gitignore | tr "\n" ' '`
-  sed -i "s/GO_BINDATA_SHA1SUM=.*/GO_BINDATA_SHA1SUM=${NEW_SHA1SUM}/g" bpf.sha
-  sed -i "s#BPF_FILES=.*#BPF_FILES=${BPF_FILES}#g" bpf.sha
-  exit 0
-fi
-
-GO_BINDATA_SHA1SUM=$arg1
-
-if [[ $GO_BINDATA_SHA1SUM == "" ]]; then
-  echo "please provide a sha1sum for the expected bindata."
-  exit 1
-fi
-
-if echo "$GO_BINDATA_SHA1SUM bindata.go" | sha1sum -c --quiet; then
-  exit 0
-fi
-
-echo "########################################################################"
-echo ""
-echo "                  ERROR: bindata.go is out of date."
-echo ""
-echo " This can happen for two reasons:"
-echo " 1. You are using a go-bindata binary compiled with a different version"
-echo "    of golang (not ${REQUIRED_GO_VERSION}). If so, please up/downgrade."
-echo ""
-echo " 2. You have made changes to the bpf/ directory. Please run the"
-echo "    following command to update the SHA in daemon/bpf.sha:"
-echo ""
-echo "    $ make -C daemon apply-bindata"
-echo ""
-echo "########################################################################"
-
-exit 1
diff --git a/contrib/scripts/check-fmt.sh b/contrib/scripts/check-fmt.sh
index 37853cc06..faf1c1c28 100755
--- a/contrib/scripts/check-fmt.sh
+++ b/contrib/scripts/check-fmt.sh
@@ -7,8 +7,7 @@ diff="$(find . ! \( -path './contrib' -prune \) \
         ! \( -path './vendor' -prune \) \
         ! \( -path './.git' -prune \) \
         ! \( -path '*.validate.go' -prune \) \
-        -type f -name '*.go' | grep -v "daemon/bindata.go" | \
-        xargs gofmt -d -l -s )"
+        -type f -name '*.go' | xargs gofmt -d -l -s )"
 
 if [ -n "$diff" ]; then
 	echo "Unformatted Go source code:"
diff --git a/contrib/scripts/fix-sha.sh b/contrib/scripts/fix-sha.sh
deleted file mode 100755
index e6f73d9ca..000000000
--- a/contrib/scripts/fix-sha.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env bash
-
-SHA_PATH="daemon/bpf.sha"
-MAKE=${MAKE:-"make"}
-if [ ! -e "$SHA_PATH" ]; then
-	echo "Could not locate bpf.sha. Are you in the right directory?" >&2
-	exit 1
-fi
-
-echo "GO_BINDATA_SHA1SUM=01234567890abcdef78901234567890abcdef789" > "$SHA_PATH"
-echo "BPF_FILES=../bpf/.gitignore" >> "$SHA_PATH"
-${MAKE} -C daemon apply-bindata
-${MAKE} -C daemon apply-bindata
diff --git a/contrib/shell/util.sh b/contrib/shell/util.sh
index 52f83a49b..64bc11877 100644
--- a/contrib/shell/util.sh
+++ b/contrib/shell/util.sh
@@ -81,34 +81,4 @@ function relative() {
     done
 }
 
-# Continue rebasing and progressively update the daemon/bpf.sha each time there
-# is a merge conflict for it. If there are merge conflicts in other files, it
-# will stop rebasing and return for user input.
-#
-# Expected usage:
-#   $ git rebase origin/master
-#   <Merge failure on daemon/bpf.sha>
-#   $ rebase-bindata
-#   <For each conflict, your editor opens to review the commit. Save & exit>
-function rebase-bindata
-{
-    (
-        local dir
-        if ! git rebase --show-current-patch ; then
-            return
-        fi
-        set -x
-        while ! git rebase --continue ; do
-            dir=$(cd $(dirname ${BASH_SOURCE})/../.. && pwd)
-            $dir/contrib/scripts/fix-sha.sh
-            git add daemon/bpf.sha
-            if [ $(git diff --diff-filter=U | wc -l) -ne 0 ]; then
-                echo "Files that need manual merge:"
-                git diff --name-only --diff-filter=U
-                break
-            fi
-        done
-    )
-}
-
 trap "echo" EXIT
diff --git a/daemon/Makefile b/daemon/Makefile
index ddbd83de2..8f2c5e9c8 100644
--- a/daemon/Makefile
+++ b/daemon/Makefile
@@ -1,25 +1,13 @@
-# We keep track of the SHA over bindata.go plus the go version used to
-# generate the bindata.go as it affects the generated code. A change
-# of version is likely causing a SHA conflict as well.
-include bpf.sha
-
 # GOBUILD relies on the order of makefile list to get VERSION file
 include ../Makefile.defs
 
-
 TARGET=cilium-agent
 LINKS=cilium-node-monitor
 SOURCES := $(shell find ../api ../common ../daemon ../pkg . \( -name '*.go'  ! -name '*_test.go' \))
-$(TARGET): $(SOURCES) check-bindata
+$(TARGET): $(SOURCES)
 	@$(ECHO_GO)
 	$(QUIET) CGO_ENABLED=0 $(GO) build $(GOBUILD) -o $(TARGET)
 
-GO_BINDATA := $(QUIET) go-bindata -prefix ../ -mode 0640 -modtime 1450269211 \
-	-ignore Makefile -ignore bpf_features.h -ignore lxc_config.h \
-	-ignore netdev_config.h -ignore node_config.h -ignore filter_config.h \
-	-ignore '.+\.o$$' -ignore '.+\.orig$$' -ignore '.+~$$' \
-	-ignore '\.DS_Store'
-
 all: $(TARGET) links
 
 links:
@@ -47,16 +35,3 @@ install:
 	$(foreach link,$(LINKS), ln -f -s $(TARGET) $(DESTDIR)$(BINDIR)/$(link) || cp $(TARGET) $(DESTDIR)$(BINDIR)/$(link);)
 
 endif
-
-.PHONY: check-bindata
-check-bindata: bindata.go
-	@echo "  CHECK contrib/scripts/bindata.sh"
-	$(QUIET) ../contrib/scripts/bindata.sh $(GO_BINDATA_SHA1SUM)
-
-apply-bindata: go-bindata
-	@$(ECHO_GEN)bpf.sha
-	$(QUIET) ../contrib/scripts/bindata.sh apply
-
-bindata.go go-bindata: $(BPF_FILES)
-	@$(ECHO_GEN) $@
-	$(GO_BINDATA) -o ./bindata.go $(BPF_FILES)
diff --git a/daemon/bpf.sha b/daemon/bpf.sha
deleted file mode 100644
index e4f35b406..000000000
--- a/daemon/bpf.sha
+++ /dev/null
@@ -1,2 +0,0 @@
-GO_BINDATA_SHA1SUM=4c9cc3d2d8462a47feff46ddfe344e0396d955b6
-BPF_FILES=../bpf/COPYING ../bpf/Makefile ../bpf/Makefile.bpf ../bpf/bpf_alignchecker.c ../bpf/bpf_features.h ../bpf/bpf_hostdev_ingress.c ../bpf/bpf_ipsec.c ../bpf/bpf_lxc.c ../bpf/bpf_netdev.c ../bpf/bpf_network.c ../bpf/bpf_overlay.c ../bpf/bpf_sock.c ../bpf/bpf_xdp.c ../bpf/cilium-map-migrate.c ../bpf/filter_config.h ../bpf/include/bpf/api.h ../bpf/include/elf/elf.h ../bpf/include/elf/gelf.h ../bpf/include/elf/libelf.h ../bpf/include/iproute2/bpf_elf.h ../bpf/include/linux/bpf.h ../bpf/include/linux/bpf_common.h ../bpf/include/linux/byteorder.h ../bpf/include/linux/byteorder/big_endian.h ../bpf/include/linux/byteorder/little_endian.h ../bpf/include/linux/icmp.h ../bpf/include/linux/icmpv6.h ../bpf/include/linux/if_arp.h ../bpf/include/linux/if_ether.h ../bpf/include/linux/if_packet.h ../bpf/include/linux/in.h ../bpf/include/linux/in6.h ../bpf/include/linux/ioctl.h ../bpf/include/linux/ip.h ../bpf/include/linux/ipv6.h ../bpf/include/linux/perf_event.h ../bpf/include/linux/swab.h ../bpf/include/linux/tcp.h ../bpf/include/linux/type_mapper.h ../bpf/include/linux/udp.h ../bpf/init.sh ../bpf/lib/arp.h ../bpf/lib/common.h ../bpf/lib/config.h ../bpf/lib/conntrack.h ../bpf/lib/conntrack_map.h ../bpf/lib/conntrack_test.h ../bpf/lib/csum.h ../bpf/lib/dbg.h ../bpf/lib/drop.h ../bpf/lib/encap.h ../bpf/lib/eps.h ../bpf/lib/eth.h ../bpf/lib/events.h ../bpf/lib/icmp6.h ../bpf/lib/identity.h ../bpf/lib/ipv4.h ../bpf/lib/ipv6.h ../bpf/lib/ipv6_test.h ../bpf/lib/l3.h ../bpf/lib/l4.h ../bpf/lib/lb.h ../bpf/lib/lxc.h ../bpf/lib/maps.h ../bpf/lib/metrics.h ../bpf/lib/nat.h ../bpf/lib/nat46.h ../bpf/lib/nodeport.h ../bpf/lib/policy.h ../bpf/lib/signal.h ../bpf/lib/tailcall.h ../bpf/lib/trace.h ../bpf/lib/utils.h ../bpf/lib/xdp.h ../bpf/lxc_config.h ../bpf/netdev_config.h ../bpf/node_config.h ../bpf/probes/raw_change_tail.t ../bpf/probes/raw_fib_lookup.t ../bpf/probes/raw_insn.h ../bpf/probes/raw_invalidate_hash.t ../bpf/probes/raw_lpm_map.t ../bpf/probes/raw_lru_map.t ../bpf/probes/raw_main.c ../bpf/probes/raw_max_insn.t ../bpf/probes/raw_sock_cookie.t ../bpf/run_probes.sh ../bpf/sockops/Makefile ../bpf/sockops/bpf_redir.c ../bpf/sockops/bpf_sockops.c ../bpf/sockops/bpf_sockops.h ../bpf/sockops/sockops_config.h 
diff --git a/daemon/daemon_main.go b/daemon/daemon_main.go
index 56f451334..8f64484aa 100644
--- a/daemon/daemon_main.go
+++ b/daemon/daemon_main.go
@@ -746,9 +746,9 @@ func init() {
 	viper.BindPFlags(flags)
 }
 
-// RestoreExecPermissions restores file permissions to 0740 of all files inside
+// restoreExecPermissions restores file permissions to 0740 of all files inside
 // `searchDir` with the given regex `patterns`.
-func RestoreExecPermissions(searchDir string, patterns ...string) error {
+func restoreExecPermissions(searchDir string, patterns ...string) error {
 	fileList := []string{}
 	err := filepath.Walk(searchDir, func(path string, f os.FileInfo, err error) error {
 		for _, pattern := range patterns {
@@ -921,20 +921,11 @@ func initEnv(cmd *cobra.Command) {
 	if err := os.MkdirAll(option.Config.LibDir, defaults.RuntimePathRights); err != nil {
 		scopedLog.WithError(err).Fatal("Could not create library directory")
 	}
-	if !option.Config.KeepTemplates {
-		// We need to remove the old probes here as otherwise stale .t tests could
-		// still reside from newer Cilium versions which might break downgrade.
-		if err := os.RemoveAll(filepath.Join(option.Config.BpfDir, "/probes/")); err != nil {
-			scopedLog.WithError(err).Fatal("Could not delete old probes from library directory")
-		}
-		if err := RestoreAssets(option.Config.LibDir, defaults.BpfDir); err != nil {
-			scopedLog.WithError(err).Fatal("Unable to restore agent assets")
-		}
-		// Restore permissions of executable files
-		if err := RestoreExecPermissions(option.Config.LibDir, `.*\.sh`); err != nil {
-			scopedLog.WithError(err).Fatal("Unable to restore agent assets")
-		}
+	// Restore permissions of executable files
+	if err := restoreExecPermissions(option.Config.LibDir, `.*\.sh`); err != nil {
+		scopedLog.WithError(err).Fatal("Unable to restore agent asset permissions")
 	}
+
 	if option.Config.MaxControllerInterval < 0 {
 		scopedLog.Fatalf("Invalid %s value %d", option.MaxCtrlIntervalName, option.Config.MaxControllerInterval)
 	}
diff --git a/pkg/datapath/linux/requirements.go b/pkg/datapath/linux/requirements.go
index a131d80a9..4902c0446 100644
--- a/pkg/datapath/linux/requirements.go
+++ b/pkg/datapath/linux/requirements.go
@@ -203,6 +203,9 @@ func CheckMinRequirements() {
 	if err := os.Chdir(option.Config.LibDir); err != nil {
 		log.WithError(err).WithField(logfields.Path, option.Config.LibDir).Fatal("Could not change to runtime directory")
 	}
+	if _, err := os.Stat(option.Config.BpfDir); os.IsNotExist(err) {
+		log.WithError(err).Fatalf("BPF template directory: NOT OK. Please run 'make install-bpf'")
+	}
 	probeScript := filepath.Join(option.Config.BpfDir, "run_probes.sh")
 	if err := exec.Command(probeScript, option.Config.BpfDir, option.Config.StateDir).Run(); err != nil {
 		log.WithError(err).Fatal("BPF Verifier: NOT OK. Unable to run checker for bpf_features")
diff --git a/test/docker-compose.yml b/test/docker-compose.yml
index dd3381aac..907403167 100644
--- a/test/docker-compose.yml
+++ b/test/docker-compose.yml
@@ -15,7 +15,7 @@ services:
     command: "etcd -name etcd0 -advertise-client-urls http://0.0.0.0:4002 -listen-client-urls http://0.0.0.0:4002 -initial-cluster-token etcd-cluster-1 -initial-cluster-state new"
     privileged: true
   base_image:
-    image: "quay.io/cilium/cilium-builder:2020-02-13"
+    image: "quay.io/cilium/cilium-builder:2020-02-19"
     volumes:
       - "./../:/go/src/github.com/cilium/cilium/"
     privileged: true
diff --git a/test/packet/scripts/install.sh b/test/packet/scripts/install.sh
index 23a7ddd0e..c320e40d7 100644
--- a/test/packet/scripts/install.sh
+++ b/test/packet/scripts/install.sh
@@ -65,7 +65,6 @@ sudo ln -s /usr/local/go/bin/* /usr/local/bin/
 go version
 sudo mkdir /go/
 export GOPATH=/go/
-go get -u github.com/cilium/go-bindata/...
 go get -u github.com/google/gops
 go get -u github.com/onsi/ginkgo/ginkgo
 go get -u github.com/onsi/gomega/...
-- 
2.27.0

