diff --git a/.circleci/config.yml b/.circleci/config.yml index b65fcfc5..c4624885 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ defaults: &defaults docker: - - image: circleci/golang:1.10 + - image: circleci/golang:1.11 working_directory: /go/src/github.com/ernoaapa/eliot version: 2 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 29f43c1f..399d89a0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: golang:1.10-stretch +image: golang:1.11-stretch variables: REPO_NAME: github.com/ernoaapa/eliot @@ -25,7 +25,8 @@ build: - arm64 script: - ./build/install-build-tools.sh - - goreleaser --snapshot + - mkdir $(pwd)/.tmp + - TMPDIR="$(pwd)/.tmp" goreleaser --snapshot artifacts: paths: - dist/ diff --git a/.goreleaser.yml b/.goreleaser.yml index 226c2202..910d6f73 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -77,7 +77,7 @@ nfpm: - deb dependencies: - - containerd (>= 1.1.0) + - containerd (>= 1.1.3) files: "build/etc/systemd/system/eliotd.service": "/etc/systemd/system/eliotd.service" diff --git a/README.md b/README.md index e43b750f..590237b1 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Eliot is built from following components ### Prerequisites - [Install Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) -- [Install Golang 1.10](https://golang.org/doc/install) +- [Install Golang 1.11](https://golang.org/doc/install) - [Install Docker](https://docs.docker.com/install/) - [Install Linuxkit](https://github.com/linuxkit/linuxkit#build-the-linuxkit-tool) - [Install goreleaser](https://goreleaser.com/#introduction.installing_goreleaser) (for building `eliotd`) diff --git a/cmd/utils.go b/cmd/utils.go index 1afa8aad..ee93239a 100644 --- a/cmd/utils.go +++ b/cmd/utils.go @@ -194,8 +194,8 @@ func GetRuntimeClient(clicontext *cli.Context, hostname string) runtime.Client { return runtime.NewContainerdClient( context.Background(), clicontext.GlobalDuration("timeout"), - clicontext.GlobalString("containerd"), clicontext.String("containerd-snapshotter"), + clicontext.GlobalString("containerd"), hostname, ) } diff --git a/deps/build-containerd.sh b/deps/build-containerd.sh index 1c7adb32..924c81c9 100755 --- a/deps/build-containerd.sh +++ b/deps/build-containerd.sh @@ -4,7 +4,7 @@ set -eu -CONTAINERD_VERSION="v1.1.0" +CONTAINERD_VERSION="v1.1.3" RUNC_DEP_VERSION="1.0.0-rc4+a618ab5a" BUILD_DIR=/tmp/build ELIOT_SRC_DIR=$(pwd) diff --git a/docs/README.md b/docs/README.md index 8cf936a4..96fb099b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,5 +1,5 @@ ```description -Eliot is, Kubernetes and Docker inspired, a open source system for managing containerized applications on top of the IoT device with an emphasis to usability, simplicity, security and stability. +Eliot is lightweight Kubernetes like system to manage containerized applications on IoT devices with an emphasis on simplicity, minimalicity and usability ``` ```keywords IoT,container,Kubernetes,Docker,Eliot,containerd,runc,linuxkit,connected devices,devops,security @@ -8,9 +8,9 @@ IoT,container,Kubernetes,Docker,Eliot,containerd,runc,linuxkit,connected devices ![Eliot](https://raw.githubusercontent.com/ernoaapa/eliot/master/docs/eliot-logo-medium.png) > This is early alpha version! There are not all features yet implemented, not heavily tested with different devices and code might get large breaking changes until the first release. -[Eliot](https://github.com/ernoaapa/eliot) is an open source system for managing containerized applications on top of the IoT device with an emphasis on usability, simplicity, security, and stability. Eliot gives simplified app delivery, isolation and additional security to traditional installations. +[Eliot](https://github.com/ernoaapa/eliot) is lightweight Kubernetes like system to manage containerized applications on IoT devices with an emphasis on simplicity, minimality, and usability. The goal is to give a simple way to develop, deploy and manage applications running in IoT device. Comparing to other traditional platforms, Eliot takes modern technologies from cloud to enable more DevOps way of working in IoT world. -[Docker](https://www.docker.com) and [Kubernetes](https://www.kubernetes.io) have inspired heavily and if you're familiar with those, you find really easy to get started with Eliot. +Eliot re-uses technologies and concepts from [Docker](https://www.docker.com) and [Kubernetes](https://www.kubernetes.io). So if you're familiar with those, you find really easy to get started with Eliot. ## See it in action! !INCLUDE "asciinema-demo.html" diff --git a/docs/introduction.md b/docs/introduction.md index 75149c53..0b6bd214 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -1,21 +1,20 @@ # Who? -[Eliot](https://github.com/ernoaapa/eliot) is an open source system for managing containerized applications on top of the IoT device with an emphasis on usability, simplicity, and security. Eliot gives simplified app deployment, isolation and additional security to connected device solutions. +[Eliot](https://github.com/ernoaapa/eliot) is lightweight Kubernetes like system to manage containerized applications on IoT devices with an emphasis on simplicity, minimality, and usability. The goal is to give a simple way to develop, deploy and manage applications running in IoT device. Comparing to other traditional platforms, Eliot takes modern technologies from cloud to enable more DevOps way of working in IoT world. -In consideration of connected device limitations like unstable connection, limited computing resources, hardware connectivity, Eliot connects devices to single easy to use platform where you can manage devices and applications easily and safely. - -[Cloud Native technologies](https://www.cncf.io/), like [Docker](https://www.docker.com) and [Kubernetes](https://www.kubernetes.io), have inspired heavily and if you're familiar with those, you find really easy to get started with Eliot. +Eliot re-uses technologies and concepts from [Cloud Native technologies](https://www.cncf.io/), like [Docker](https://www.docker.com) and [Kubernetes](https://www.kubernetes.io). So if you're familiar with those, you find really easy to get started with Eliot. ## Motivation -I was building modern connected device product what users are located around the world. +I was building modern connected device product what were distributed around the world. I have over 10 years of software engineer experience with five years of DevOps and faced the problem that there's no state-of-the-art solution for managing connected devices a way that is common nowadays in cloud solutions. Most platforms and services focus heavily to the cloud connectivity, data processing, and analysis, but I needed a solution to manage device Operating System and application deployment to build easy to use, modern service for our customers. Key features needed: -- Quick realtime in-device development -- Simple and fast application deployment +- No network connectivity requirement +- Simple in-device development +- Fast application deployment - Over-The-Air device management - Resource allocation and restriction - Security and software isolation @@ -26,13 +25,13 @@ And that's the day when [Eliot](https://github.com/ernoaapa/eliot) were born ❤ ## Use cases Eliot has a small footprint and minimal requirements why it's suitable for a wide range or use cases. -Linux is used nowadays everywhere; info screens, sensors, factories, home IoT, security, cars, etc. and Eliot can support most of them as long as there are enough resources and new enough Linux kernel. Thanks to Golang, there's releases available to wide range of architectures. +Linux is used nowadays everywhere; info screens, sensors, factories, home IoT, security, cars, etc. and Eliot can support most of them. And thanks to Golang, there's releases available to wide range of architectures. ## Eliot vs. Other ### Docker -[Docker](https://www.docker.com) is a software technology providing containers, promoted by the company [Docker, Inc.](http://www.docker.com/company), and provides full-blown container platform for the cloud environment, taking care of container distribution, orchestration, authentication, infrastructure, etc. Docker has been playing a big role pushing out the container technology. +[Docker](https://www.docker.com) is a software technology providing containers, promoted by the company [Docker, Inc.](http://www.docker.com/company), and provides full-blown container platform for the cloud environment, taking care of container distribution, orchestration, authentication, infrastructure, etc. Docker has been playing a big role in pushing out the container technology. At the heart ❤︎ of Docker is [containerd](https://containerd.io), which provides an additional layer of abstraction and automation of operating-system-level virtualization on Windows and Linux. Docker extracted and open sourced to accelerate the innovation across the ecosystem and donated it to open foundation. _And Eliot is based on the containerd!_ @@ -40,17 +39,16 @@ Eliot and Docker are not competing against each other; they are working together ### Kubernetes -[Kubernetes](https://www.kubernetes.io) is a great platform for orchestrating containerized software in the cloud environment. Kubernetes have been one of the fastest growing open source project in past years and new integrations and 3rd party support are popping out every day. +[Kubernetes](https://www.kubernetes.io) is a great platform for orchestrating containerized software in the cloud environment. Kubernetes have been one of the fastest growing open source projects in past years and new integrations and 3rd party support are popping out every day. -Keys to Kubernetes great success, addition to the great community, are simple concepts and consistent APIs. -That's why Eliot is following the great leader and picks many great concepts that work in IoT domain and implements them the same way! +Keys to Kubernetes great success, addition to the great community, are simple concepts and consistent APIs. That's why Eliot is following the great leader. Goal is to re-use Kubernetes code as much as possible, but at the same time keep focus tightly in IoT limitations and requirements. Kubernetes is pushing the boundaries of cloud computing and Eliot is working on in IoT. ### AWS, Azure, Google, IBM All cloud IoT solutions ([AWS](https://aws.amazon.com/iot/), [Azure](https://azure.microsoft.com/en-us/suites/iot-suite/), [Google](https://cloud.google.com/solutions/iot/), [IBM](https://www.ibm.com/internet-of-things)) base to the same practice, you use SDK to implement software that collects data from the sensor and send it to the cloud where data gets processed and analyzed. Analysis result can send a message back to the device to trigger some action. Eliot doesn't try to provide this kind of features at all, actually, you can use any cloud service with Eliot. -Eliot provides an easy way to deliver your cloud integration to the device and gives you a way to update the software across thousands of devices safely and easily. +Eliot provides an easy way to deliver your cloud integration to the device and gives you a way to update the software safely and easily. Even better, might be that you don't need to code anything! There might be available open source implementation made by someone in Docker community or you can share your code with the thousands of Docker users around the world with a single command. diff --git a/pkg/api/server.go b/pkg/api/server.go index 2f86816b..e8f24f4d 100644 --- a/pkg/api/server.go +++ b/pkg/api/server.go @@ -221,7 +221,7 @@ func (s *Server) Exec(server containers.Containers_ExecServer) error { return fmt.Errorf("You must define 'args' metadata") } - log.Debugf("Execute command [%s](tty: %s) in container [%s] in namespace [%s]", strings.Join(args, " "), tty, containerID, namespace) + log.Debugf("Execute command [%s](tty: %t) in container [%s] in namespace [%s]", strings.Join(args, " "), tty, containerID, namespace) return s.client.Exec( namespace, containerID, diff --git a/vendor.conf b/vendor.conf index 28f48e77..5d589a50 100644 --- a/vendor.conf +++ b/vendor.conf @@ -3,7 +3,7 @@ github.com/urfave/cli 7bc6a0acffa589f415f88aca16cc1de5ffd66f9c github.com/stretchr/testify v1.1.4 github.com/davecgh/go-spew v1.1.0 github.com/pmezard/go-difflib v1.0.0 -github.com/containerd/containerd v1.1.0 +github.com/containerd/containerd v1.1.3 github.com/sirupsen/logrus v1.0.3 golang.org/x/crypto 49796115aa4b964c318aad4f3084fdb41e9aa067 golang.org/x/sys 314a259e304ff91bd6985da2a7149bbf91237993 https://github.com/golang/sys @@ -21,7 +21,7 @@ google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944 golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4 github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9 golang.org/x/sync 450f422ab23cf9881c94e2db30cac0eb1b7cf80c -github.com/containerd/continuity 3e8f2ea4b190484acb976a5b378d373429639a1a +github.com/containerd/continuity a60600ad77f38aaa70165825f61e2ea72e51c9b1 gopkg.in/go-playground/validator.v9 v9.9.4 github.com/go-playground/universal-translator v0.16.0 github.com/go-playground/locales v0.11.2 diff --git a/vendor/github.com/containerd/containerd/cio/io.go b/vendor/github.com/containerd/containerd/cio/io.go index a49c1173..100efa52 100644 --- a/vendor/github.com/containerd/containerd/cio/io.go +++ b/vendor/github.com/containerd/containerd/cio/io.go @@ -213,3 +213,14 @@ type DirectIO struct { } var _ IO = &DirectIO{} + +// Load the io for a container but do not attach +// +// Allows io to be loaded on the task for deletion without +// starting copy routines +func Load(set *FIFOSet) (IO, error) { + return &cio{ + config: set.Config, + closers: []io.Closer{set}, + }, nil +} diff --git a/vendor/github.com/containerd/containerd/client.go b/vendor/github.com/containerd/containerd/client.go index c8e0b4a6..132265e6 100644 --- a/vendor/github.com/containerd/containerd/client.go +++ b/vendor/github.com/containerd/containerd/client.go @@ -367,7 +367,7 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpt) (Image } if pullCtx.Unpack { if err := img.Unpack(ctx, pullCtx.Snapshotter); err != nil { - errors.Wrapf(err, "failed to unpack image on snapshotter %s", pullCtx.Snapshotter) + return nil, errors.Wrapf(err, "failed to unpack image on snapshotter %s", pullCtx.Snapshotter) } } return img, nil diff --git a/vendor/github.com/containerd/containerd/container.go b/vendor/github.com/containerd/containerd/container.go index 895e793a..5f381f48 100644 --- a/vendor/github.com/containerd/containerd/container.go +++ b/vendor/github.com/containerd/containerd/container.go @@ -307,6 +307,12 @@ func (c *container) get(ctx context.Context) (containers.Container, error) { // get the existing fifo paths from the task information stored by the daemon func attachExistingIO(response *tasks.GetResponse, ioAttach cio.Attach) (cio.IO, error) { + fifoSet := loadFifos(response) + return ioAttach(fifoSet) +} + +// loadFifos loads the containers fifos +func loadFifos(response *tasks.GetResponse) *cio.FIFOSet { path := getFifoDir([]string{ response.Process.Stdin, response.Process.Stdout, @@ -315,13 +321,12 @@ func attachExistingIO(response *tasks.GetResponse, ioAttach cio.Attach) (cio.IO, closer := func() error { return os.RemoveAll(path) } - fifoSet := cio.NewFIFOSet(cio.Config{ + return cio.NewFIFOSet(cio.Config{ Stdin: response.Process.Stdin, Stdout: response.Process.Stdout, Stderr: response.Process.Stderr, Terminal: response.Process.Terminal, }, closer) - return ioAttach(fifoSet) } // getFifoDir looks for any non-empty path for a stdio fifo diff --git a/vendor/github.com/containerd/containerd/oci/spec_opts_unix.go b/vendor/github.com/containerd/containerd/oci/spec_opts_unix.go index 46053aa5..62f3054f 100644 --- a/vendor/github.com/containerd/containerd/oci/spec_opts_unix.go +++ b/vendor/github.com/containerd/containerd/oci/spec_opts_unix.go @@ -348,8 +348,8 @@ func WithUIDGID(uid, gid uint32) SpecOpts { // WithUserID sets the correct UID and GID for the container based // on the image's /etc/passwd contents. If /etc/passwd does not exist, -// or uid is not found in /etc/passwd, it sets gid to be the same with -// uid, and not returns error. +// or uid is not found in /etc/passwd, it sets the requested uid, +// additionally sets the gid to 0, and does not return an error. func WithUserID(uid uint32) SpecOpts { return func(ctx context.Context, client Client, c *containers.Container, s *specs.Spec) (err error) { setProcess(s) @@ -362,7 +362,7 @@ func WithUserID(uid uint32) SpecOpts { }) if err != nil { if os.IsNotExist(err) || err == errNoUsersFound { - s.Process.User.UID, s.Process.User.GID = uid, uid + s.Process.User.UID, s.Process.User.GID = uid, 0 return nil } return err @@ -388,7 +388,7 @@ func WithUserID(uid uint32) SpecOpts { }) if err != nil { if os.IsNotExist(err) || err == errNoUsersFound { - s.Process.User.UID, s.Process.User.GID = uid, uid + s.Process.User.UID, s.Process.User.GID = uid, 0 return nil } return err diff --git a/vendor/github.com/containerd/containerd/oci/spec_unix.go b/vendor/github.com/containerd/containerd/oci/spec_unix.go index e52e4222..d75c3d41 100644 --- a/vendor/github.com/containerd/containerd/oci/spec_unix.go +++ b/vendor/github.com/containerd/containerd/oci/spec_unix.go @@ -153,7 +153,9 @@ func createDefaultSpec(ctx context.Context, id string) (*specs.Spec, error) { }, Linux: &specs.Linux{ MaskedPaths: []string{ + "/proc/acpi", "/proc/kcore", + "/proc/keys", "/proc/latency_stats", "/proc/timer_list", "/proc/timer_stats", diff --git a/vendor/github.com/containerd/containerd/platforms/database.go b/vendor/github.com/containerd/containerd/platforms/database.go index df9cc239..8e85448e 100644 --- a/vendor/github.com/containerd/containerd/platforms/database.go +++ b/vendor/github.com/containerd/containerd/platforms/database.go @@ -89,18 +89,21 @@ func normalizeArch(arch, variant string) (string, string) { case "x86_64", "x86-64": arch = "amd64" variant = "" - case "aarch64": + case "aarch64", "arm64": arch = "arm64" - variant = "" // v8 is implied + switch variant { + case "8", "v8": + variant = "" + } case "armhf": arch = "arm" - variant = "" + variant = "v7" case "armel": arch = "arm" variant = "v6" case "arm": switch variant { - case "v7", "7": + case "", "7": variant = "v7" case "5", "6", "8": variant = "v" + variant diff --git a/vendor/github.com/containerd/containerd/platforms/platforms.go b/vendor/github.com/containerd/containerd/platforms/platforms.go index 1f91ed28..29b7ad6b 100644 --- a/vendor/github.com/containerd/containerd/platforms/platforms.go +++ b/vendor/github.com/containerd/containerd/platforms/platforms.go @@ -135,7 +135,7 @@ type Matcher interface { // Applications should opt to use `Match` over directly parsing specifiers. func NewMatcher(platform specs.Platform) Matcher { return &matcher{ - Platform: platform, + Platform: Normalize(platform), } } @@ -197,6 +197,9 @@ func Parse(specifier string) (specs.Platform, error) { } p.Architecture, p.Variant = normalizeArch(parts[0], "") + if p.Architecture == "arm" && p.Variant == "v7" { + p.Variant = "" + } if isKnownArch(p.Architecture) { p.OS = runtime.GOOS return p, nil @@ -208,12 +211,18 @@ func Parse(specifier string) (specs.Platform, error) { // about whether or not we know of the platform. p.OS = normalizeOS(parts[0]) p.Architecture, p.Variant = normalizeArch(parts[1], "") + if p.Architecture == "arm" && p.Variant == "v7" { + p.Variant = "" + } return p, nil case 3: // we have a fully specified variant, this is rare p.OS = normalizeOS(parts[0]) p.Architecture, p.Variant = normalizeArch(parts[1], parts[2]) + if p.Architecture == "arm64" && p.Variant == "" { + p.Variant = "v8" + } return p, nil } diff --git a/vendor/github.com/containerd/containerd/remotes/docker/fetcher.go b/vendor/github.com/containerd/containerd/remotes/docker/fetcher.go index 51e605e1..1509e696 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/fetcher.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/fetcher.go @@ -20,6 +20,7 @@ import ( "context" "fmt" "io" + "io/ioutil" "net/http" "path" "strings" @@ -84,8 +85,9 @@ func (r dockerFetcher) open(ctx context.Context, u, mediatype string, offset int req.Header.Set("Accept", strings.Join([]string{mediatype, `*`}, ", ")) if offset > 0 { - // TODO(stevvooe): Only set this header in response to the - // "Accept-Ranges: bytes" header. + // Note: "Accept-Ranges: bytes" cannot be trusted as some endpoints + // will return the header without supporting the range. The content + // range must always be checked. req.Header.Set("Range", fmt.Sprintf("bytes=%d-", offset)) } @@ -106,6 +108,30 @@ func (r dockerFetcher) open(ctx context.Context, u, mediatype string, offset int } return nil, errors.Errorf("unexpected status code %v: %v", u, resp.Status) } + if offset > 0 { + cr := resp.Header.Get("content-range") + if cr != "" { + if !strings.HasPrefix(cr, fmt.Sprintf("bytes %d-", offset)) { + return nil, errors.Errorf("unhandled content range in response: %v", cr) + + } + } else { + // TODO: Should any cases where use of content range + // without the proper header be considerd? + // 206 responses? + + // Discard up to offset + // Could use buffer pool here but this case should be rare + n, err := io.Copy(ioutil.Discard, io.LimitReader(resp.Body, offset)) + if err != nil { + return nil, errors.Wrap(err, "failed to discard to offset") + } + if n != offset { + return nil, errors.Errorf("unable to discard to offset") + } + + } + } return resp.Body, nil } diff --git a/vendor/github.com/containerd/containerd/vendor.conf b/vendor/github.com/containerd/containerd/vendor.conf index 708b467e..18f1a92d 100644 --- a/vendor/github.com/containerd/containerd/vendor.conf +++ b/vendor/github.com/containerd/containerd/vendor.conf @@ -1,10 +1,10 @@ github.com/containerd/go-runc bcb223a061a3dd7de1a89c0b402a60f4dd9bd307 -github.com/containerd/console cb7008ab3d8359b78c5f464cb7cf160107ad5925 +github.com/containerd/console 4d8a41f4ce5b9bae77c41786ea2458330f43f081 github.com/containerd/cgroups fe281dd265766145e943a034aa41086474ea6130 github.com/containerd/typeurl f6943554a7e7e88b3c14aad190bf05932da84788 github.com/containerd/fifo 3d5202aec260678c48179c56f40e6f38a095738c github.com/containerd/btrfs 2e1aa0ddf94f91fa282b6ed87c23bf0d64911244 -github.com/containerd/continuity 3e8f2ea4b190484acb976a5b378d373429639a1a +github.com/containerd/continuity a60600ad77f38aaa70165825f61e2ea72e51c9b1 github.com/coreos/go-systemd 48702e0da86bd25e76cfef347e2adeb434a0d0a6 github.com/docker/go-metrics 4ea375f7759c82740c893fc030bc37088d2ec098 github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9 @@ -44,7 +44,7 @@ github.com/gotestyourself/gotestyourself 44dbf532bbf5767611f6f2a61bded572e337010 github.com/google/go-cmp v0.1.0 # cri dependencies -github.com/containerd/cri v1.0.0 +github.com/containerd/cri v1.0.5 github.com/containerd/go-cni f2d7272f12d045b16ed924f50e91f9f9cecc55a7 github.com/blang/semver v3.1.0 github.com/containernetworking/cni v0.6.0 diff --git a/vendor/github.com/containerd/continuity/fs/copy.go b/vendor/github.com/containerd/continuity/fs/copy.go index e8f45281..2ac474b9 100644 --- a/vendor/github.com/containerd/continuity/fs/copy.go +++ b/vendor/github.com/containerd/continuity/fs/copy.go @@ -72,7 +72,7 @@ func copyDirectory(dst, src string, inodes map[uint64]string) error { if err := os.Link(link, target); err != nil { return errors.Wrap(err, "failed to create hard link") } - } else if err := copyFile(source, target); err != nil { + } else if err := CopyFile(target, source); err != nil { return errors.Wrap(err, "failed to copy files") } case (fi.Mode() & os.ModeSymlink) == os.ModeSymlink: @@ -103,7 +103,9 @@ func copyDirectory(dst, src string, inodes map[uint64]string) error { return nil } -func copyFile(source, target string) error { +// CopyFile copies the source file to the target. +// The most efficient means of copying is used for the platform. +func CopyFile(target, source string) error { src, err := os.Open(source) if err != nil { return errors.Wrapf(err, "failed to open source %s", source) diff --git a/vendor/github.com/containerd/continuity/fs/copy_linux.go b/vendor/github.com/containerd/continuity/fs/copy_linux.go index cfab6756..b244e318 100644 --- a/vendor/github.com/containerd/continuity/fs/copy_linux.go +++ b/vendor/github.com/containerd/continuity/fs/copy_linux.go @@ -49,20 +49,26 @@ func copyFileContent(dst, src *os.File) error { return errors.Wrap(err, "unable to stat source") } - n, err := unix.CopyFileRange(int(src.Fd()), nil, int(dst.Fd()), nil, int(st.Size()), 0) - if err != nil { - if err != unix.ENOSYS && err != unix.EXDEV { - return errors.Wrap(err, "copy file range failed") - } + size := st.Size() + first := true + srcFd := int(src.Fd()) + dstFd := int(dst.Fd()) - buf := bufferPool.Get().(*[]byte) - _, err = io.CopyBuffer(dst, src, *buf) - bufferPool.Put(buf) - return err - } + for size > 0 { + n, err := unix.CopyFileRange(srcFd, nil, dstFd, nil, int(size), 0) + if err != nil { + if (err != unix.ENOSYS && err != unix.EXDEV) || !first { + return errors.Wrap(err, "copy file range failed") + } + + buf := bufferPool.Get().(*[]byte) + _, err = io.CopyBuffer(dst, src, *buf) + bufferPool.Put(buf) + return errors.Wrap(err, "userspace copy failed") + } - if int64(n) != st.Size() { - return errors.Wrapf(err, "short copy: %d of %d", int64(n), st.Size()) + first = false + size -= int64(n) } return nil diff --git a/vendor/github.com/containerd/continuity/sysx/xattr_linux.go b/vendor/github.com/containerd/continuity/sysx/xattr_linux.go index cd181363..311b896d 100644 --- a/vendor/github.com/containerd/continuity/sysx/xattr_linux.go +++ b/vendor/github.com/containerd/continuity/sysx/xattr_linux.go @@ -1,61 +1,44 @@ package sysx -import "syscall" - -// These functions will be generated by generate.sh -// $ GOOS=linux GOARCH=386 ./generate.sh xattr -// $ GOOS=linux GOARCH=amd64 ./generate.sh xattr -// $ GOOS=linux GOARCH=arm ./generate.sh xattr -// $ GOOS=linux GOARCH=arm64 ./generate.sh xattr -// $ GOOS=linux GOARCH=ppc64 ./generate.sh xattr -// $ GOOS=linux GOARCH=ppc64le ./generate.sh xattr -// $ GOOS=linux GOARCH=s390x ./generate.sh xattr +import "golang.org/x/sys/unix" // Listxattr calls syscall listxattr and reads all content // and returns a string array func Listxattr(path string) ([]string, error) { - return listxattrAll(path, syscall.Listxattr) + return listxattrAll(path, unix.Listxattr) } // Removexattr calls syscall removexattr func Removexattr(path string, attr string) (err error) { - return syscall.Removexattr(path, attr) + return unix.Removexattr(path, attr) } // Setxattr calls syscall setxattr func Setxattr(path string, attr string, data []byte, flags int) (err error) { - return syscall.Setxattr(path, attr, data, flags) + return unix.Setxattr(path, attr, data, flags) } // Getxattr calls syscall getxattr func Getxattr(path, attr string) ([]byte, error) { - return getxattrAll(path, attr, syscall.Getxattr) + return getxattrAll(path, attr, unix.Getxattr) } -//sys llistxattr(path string, dest []byte) (sz int, err error) - // LListxattr lists xattrs, not following symlinks func LListxattr(path string) ([]string, error) { - return listxattrAll(path, llistxattr) + return listxattrAll(path, unix.Llistxattr) } -//sys lremovexattr(path string, attr string) (err error) - // LRemovexattr removes an xattr, not following symlinks func LRemovexattr(path string, attr string) (err error) { - return lremovexattr(path, attr) + return unix.Lremovexattr(path, attr) } -//sys lsetxattr(path string, attr string, data []byte, flags int) (err error) - // LSetxattr sets an xattr, not following symlinks func LSetxattr(path string, attr string, data []byte, flags int) (err error) { - return lsetxattr(path, attr, data, flags) + return unix.Lsetxattr(path, attr, data, flags) } -//sys lgetxattr(path string, attr string, dest []byte) (sz int, err error) - // LGetxattr gets an xattr, not following symlinks func LGetxattr(path, attr string) ([]byte, error) { - return getxattrAll(path, attr, lgetxattr) + return getxattrAll(path, attr, unix.Lgetxattr) } diff --git a/vendor/github.com/containerd/continuity/sysx/xattr_linux_386.go b/vendor/github.com/containerd/continuity/sysx/xattr_linux_386.go deleted file mode 100644 index c3e5c8e3..00000000 --- a/vendor/github.com/containerd/continuity/sysx/xattr_linux_386.go +++ /dev/null @@ -1,111 +0,0 @@ -// mksyscall.pl -l32 xattr_linux.go -// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT - -package sysx - -import ( - "syscall" - "unsafe" -) - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func llistxattr(path string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(dest) > 0 { - _p1 = unsafe.Pointer(&dest[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall.Syscall(syscall.SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) - sz = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lremovexattr(path string, attr string) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - _, _, e1 := syscall.Syscall(syscall.SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lsetxattr(path string, attr string, data []byte, flags int) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(data) > 0 { - _p2 = unsafe.Pointer(&data[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - _, _, e1 := syscall.Syscall6(syscall.SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lgetxattr(path string, attr string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(dest) > 0 { - _p2 = unsafe.Pointer(&dest[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall.Syscall6(syscall.SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - sz = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} diff --git a/vendor/github.com/containerd/continuity/sysx/xattr_linux_amd64.go b/vendor/github.com/containerd/continuity/sysx/xattr_linux_amd64.go deleted file mode 100644 index dec46faa..00000000 --- a/vendor/github.com/containerd/continuity/sysx/xattr_linux_amd64.go +++ /dev/null @@ -1,111 +0,0 @@ -// mksyscall.pl xattr_linux.go -// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT - -package sysx - -import ( - "syscall" - "unsafe" -) - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func llistxattr(path string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(dest) > 0 { - _p1 = unsafe.Pointer(&dest[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall.Syscall(syscall.SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) - sz = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lremovexattr(path string, attr string) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - _, _, e1 := syscall.Syscall(syscall.SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lsetxattr(path string, attr string, data []byte, flags int) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(data) > 0 { - _p2 = unsafe.Pointer(&data[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - _, _, e1 := syscall.Syscall6(syscall.SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lgetxattr(path string, attr string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(dest) > 0 { - _p2 = unsafe.Pointer(&dest[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall.Syscall6(syscall.SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - sz = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} diff --git a/vendor/github.com/containerd/continuity/sysx/xattr_linux_arm.go b/vendor/github.com/containerd/continuity/sysx/xattr_linux_arm.go deleted file mode 100644 index c3e5c8e3..00000000 --- a/vendor/github.com/containerd/continuity/sysx/xattr_linux_arm.go +++ /dev/null @@ -1,111 +0,0 @@ -// mksyscall.pl -l32 xattr_linux.go -// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT - -package sysx - -import ( - "syscall" - "unsafe" -) - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func llistxattr(path string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(dest) > 0 { - _p1 = unsafe.Pointer(&dest[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall.Syscall(syscall.SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) - sz = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lremovexattr(path string, attr string) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - _, _, e1 := syscall.Syscall(syscall.SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lsetxattr(path string, attr string, data []byte, flags int) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(data) > 0 { - _p2 = unsafe.Pointer(&data[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - _, _, e1 := syscall.Syscall6(syscall.SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lgetxattr(path string, attr string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(dest) > 0 { - _p2 = unsafe.Pointer(&dest[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall.Syscall6(syscall.SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - sz = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} diff --git a/vendor/github.com/containerd/continuity/sysx/xattr_linux_arm64.go b/vendor/github.com/containerd/continuity/sysx/xattr_linux_arm64.go deleted file mode 100644 index dec46faa..00000000 --- a/vendor/github.com/containerd/continuity/sysx/xattr_linux_arm64.go +++ /dev/null @@ -1,111 +0,0 @@ -// mksyscall.pl xattr_linux.go -// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT - -package sysx - -import ( - "syscall" - "unsafe" -) - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func llistxattr(path string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(dest) > 0 { - _p1 = unsafe.Pointer(&dest[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall.Syscall(syscall.SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) - sz = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lremovexattr(path string, attr string) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - _, _, e1 := syscall.Syscall(syscall.SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lsetxattr(path string, attr string, data []byte, flags int) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(data) > 0 { - _p2 = unsafe.Pointer(&data[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - _, _, e1 := syscall.Syscall6(syscall.SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lgetxattr(path string, attr string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(dest) > 0 { - _p2 = unsafe.Pointer(&dest[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall.Syscall6(syscall.SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - sz = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} diff --git a/vendor/github.com/containerd/continuity/sysx/xattr_linux_ppc64.go b/vendor/github.com/containerd/continuity/sysx/xattr_linux_ppc64.go deleted file mode 100644 index dec46faa..00000000 --- a/vendor/github.com/containerd/continuity/sysx/xattr_linux_ppc64.go +++ /dev/null @@ -1,111 +0,0 @@ -// mksyscall.pl xattr_linux.go -// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT - -package sysx - -import ( - "syscall" - "unsafe" -) - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func llistxattr(path string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(dest) > 0 { - _p1 = unsafe.Pointer(&dest[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall.Syscall(syscall.SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) - sz = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lremovexattr(path string, attr string) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - _, _, e1 := syscall.Syscall(syscall.SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lsetxattr(path string, attr string, data []byte, flags int) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(data) > 0 { - _p2 = unsafe.Pointer(&data[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - _, _, e1 := syscall.Syscall6(syscall.SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lgetxattr(path string, attr string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(dest) > 0 { - _p2 = unsafe.Pointer(&dest[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall.Syscall6(syscall.SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - sz = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} diff --git a/vendor/github.com/containerd/continuity/sysx/xattr_linux_ppc64le.go b/vendor/github.com/containerd/continuity/sysx/xattr_linux_ppc64le.go deleted file mode 100644 index dec46faa..00000000 --- a/vendor/github.com/containerd/continuity/sysx/xattr_linux_ppc64le.go +++ /dev/null @@ -1,111 +0,0 @@ -// mksyscall.pl xattr_linux.go -// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT - -package sysx - -import ( - "syscall" - "unsafe" -) - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func llistxattr(path string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(dest) > 0 { - _p1 = unsafe.Pointer(&dest[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall.Syscall(syscall.SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) - sz = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lremovexattr(path string, attr string) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - _, _, e1 := syscall.Syscall(syscall.SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lsetxattr(path string, attr string, data []byte, flags int) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(data) > 0 { - _p2 = unsafe.Pointer(&data[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - _, _, e1 := syscall.Syscall6(syscall.SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lgetxattr(path string, attr string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(dest) > 0 { - _p2 = unsafe.Pointer(&dest[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall.Syscall6(syscall.SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - sz = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} diff --git a/vendor/github.com/containerd/continuity/sysx/xattr_linux_s390x.go b/vendor/github.com/containerd/continuity/sysx/xattr_linux_s390x.go deleted file mode 100644 index dec46faa..00000000 --- a/vendor/github.com/containerd/continuity/sysx/xattr_linux_s390x.go +++ /dev/null @@ -1,111 +0,0 @@ -// mksyscall.pl xattr_linux.go -// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT - -package sysx - -import ( - "syscall" - "unsafe" -) - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func llistxattr(path string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 unsafe.Pointer - if len(dest) > 0 { - _p1 = unsafe.Pointer(&dest[0]) - } else { - _p1 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall.Syscall(syscall.SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) - sz = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lremovexattr(path string, attr string) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - _, _, e1 := syscall.Syscall(syscall.SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lsetxattr(path string, attr string, data []byte, flags int) (err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(data) > 0 { - _p2 = unsafe.Pointer(&data[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - _, _, e1 := syscall.Syscall6(syscall.SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func lgetxattr(path string, attr string, dest []byte) (sz int, err error) { - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - var _p1 *byte - _p1, err = syscall.BytePtrFromString(attr) - if err != nil { - return - } - var _p2 unsafe.Pointer - if len(dest) > 0 { - _p2 = unsafe.Pointer(&dest[0]) - } else { - _p2 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall.Syscall6(syscall.SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - sz = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -}