Skip to content

Commit de04b32

Browse files
committed
Add copyright header & make sure compilation succeeds on all platforms
Signed-off-by: Gijs Peskens <[email protected]>
1 parent e1fd6be commit de04b32

4 files changed

Lines changed: 126 additions & 92 deletions

File tree

oci/mounts.go

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// +build !freebsd
2+
3+
/*
4+
Copyright The containerd Authors.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/
18+
19+
package oci
20+
21+
import (
22+
specs "github.com/opencontainers/runtime-spec/specs-go"
23+
)
24+
25+
func defaultMounts() []specs.Mount {
26+
return []specs.Mount{
27+
{
28+
Destination: "/proc",
29+
Type: "proc",
30+
Source: "proc",
31+
Options: []string{"nosuid", "noexec", "nodev"},
32+
},
33+
{
34+
Destination: "/dev",
35+
Type: "tmpfs",
36+
Source: "tmpfs",
37+
Options: []string{"nosuid", "strictatime", "mode=755", "size=65536k"},
38+
},
39+
{
40+
Destination: "/dev/pts",
41+
Type: "devpts",
42+
Source: "devpts",
43+
Options: []string{"nosuid", "noexec", "newinstance", "ptmxmode=0666", "mode=0620", "gid=5"},
44+
},
45+
{
46+
Destination: "/dev/shm",
47+
Type: "tmpfs",
48+
Source: "shm",
49+
Options: []string{"nosuid", "noexec", "nodev", "mode=1777", "size=65536k"},
50+
},
51+
{
52+
Destination: "/dev/mqueue",
53+
Type: "mqueue",
54+
Source: "mqueue",
55+
Options: []string{"nosuid", "noexec", "nodev"},
56+
},
57+
{
58+
Destination: "/sys",
59+
Type: "sysfs",
60+
Source: "sysfs",
61+
Options: []string{"nosuid", "noexec", "nodev", "ro"},
62+
},
63+
{
64+
Destination: "/run",
65+
Type: "tmpfs",
66+
Source: "tmpfs",
67+
Options: []string{"nosuid", "strictatime", "mode=755", "size=65536k"},
68+
},
69+
}
70+
}

oci/mounts_freebsd.go

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
Copyright The containerd Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package oci
18+
19+
import (
20+
specs "github.com/opencontainers/runtime-spec/specs-go"
21+
)
22+
23+
func defaultMounts() []specs.Mount {
24+
return []specs.Mount{
25+
{
26+
Destination: "/proc",
27+
Type: "procfs",
28+
Source: "proc",
29+
Options: []string{"nosuid", "noexec"},
30+
},
31+
{
32+
Destination: "/dev",
33+
Type: "devfs",
34+
Source: "devfs",
35+
Options: []string{},
36+
},
37+
{
38+
Destination: "/dev/fd",
39+
Type: "fdescfs",
40+
Source: "fdescfs",
41+
Options: []string{},
42+
},
43+
{
44+
Destination: "/dev/mqueue",
45+
Type: "mqueue",
46+
Source: "mqueue",
47+
Options: []string{"nosuid", "noexec"},
48+
},
49+
{
50+
Destination: "/dev/shm",
51+
Type: "tmpfs",
52+
Source: "shm",
53+
Options: []string{"nosuid", "noexec", "mode=1777"},
54+
},
55+
}
56+
}

oci/spec_freebsd.go

Lines changed: 0 additions & 40 deletions
This file was deleted.

oci/spec_linux.go

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)