diff --git a/Makefile.OS b/Makefile.OS index 09a1e770d..6a5fe010a 100644 --- a/Makefile.OS +++ b/Makefile.OS @@ -13,7 +13,4 @@ else ifeq ($(UNAME_S),FreeBSD) target_os = freebsd endif - ifeq ($(UNAME_S),SunOS) - target_os = solaris - endif endif diff --git a/Makefile.solaris b/Makefile.solaris deleted file mode 100644 index bfdfda022..000000000 --- a/Makefile.solaris +++ /dev/null @@ -1,6 +0,0 @@ -#solaris specific settings - -# on SunOS default to gnu utilities for things like grep, sed, etc. -export PATH := /usr/gnu/bin:$(PATH) - -COMMANDS += containerd-shim diff --git a/cmd/containerd/config_solaris.go b/cmd/containerd/config_solaris.go deleted file mode 100644 index 15ab7e471..000000000 --- a/cmd/containerd/config_solaris.go +++ /dev/null @@ -1,18 +0,0 @@ -// +build solaris - -package main - -import "github.com/containerd/containerd/server" - -func defaultConfig() *server.Config { - return &server.Config{ - Root: "/var/lib/containerd", - GRPC: server.GRPCConfig{ - Address: server.DefaultAddress, - }, - Debug: server.Debug{ - Level: "info", - Address: server.DefaultDebugAddress, - }, - } -} diff --git a/mount/mount_solaris.go b/mount/mount_solaris.go deleted file mode 100644 index 3b6c35d74..000000000 --- a/mount/mount_solaris.go +++ /dev/null @@ -1,83 +0,0 @@ -package mount - -// On Solaris we can't invoke the mount system call directly. First, -// the mount system call takes more than 6 arguments, and go doesn't -// support invoking system calls that take more than 6 arguments. Past -// that, the mount system call is a private interfaces. For example, -// the arguments and data structures passed to the kernel to create an -// nfs mount are private and can change at any time. The only public -// and stable interface for creating mounts on Solaris is the mount.8 -// command, so we'll invoke that here. - -import ( - "bytes" - "errors" - "fmt" - "os/exec" - "strings" - - "golang.org/x/sys/unix" -) - -const ( - mountCmd = "/usr/sbin/mount" -) - -func doMount(arg ...string) error { - cmd := exec.Command(mountCmd, arg...) - - /* Setup Stdin, Stdout, and Stderr */ - stderr := new(bytes.Buffer) - cmd.Stdin = nil - cmd.Stdout = nil - cmd.Stderr = stderr - - /* - * Run the command. If the command fails create a new error - * object to return that includes stderr output. - */ - err := cmd.Start() - if err != nil { - return err - } - err = cmd.Wait() - if err != nil { - return errors.New(fmt.Sprintf("%v: %s", err, stderr.String())) - } - return nil -} - -func (m *Mount) Mount(target string) error { - var err error - - if len(m.Options) == 0 { - err = doMount("-F", m.Type, m.Source, target) - } else { - err = doMount("-F", m.Type, "-o", strings.Join(m.Options, ","), - m.Source, target) - } - return err -} - -func Unmount(mount string, flags int) error { - return unix.Unmount(mount, flags) -} - -// UnmountAll repeatedly unmounts the given mount point until there -// are no mounts remaining (EINVAL is returned by mount), which is -// useful for undoing a stack of mounts on the same mount point. -func UnmountAll(mount string, flags int) error { - for { - if err := Unmount(mount, flags); err != nil { - // EINVAL is returned if the target is not a - // mount point, indicating that we are - // done. It can also indicate a few other - // things (such as invalid flags) which we - // unfortunately end up squelching here too. - if err == unix.EINVAL { - return nil - } - return err - } - } -} diff --git a/mount/mountinfo_solaris.go b/mount/mountinfo_solaris.go deleted file mode 100644 index aaafad36a..000000000 --- a/mount/mountinfo_solaris.go +++ /dev/null @@ -1,50 +0,0 @@ -// +build solaris,cgo - -package mount - -/* -#include -#include -#include -*/ -import "C" - -import ( - "fmt" - "unsafe" -) - -// Self retrieves a list of mounts for the current running process. -func Self() ([]Info, error) { - path := C.CString(C.MNTTAB) - defer C.free(unsafe.Pointer(path)) - mode := C.CString("r") - defer C.free(unsafe.Pointer(mode)) - - mnttab := C.fopen(path, mode) - if mnttab == nil { - return nil, fmt.Errorf("Failed to open %s", C.MNTTAB) - } - - var out []Info - var mp C.struct_mnttab - - ret := C.getmntent(mnttab, &mp) - for ret == 0 { - var mountinfo Info - mountinfo.Mountpoint = C.GoString(mp.mnt_mountp) - mountinfo.Source = C.GoString(mp.mnt_special) - mountinfo.FSType = C.GoString(mp.mnt_fstype) - mountinfo.Options = C.GoString(mp.mnt_mntopts) - out = append(out, mountinfo) - ret = C.getmntent(mnttab, &mp) - } - - C.fclose(mnttab) - return out, nil -} - -// PID collects the mounts for a specific process ID. -func PID(pid int) ([]Info, error) { - return nil, fmt.Errorf("mountinfo.PID is not implemented on solaris") -} diff --git a/sys/prctl_solaris.go b/sys/prctl_solaris.go deleted file mode 100644 index 9443f14db..000000000 --- a/sys/prctl_solaris.go +++ /dev/null @@ -1,19 +0,0 @@ -// +build solaris - -package sys - -import ( - "errors" -) - -//Solaris TODO - -// GetSubreaper returns the subreaper setting for the calling process -func GetSubreaper() (int, error) { - return 0, errors.New("osutils GetSubreaper not implemented on Solaris") -} - -// SetSubreaper sets the value i as the subreaper setting for the calling process -func SetSubreaper(i int) error { - return errors.New("osutils SetSubreaper not implemented on Solaris") -}