diff options
author | Amy Fong <amy.fong@windriver.com> | 2015-04-09 14:19:48 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2015-04-11 00:22:37 -0400 |
commit | 960aff31ba2b02972b93f0a0ec45a2fba2987f48 (patch) | |
tree | fbc9b013dba2125277414b9539b9b70473234f12 | |
parent | 23e15f52a09ae506b2bab1bb2dbdc690116e521b (diff) | |
download | meta-virtualization-960aff31ba2b02972b93f0a0ec45a2fba2987f48.tar.gz |
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 <amy.fong@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r-- | recipes-containers/docker/docker_git.bb | 1 | ||||
-rw-r--r-- | recipes-containers/docker/files/disable_sha1sum_startup.patch | 57 |
2 files changed, 58 insertions, 0 deletions
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 = "\ | |||
24 | file://docker.service \ | 24 | file://docker.service \ |
25 | file://docker.init \ | 25 | file://docker.init \ |
26 | file://hi.Dockerfile \ | 26 | file://hi.Dockerfile \ |
27 | file://disable_sha1sum_startup.patch \ | ||
27 | " | 28 | " |
28 | 29 | ||
29 | # The golang-cross embeds a compiler invocation for the pre-parser | 30 | # 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 @@ | |||
1 | docker engine not running | ||
2 | |||
3 | In yocto builds, preprocessing of binaries can happen after the install phase. | ||
4 | Some of these can modify the size/sha1sum of the binaries. | ||
5 | e.g. A new .gnu_debuglink can happen | ||
6 | |||
7 | docker will not start because of these modifications. Docker initially | ||
8 | does a sha1sum of dockerinit to identify the dockerinit that it was built | ||
9 | with, this is done for security and for compatibility reasons. Since | ||
10 | this checking is disabled, we should rely on rpm tests for validation | ||
11 | of the binary instead. | ||
12 | |||
13 | Signed-off-by: Amy Fong <amy.fong@windriver.com> | ||
14 | --- | ||
15 | utils/utils.go | 17 +---------------- | ||
16 | 1 file changed, 1 insertion(+), 16 deletions(-) | ||
17 | |||
18 | --- a/utils/utils.go | ||
19 | +++ b/utils/utils.go | ||
20 | @@ -4,7 +4,6 @@ | ||
21 | "bufio" | ||
22 | "bytes" | ||
23 | "crypto/rand" | ||
24 | - "crypto/sha1" | ||
25 | "crypto/sha256" | ||
26 | "encoding/hex" | ||
27 | "fmt" | ||
28 | @@ -76,20 +75,6 @@ | ||
29 | return path | ||
30 | } | ||
31 | |||
32 | -func dockerInitSha1(target string) string { | ||
33 | - f, err := os.Open(target) | ||
34 | - if err != nil { | ||
35 | - return "" | ||
36 | - } | ||
37 | - defer f.Close() | ||
38 | - h := sha1.New() | ||
39 | - _, err = io.Copy(h, f) | ||
40 | - if err != nil { | ||
41 | - return "" | ||
42 | - } | ||
43 | - return hex.EncodeToString(h.Sum(nil)) | ||
44 | -} | ||
45 | - | ||
46 | func isValidDockerInitPath(target string, selfPath string) bool { // target and selfPath should be absolute (InitPath and SelfPath already do this) | ||
47 | if target == "" { | ||
48 | return false | ||
49 | @@ -111,7 +96,7 @@ | ||
50 | } | ||
51 | return os.SameFile(targetFileInfo, selfPathFileInfo) | ||
52 | } | ||
53 | - return dockerversion.INITSHA1 != "" && dockerInitSha1(target) == dockerversion.INITSHA1 | ||
54 | + return true | ||
55 | } | ||
56 | |||
57 | // Figure out the path of our dockerinit (which may be SelfPath()) | ||