mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to 8effd45b
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
4
vendor/github.com/moby/sys/mount/doc.go
generated
vendored
Normal file
4
vendor/github.com/moby/sys/mount/doc.go
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
// Package mount provides a set of functions to mount and unmount mounts.
|
||||
//
|
||||
// Currently it supports Linux. For historical reasons, there is also some support for FreeBSD.
|
||||
package mount
|
@ -1,28 +1,25 @@
|
||||
// +build freebsd,cgo
|
||||
// +build freebsd openbsd
|
||||
|
||||
package mount
|
||||
|
||||
/*
|
||||
#include <sys/mount.h>
|
||||
*/
|
||||
import "C"
|
||||
import "golang.org/x/sys/unix"
|
||||
|
||||
const (
|
||||
// RDONLY will mount the filesystem as read-only.
|
||||
RDONLY = C.MNT_RDONLY
|
||||
RDONLY = unix.MNT_RDONLY
|
||||
|
||||
// NOSUID will not allow set-user-identifier or set-group-identifier bits to
|
||||
// take effect.
|
||||
NOSUID = C.MNT_NOSUID
|
||||
NOSUID = unix.MNT_NOSUID
|
||||
|
||||
// NOEXEC will not allow execution of any binaries on the mounted file system.
|
||||
NOEXEC = C.MNT_NOEXEC
|
||||
NOEXEC = unix.MNT_NOEXEC
|
||||
|
||||
// SYNCHRONOUS will allow any I/O to the file system to be done synchronously.
|
||||
SYNCHRONOUS = C.MNT_SYNCHRONOUS
|
||||
SYNCHRONOUS = unix.MNT_SYNCHRONOUS
|
||||
|
||||
// NOATIME will not update the file access time when reading from a file.
|
||||
NOATIME = C.MNT_NOATIME
|
||||
NOATIME = unix.MNT_NOATIME
|
||||
)
|
||||
|
||||
// These flags are unsupported.
|
@ -1,3 +1,5 @@
|
||||
// +build !darwin,!windows
|
||||
|
||||
package mount
|
||||
|
||||
import (
|
30
vendor/github.com/moby/sys/mount/flags_unsupported.go
generated
vendored
30
vendor/github.com/moby/sys/mount/flags_unsupported.go
generated
vendored
@ -1,30 +0,0 @@
|
||||
// +build !linux,!freebsd freebsd,!cgo
|
||||
|
||||
package mount
|
||||
|
||||
// These flags are unsupported.
|
||||
const (
|
||||
BIND = 0
|
||||
DIRSYNC = 0
|
||||
MANDLOCK = 0
|
||||
NOATIME = 0
|
||||
NODEV = 0
|
||||
NODIRATIME = 0
|
||||
NOEXEC = 0
|
||||
NOSUID = 0
|
||||
UNBINDABLE = 0
|
||||
RUNBINDABLE = 0
|
||||
PRIVATE = 0
|
||||
RPRIVATE = 0
|
||||
SHARED = 0
|
||||
RSHARED = 0
|
||||
SLAVE = 0
|
||||
RSLAVE = 0
|
||||
RBIND = 0
|
||||
RELATIME = 0
|
||||
REMOUNT = 0
|
||||
STRICTATIME = 0
|
||||
SYNCHRONOUS = 0
|
||||
RDONLY = 0
|
||||
mntDetach = 0
|
||||
)
|
4
vendor/github.com/moby/sys/mount/go.mod
generated
vendored
4
vendor/github.com/moby/sys/mount/go.mod
generated
vendored
@ -3,6 +3,6 @@ module github.com/moby/sys/mount
|
||||
go 1.14
|
||||
|
||||
require (
|
||||
github.com/moby/sys/mountinfo v0.1.0
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae
|
||||
github.com/moby/sys/mountinfo v0.4.0
|
||||
golang.org/x/sys v0.0.0-20200922070232-aee5d888a860
|
||||
)
|
||||
|
9
vendor/github.com/moby/sys/mount/go.sum
generated
vendored
9
vendor/github.com/moby/sys/mount/go.sum
generated
vendored
@ -1,4 +1,5 @@
|
||||
github.com/moby/sys/mountinfo v0.1.0 h1:r8vMRbMAFEAfiNptYVokP+nfxPJzvRuia5e2vzXtENo=
|
||||
github.com/moby/sys/mountinfo v0.1.0/go.mod h1:w2t2Avltqx8vE7gX5l+QiBKxODu2TX0+Syr3h52Tw4o=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
github.com/moby/sys/mountinfo v0.4.0 h1:1KInV3Huv18akCu58V7lzNlt+jFmqlu1EaErnEHE/VM=
|
||||
github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A=
|
||||
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200922070232-aee5d888a860 h1:YEu4SMq7D0cmT7CBbXfcH0NZeuChAXwsHe/9XueUO6o=
|
||||
golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
|
@ -1,4 +1,4 @@
|
||||
// +build go1.13
|
||||
// +build !darwin,!windows
|
||||
|
||||
package mount
|
||||
|
||||
@ -7,6 +7,7 @@ import (
|
||||
"sort"
|
||||
|
||||
"github.com/moby/sys/mountinfo"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// Mount will mount filesystem according to the specified configuration.
|
||||
@ -18,9 +19,22 @@ func Mount(device, target, mType, options string) error {
|
||||
}
|
||||
|
||||
// Unmount lazily unmounts a filesystem on supported platforms, otherwise does
|
||||
// a normal unmount. If target is not a mount point, no error is returned.
|
||||
// a normal unmount. If target is not a mount point, no error is returned.
|
||||
func Unmount(target string) error {
|
||||
return unmount(target, mntDetach)
|
||||
err := unix.Unmount(target, mntDetach)
|
||||
if err == nil || err == unix.EINVAL {
|
||||
// Ignore "not mounted" error here. Note the same error
|
||||
// can be returned if flags are invalid, so this code
|
||||
// assumes that the flags value is always correct.
|
||||
return nil
|
||||
}
|
||||
|
||||
return &mountError{
|
||||
op: "umount",
|
||||
target: target,
|
||||
flags: uintptr(mntDetach),
|
||||
err: err,
|
||||
}
|
||||
}
|
||||
|
||||
// RecursiveUnmount unmounts the target and all mounts underneath, starting
|
||||
@ -32,7 +46,7 @@ func RecursiveUnmount(target string) error {
|
||||
// platforms, if there are submounts, we'll get EBUSY (and fall back
|
||||
// to the slow path). NOTE we do not ignore EINVAL here as target might
|
||||
// not be a mount point itself (but there can be mounts underneath).
|
||||
if err := unmountBare(target, mntDetach); err == nil {
|
||||
if err := unix.Unmount(target, mntDetach); err == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -47,12 +61,18 @@ func RecursiveUnmount(target string) error {
|
||||
return len(mounts[i].Mountpoint) > len(mounts[j].Mountpoint)
|
||||
})
|
||||
|
||||
var suberr error
|
||||
var (
|
||||
suberr error
|
||||
lastMount = len(mounts) - 1
|
||||
)
|
||||
for i, m := range mounts {
|
||||
err = unmount(m.Mountpoint, mntDetach)
|
||||
err = Unmount(m.Mountpoint)
|
||||
if err != nil {
|
||||
if i == len(mounts)-1 { // last mount
|
||||
return fmt.Errorf("%w (possible cause: %s)", err, suberr)
|
||||
if i == lastMount {
|
||||
if suberr != nil {
|
||||
return fmt.Errorf("%w (possible cause: %s)", err, suberr)
|
||||
}
|
||||
return err
|
||||
}
|
||||
// This is a submount, we can ignore the error for now,
|
||||
// the final unmount will fail if this is a real problem.
|
@ -1,3 +1,5 @@
|
||||
// +build freebsd,cgo openbsd,cgo
|
||||
|
||||
package mount
|
||||
|
||||
/*
|
4
vendor/github.com/moby/sys/mount/mounter_unsupported.go
generated
vendored
4
vendor/github.com/moby/sys/mount/mounter_unsupported.go
generated
vendored
@ -1,7 +1,7 @@
|
||||
// +build !linux,!freebsd freebsd,!cgo
|
||||
// +build !linux,!freebsd,!openbsd,!windows freebsd,!cgo openbsd,!cgo
|
||||
|
||||
package mount
|
||||
|
||||
func mount(device, target, mType string, flag uintptr, data string) error {
|
||||
panic("Not implemented")
|
||||
panic("cgo required on freebsd and openbsd")
|
||||
}
|
||||
|
26
vendor/github.com/moby/sys/mount/unmount_unix.go
generated
vendored
26
vendor/github.com/moby/sys/mount/unmount_unix.go
generated
vendored
@ -1,26 +0,0 @@
|
||||
// +build !windows
|
||||
|
||||
package mount
|
||||
|
||||
import "golang.org/x/sys/unix"
|
||||
|
||||
func unmountBare(target string, flags int) error {
|
||||
return unix.Unmount(target, flags)
|
||||
}
|
||||
|
||||
func unmount(target string, flags int) error {
|
||||
err := unmountBare(target, flags)
|
||||
if err == nil || err == unix.EINVAL {
|
||||
// Ignore "not mounted" error here. Note the same error
|
||||
// can be returned if flags are invalid, so this code
|
||||
// assumes that the flags value is always correct.
|
||||
return nil
|
||||
}
|
||||
|
||||
return &mountError{
|
||||
op: "umount",
|
||||
target: target,
|
||||
flags: uintptr(flags),
|
||||
err: err,
|
||||
}
|
||||
}
|
11
vendor/github.com/moby/sys/mount/unmount_unsupported.go
generated
vendored
11
vendor/github.com/moby/sys/mount/unmount_unsupported.go
generated
vendored
@ -1,11 +0,0 @@
|
||||
// +build windows
|
||||
|
||||
package mount
|
||||
|
||||
func unmountBare(_ string, _ int) error {
|
||||
panic("Not implemented")
|
||||
}
|
||||
|
||||
func unmount(_ string, _ int) error {
|
||||
panic("Not implemented")
|
||||
}
|
Reference in New Issue
Block a user