Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Guillaume J. Charmes authored on 2014/03/11 05:25:00... | ... |
@@ -68,7 +68,7 @@ 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 linux/386 linux/arm darwin/amd64 darwin/386 |
|
71 |
+ENV DOCKER_CROSSPLATFORMS linux/386 linux/arm darwin/amd64 darwin/386 freebsd/amd64 freebsd/386 freebsd/arm |
|
72 | 72 |
# (set an explicit GOARM of 5 for maximum compatibility) |
73 | 73 |
ENV GOARM 5 |
74 | 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' |
75 | 75 |
deleted file mode 100644 |
... | ... |
@@ -1,21 +0,0 @@ |
1 |
-// +build !linux !amd64 |
|
2 |
- |
|
3 |
-package archive |
|
4 |
- |
|
5 |
-import "syscall" |
|
6 |
- |
|
7 |
-func getLastAccess(stat *syscall.Stat_t) syscall.Timespec { |
|
8 |
- return stat.Atimespec |
|
9 |
-} |
|
10 |
- |
|
11 |
-func getLastModification(stat *syscall.Stat_t) syscall.Timespec { |
|
12 |
- return stat.Mtimespec |
|
13 |
-} |
|
14 |
- |
|
15 |
-func LUtimesNano(path string, ts []syscall.Timespec) error { |
|
16 |
- return ErrNotImplemented |
|
17 |
-} |
|
18 |
- |
|
19 |
-func UtimesNano(path string, ts []syscall.Timespec) error { |
|
20 |
- return ErrNotImplemented |
|
21 |
-} |
22 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,21 @@ |
0 |
+// +build !linux !amd64 |
|
1 |
+ |
|
2 |
+package archive |
|
3 |
+ |
|
4 |
+import "syscall" |
|
5 |
+ |
|
6 |
+func getLastAccess(stat *syscall.Stat_t) syscall.Timespec { |
|
7 |
+ return syscall.Timespec{} |
|
8 |
+} |
|
9 |
+ |
|
10 |
+func getLastModification(stat *syscall.Stat_t) syscall.Timespec { |
|
11 |
+ return syscall.Timespec{} |
|
12 |
+} |
|
13 |
+ |
|
14 |
+func LUtimesNano(path string, ts []syscall.Timespec) error { |
|
15 |
+ return ErrNotImplemented |
|
16 |
+} |
|
17 |
+ |
|
18 |
+func UtimesNano(path string, ts []syscall.Timespec) error { |
|
19 |
+ return ErrNotImplemented |
|
20 |
+} |
0 | 21 |
deleted file mode 100644 |
... | ... |
@@ -1,67 +0,0 @@ |
1 |
-package term |
|
2 |
- |
|
3 |
-import ( |
|
4 |
- "syscall" |
|
5 |
- "unsafe" |
|
6 |
-) |
|
7 |
- |
|
8 |
-const ( |
|
9 |
- getTermios = syscall.TIOCGETA |
|
10 |
- setTermios = syscall.TIOCSETA |
|
11 |
- |
|
12 |
- IGNBRK = syscall.IGNBRK |
|
13 |
- PARMRK = syscall.PARMRK |
|
14 |
- INLCR = syscall.INLCR |
|
15 |
- IGNCR = syscall.IGNCR |
|
16 |
- ECHONL = syscall.ECHONL |
|
17 |
- CSIZE = syscall.CSIZE |
|
18 |
- ICRNL = syscall.ICRNL |
|
19 |
- ISTRIP = syscall.ISTRIP |
|
20 |
- PARENB = syscall.PARENB |
|
21 |
- ECHO = syscall.ECHO |
|
22 |
- ICANON = syscall.ICANON |
|
23 |
- ISIG = syscall.ISIG |
|
24 |
- IXON = syscall.IXON |
|
25 |
- BRKINT = syscall.BRKINT |
|
26 |
- INPCK = syscall.INPCK |
|
27 |
- OPOST = syscall.OPOST |
|
28 |
- CS8 = syscall.CS8 |
|
29 |
- IEXTEN = syscall.IEXTEN |
|
30 |
-) |
|
31 |
- |
|
32 |
-type Termios struct { |
|
33 |
- Iflag uint32 |
|
34 |
- Oflag uint32 |
|
35 |
- Cflag uint32 |
|
36 |
- Lflag uint32 |
|
37 |
- Cc [20]byte |
|
38 |
- Ispeed uint32 |
|
39 |
- Ospeed uint32 |
|
40 |
-} |
|
41 |
- |
|
42 |
-// MakeRaw put the terminal connected to the given file descriptor into raw |
|
43 |
-// mode and returns the previous state of the terminal so that it can be |
|
44 |
-// restored. |
|
45 |
-func MakeRaw(fd uintptr) (*State, error) { |
|
46 |
- var oldState State |
|
47 |
- if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(&oldState.termios))); err != 0 { |
|
48 |
- return nil, err |
|
49 |
- } |
|
50 |
- // C.makeraw() |
|
51 |
- // return &oldState, nil |
|
52 |
- |
|
53 |
- newState := oldState.termios |
|
54 |
- newState.Iflag &^= (IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON) |
|
55 |
- newState.Oflag &^= OPOST |
|
56 |
- newState.Lflag &^= (ECHO | ECHONL | ICANON | ISIG | IEXTEN) |
|
57 |
- newState.Cflag &^= (CSIZE | PARENB) |
|
58 |
- newState.Cflag |= CS8 |
|
59 |
- newState.Cc[syscall.VMIN] = 1 |
|
60 |
- newState.Cc[syscall.VTIME] = 0 |
|
61 |
- |
|
62 |
- if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(setTermios), uintptr(unsafe.Pointer(&newState))); err != 0 { |
|
63 |
- return nil, err |
|
64 |
- } |
|
65 |
- |
|
66 |
- return &oldState, nil |
|
67 |
-} |
68 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,67 @@ |
0 |
+package term |
|
1 |
+ |
|
2 |
+import ( |
|
3 |
+ "syscall" |
|
4 |
+ "unsafe" |
|
5 |
+) |
|
6 |
+ |
|
7 |
+const ( |
|
8 |
+ getTermios = syscall.TIOCGETA |
|
9 |
+ setTermios = syscall.TIOCSETA |
|
10 |
+ |
|
11 |
+ IGNBRK = syscall.IGNBRK |
|
12 |
+ PARMRK = syscall.PARMRK |
|
13 |
+ INLCR = syscall.INLCR |
|
14 |
+ IGNCR = syscall.IGNCR |
|
15 |
+ ECHONL = syscall.ECHONL |
|
16 |
+ CSIZE = syscall.CSIZE |
|
17 |
+ ICRNL = syscall.ICRNL |
|
18 |
+ ISTRIP = syscall.ISTRIP |
|
19 |
+ PARENB = syscall.PARENB |
|
20 |
+ ECHO = syscall.ECHO |
|
21 |
+ ICANON = syscall.ICANON |
|
22 |
+ ISIG = syscall.ISIG |
|
23 |
+ IXON = syscall.IXON |
|
24 |
+ BRKINT = syscall.BRKINT |
|
25 |
+ INPCK = syscall.INPCK |
|
26 |
+ OPOST = syscall.OPOST |
|
27 |
+ CS8 = syscall.CS8 |
|
28 |
+ IEXTEN = syscall.IEXTEN |
|
29 |
+) |
|
30 |
+ |
|
31 |
+type Termios struct { |
|
32 |
+ Iflag uint32 |
|
33 |
+ Oflag uint32 |
|
34 |
+ Cflag uint32 |
|
35 |
+ Lflag uint32 |
|
36 |
+ Cc [20]byte |
|
37 |
+ Ispeed uint32 |
|
38 |
+ Ospeed uint32 |
|
39 |
+} |
|
40 |
+ |
|
41 |
+// MakeRaw put the terminal connected to the given file descriptor into raw |
|
42 |
+// mode and returns the previous state of the terminal so that it can be |
|
43 |
+// restored. |
|
44 |
+func MakeRaw(fd uintptr) (*State, error) { |
|
45 |
+ var oldState State |
|
46 |
+ if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(&oldState.termios))); err != 0 { |
|
47 |
+ return nil, err |
|
48 |
+ } |
|
49 |
+ // C.makeraw() |
|
50 |
+ // return &oldState, nil |
|
51 |
+ |
|
52 |
+ newState := oldState.termios |
|
53 |
+ newState.Iflag &^= (IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON) |
|
54 |
+ newState.Oflag &^= OPOST |
|
55 |
+ newState.Lflag &^= (ECHO | ECHONL | ICANON | ISIG | IEXTEN) |
|
56 |
+ newState.Cflag &^= (CSIZE | PARENB) |
|
57 |
+ newState.Cflag |= CS8 |
|
58 |
+ newState.Cc[syscall.VMIN] = 1 |
|
59 |
+ newState.Cc[syscall.VTIME] = 0 |
|
60 |
+ |
|
61 |
+ if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(setTermios), uintptr(unsafe.Pointer(&newState))); err != 0 { |
|
62 |
+ return nil, err |
|
63 |
+ } |
|
64 |
+ |
|
65 |
+ return &oldState, nil |
|
66 |
+} |