mirror of
https://github.com/containers/skopeo.git
synced 2025-09-26 20:53:16 +00:00
Vendor in latest containers storage
We want to get support into skopeo for handling override_kernel_checks so that we can use overlay backend on RHEL. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
12
vendor/github.com/containers/storage/drivers/overlay/mount.go
generated
vendored
12
vendor/github.com/containers/storage/drivers/overlay/mount.go
generated
vendored
@@ -9,9 +9,9 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"syscall"
|
||||
|
||||
"github.com/containers/storage/pkg/reexec"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -31,12 +31,12 @@ type mountOptions struct {
|
||||
Flag uint32
|
||||
}
|
||||
|
||||
func mountFrom(dir, device, target, mType, label string) error {
|
||||
func mountFrom(dir, device, target, mType string, flags uintptr, label string) error {
|
||||
options := &mountOptions{
|
||||
Device: device,
|
||||
Target: target,
|
||||
Type: mType,
|
||||
Flag: 0,
|
||||
Flag: uint32(flags),
|
||||
Label: label,
|
||||
}
|
||||
|
||||
@@ -51,16 +51,18 @@ func mountFrom(dir, device, target, mType, label string) error {
|
||||
cmd.Stderr = output
|
||||
|
||||
if err := cmd.Start(); err != nil {
|
||||
w.Close()
|
||||
return fmt.Errorf("mountfrom error on re-exec cmd: %v", err)
|
||||
}
|
||||
//write the options to the pipe for the untar exec to read
|
||||
if err := json.NewEncoder(w).Encode(options); err != nil {
|
||||
w.Close()
|
||||
return fmt.Errorf("mountfrom json encode to pipe failed: %v", err)
|
||||
}
|
||||
w.Close()
|
||||
|
||||
if err := cmd.Wait(); err != nil {
|
||||
return fmt.Errorf("mountfrom re-exec error: %v: output: %s", err, output)
|
||||
return fmt.Errorf("mountfrom re-exec error: %v: output: %v", err, output)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -80,7 +82,7 @@ func mountFromMain() {
|
||||
fatal(err)
|
||||
}
|
||||
|
||||
if err := syscall.Mount(options.Device, options.Target, options.Type, uintptr(options.Flag), options.Label); err != nil {
|
||||
if err := unix.Mount(options.Device, options.Target, options.Type, uintptr(options.Flag), options.Label); err != nil {
|
||||
fatal(err)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user