diff options
| -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()) | ||
