From 960aff31ba2b02972b93f0a0ec45a2fba2987f48 Mon Sep 17 00:00:00 2001 From: Amy Fong Date: Thu, 9 Apr 2015 14:19:48 -0400 Subject: docker engine not running In yocto builds, preprocessing of binaries can happen after the install phase. Some of these can modify the size/sha1sum of the binaries. e.g. A new .gnu_debuglink can happen docker will not start because of these modifications. Docker initially does a sha1sum of dockerinit to identify the dockerinit that it was built with, this is done for security and for compatibility reasons. Since this checking is disabled, we should rely on rpm tests for validation of the binary instead. Signed-off-by: Amy Fong Signed-off-by: Bruce Ashfield --- recipes-containers/docker/docker_git.bb | 1 + .../docker/files/disable_sha1sum_startup.patch | 57 ++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 recipes-containers/docker/files/disable_sha1sum_startup.patch diff --git a/recipes-containers/docker/docker_git.bb b/recipes-containers/docker/docker_git.bb index a683840d..cb546161 100644 --- a/recipes-containers/docker/docker_git.bb +++ b/recipes-containers/docker/docker_git.bb @@ -24,6 +24,7 @@ SRC_URI = "\ file://docker.service \ file://docker.init \ file://hi.Dockerfile \ + file://disable_sha1sum_startup.patch \ " # The golang-cross embeds a compiler invocation for the pre-parser diff --git a/recipes-containers/docker/files/disable_sha1sum_startup.patch b/recipes-containers/docker/files/disable_sha1sum_startup.patch new file mode 100644 index 00000000..cc6819bd --- /dev/null +++ b/recipes-containers/docker/files/disable_sha1sum_startup.patch @@ -0,0 +1,57 @@ +docker engine not running + +In yocto builds, preprocessing of binaries can happen after the install phase. +Some of these can modify the size/sha1sum of the binaries. +e.g. A new .gnu_debuglink can happen + +docker will not start because of these modifications. Docker initially +does a sha1sum of dockerinit to identify the dockerinit that it was built +with, this is done for security and for compatibility reasons. Since +this checking is disabled, we should rely on rpm tests for validation +of the binary instead. + +Signed-off-by: Amy Fong +--- + utils/utils.go | 17 +---------------- + 1 file changed, 1 insertion(+), 16 deletions(-) + +--- a/utils/utils.go ++++ b/utils/utils.go +@@ -4,7 +4,6 @@ + "bufio" + "bytes" + "crypto/rand" +- "crypto/sha1" + "crypto/sha256" + "encoding/hex" + "fmt" +@@ -76,20 +75,6 @@ + return path + } + +-func dockerInitSha1(target string) string { +- f, err := os.Open(target) +- if err != nil { +- return "" +- } +- defer f.Close() +- h := sha1.New() +- _, err = io.Copy(h, f) +- if err != nil { +- return "" +- } +- return hex.EncodeToString(h.Sum(nil)) +-} +- + func isValidDockerInitPath(target string, selfPath string) bool { // target and selfPath should be absolute (InitPath and SelfPath already do this) + if target == "" { + return false +@@ -111,7 +96,7 @@ + } + return os.SameFile(targetFileInfo, selfPathFileInfo) + } +- return dockerversion.INITSHA1 != "" && dockerInitSha1(target) == dockerversion.INITSHA1 ++ return true + } + + // Figure out the path of our dockerinit (which may be SelfPath()) -- cgit v1.2.3-54-g00ecf