Remove all darwin specific files and use more generic _unsupported with build tags.
| ... | ... |
@@ -68,8 +68,9 @@ ENV GOPATH /go:/go/src/github.com/dotcloud/docker/vendor |
| 68 | 68 |
RUN cd /usr/local/go/src && ./make.bash --no-clean 2>&1 |
| 69 | 69 |
|
| 70 | 70 |
# Compile Go for cross compilation |
| 71 |
-ENV DOCKER_CROSSPLATFORMS darwin/amd64 darwin/386 |
|
| 72 |
-# TODO add linux/386 and linux/arm |
|
| 71 |
+ENV DOCKER_CROSSPLATFORMS linux/386 linux/arm darwin/amd64 darwin/386 |
|
| 72 |
+# (set an explicit GOARM of 5 for maximum compatibility) |
|
| 73 |
+ENV GOARM 5 |
|
| 73 | 74 |
RUN cd /usr/local/go/src && bash -xc 'for platform in $DOCKER_CROSSPLATFORMS; do GOOS=${platform%/*} GOARCH=${platform##*/} ./make.bash --no-clean 2>&1; done'
|
| 74 | 75 |
|
| 75 | 76 |
# Grab Go's cover tool for dead-simple code coverage testing |
| 4 | 6 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,11 @@ |
| 0 |
+// +build !linux !amd64 |
|
| 1 |
+ |
|
| 2 |
+package aufs |
|
| 3 |
+ |
|
| 4 |
+import "errors" |
|
| 5 |
+ |
|
| 6 |
+const MsRemount = 0 |
|
| 7 |
+ |
|
| 8 |
+func mount(source string, target string, fstype string, flags uintptr, data string) (err error) {
|
|
| 9 |
+ return errors.New("mount is not implemented on darwin")
|
|
| 10 |
+} |
| ... | ... |
@@ -151,7 +151,8 @@ release_build() {
|
| 151 | 151 |
S3ARCH=i386 |
| 152 | 152 |
;; |
| 153 | 153 |
arm) |
| 154 |
- # GOARCH is fine |
|
| 154 |
+ S3ARCH=armel |
|
| 155 |
+ # someday, we might potentially support mutliple GOARM values, in which case we might get armhf here too |
|
| 155 | 156 |
;; |
| 156 | 157 |
*) |
| 157 | 158 |
echo >&2 "error: can't convert $S3ARCH to an appropriate value for 'uname -m'" |
| 4 | 6 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,11 @@ |
| 0 |
+// +build !linux !amd64 |
|
| 1 |
+ |
|
| 2 |
+package mount |
|
| 3 |
+ |
|
| 4 |
+func mount(device, target, mType string, flag uintptr, data string) error {
|
|
| 5 |
+ panic("Not implemented")
|
|
| 6 |
+} |
|
| 7 |
+ |
|
| 8 |
+func unmount(target string, flag int) error {
|
|
| 9 |
+ panic("Not implemented")
|
|
| 10 |
+} |
| 0 | 11 |
deleted file mode 100644 |
| ... | ... |
@@ -1,31 +0,0 @@ |
| 1 |
-package netlink |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "fmt" |
|
| 5 |
- "net" |
|
| 6 |
-) |
|
| 7 |
- |
|
| 8 |
-func NetworkGetRoutes() ([]Route, error) {
|
|
| 9 |
- return nil, fmt.Errorf("Not implemented")
|
|
| 10 |
-} |
|
| 11 |
- |
|
| 12 |
-func NetworkLinkAdd(name string, linkType string) error {
|
|
| 13 |
- return fmt.Errorf("Not implemented")
|
|
| 14 |
-} |
|
| 15 |
- |
|
| 16 |
-func NetworkLinkUp(iface *net.Interface) error {
|
|
| 17 |
- return fmt.Errorf("Not implemented")
|
|
| 18 |
-} |
|
| 19 |
- |
|
| 20 |
-func NetworkLinkAddIp(iface *net.Interface, ip net.IP, ipNet *net.IPNet) error {
|
|
| 21 |
- return fmt.Errorf("Not implemented")
|
|
| 22 |
-} |
|
| 23 |
- |
|
| 24 |
-func AddDefaultGw(ip net.IP) error {
|
|
| 25 |
- return fmt.Errorf("Not implemented")
|
|
| 26 |
- |
|
| 27 |
-} |
|
| 28 |
- |
|
| 29 |
-func NetworkSetMTU(iface *net.Interface, mtu int) error {
|
|
| 30 |
- return fmt.Errorf("Not implemented")
|
|
| 31 |
-} |
| 4 | 6 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,33 @@ |
| 0 |
+// +build !linux !amd64 |
|
| 1 |
+ |
|
| 2 |
+package netlink |
|
| 3 |
+ |
|
| 4 |
+import ( |
|
| 5 |
+ "fmt" |
|
| 6 |
+ "net" |
|
| 7 |
+) |
|
| 8 |
+ |
|
| 9 |
+func NetworkGetRoutes() ([]Route, error) {
|
|
| 10 |
+ return nil, fmt.Errorf("Not implemented")
|
|
| 11 |
+} |
|
| 12 |
+ |
|
| 13 |
+func NetworkLinkAdd(name string, linkType string) error {
|
|
| 14 |
+ return fmt.Errorf("Not implemented")
|
|
| 15 |
+} |
|
| 16 |
+ |
|
| 17 |
+func NetworkLinkUp(iface *net.Interface) error {
|
|
| 18 |
+ return fmt.Errorf("Not implemented")
|
|
| 19 |
+} |
|
| 20 |
+ |
|
| 21 |
+func NetworkLinkAddIp(iface *net.Interface, ip net.IP, ipNet *net.IPNet) error {
|
|
| 22 |
+ return fmt.Errorf("Not implemented")
|
|
| 23 |
+} |
|
| 24 |
+ |
|
| 25 |
+func AddDefaultGw(ip net.IP) error {
|
|
| 26 |
+ return fmt.Errorf("Not implemented")
|
|
| 27 |
+ |
|
| 28 |
+} |
|
| 29 |
+ |
|
| 30 |
+func NetworkSetMTU(iface *net.Interface, mtu int) error {
|
|
| 31 |
+ return fmt.Errorf("Not implemented")
|
|
| 32 |
+} |
| 0 | 33 |
deleted file mode 100644 |
| ... | ... |
@@ -1,14 +0,0 @@ |
| 1 |
-package docker |
|
| 2 |
- |
|
| 3 |
-import ( |
|
| 4 |
- "io" |
|
| 5 |
- "os" |
|
| 6 |
-) |
|
| 7 |
- |
|
| 8 |
-func CopyFile(dstFile, srcFile *os.File) error {
|
|
| 9 |
- // No BTRFS reflink suppport, Fall back to normal copy |
|
| 10 |
- |
|
| 11 |
- // FIXME: Check the return of Copy and compare with dstFile.Stat().Size |
|
| 12 |
- _, err := io.Copy(dstFile, srcFile) |
|
| 13 |
- return err |
|
| 14 |
-} |
| 4 | 6 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,16 @@ |
| 0 |
+// +build !linux !amd64 |
|
| 1 |
+ |
|
| 2 |
+package docker |
|
| 3 |
+ |
|
| 4 |
+import ( |
|
| 5 |
+ "io" |
|
| 6 |
+ "os" |
|
| 7 |
+) |
|
| 8 |
+ |
|
| 9 |
+func CopyFile(dstFile, srcFile *os.File) error {
|
|
| 10 |
+ // No BTRFS reflink suppport, Fall back to normal copy |
|
| 11 |
+ |
|
| 12 |
+ // FIXME: Check the return of Copy and compare with dstFile.Stat().Size |
|
| 13 |
+ _, err := io.Copy(dstFile, srcFile) |
|
| 14 |
+ return err |
|
| 15 |
+} |
| ... | ... |
@@ -24,10 +24,12 @@ func TreeSize(dir string) (size int64, err error) {
|
| 24 | 24 |
|
| 25 | 25 |
// Check inode to handle hard links correctly |
| 26 | 26 |
inode := fileInfo.Sys().(*syscall.Stat_t).Ino |
| 27 |
- if _, exists := data[inode]; exists {
|
|
| 27 |
+ // inode is not a uint64 on all platforms. Cast it to avoid issues. |
|
| 28 |
+ if _, exists := data[uint64(inode)]; exists {
|
|
| 28 | 29 |
return nil |
| 29 | 30 |
} |
| 30 |
- data[inode] = false |
|
| 31 |
+ // inode is not a uint64 on all platforms. Cast it to avoid issues. |
|
| 32 |
+ data[uint64(inode)] = false |
|
| 31 | 33 |
|
| 32 | 34 |
size += s |
| 33 | 35 |
|
| 4 | 6 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,15 @@ |
| 0 |
+// +build !linux !amd64 |
|
| 1 |
+ |
|
| 2 |
+package utils |
|
| 3 |
+ |
|
| 4 |
+import ( |
|
| 5 |
+ "errors" |
|
| 6 |
+) |
|
| 7 |
+ |
|
| 8 |
+type Utsname struct {
|
|
| 9 |
+ Release [65]byte |
|
| 10 |
+} |
|
| 11 |
+ |
|
| 12 |
+func uname() (*Utsname, error) {
|
|
| 13 |
+ return nil, errors.New("Kernel version detection is available only on linux")
|
|
| 14 |
+} |