Support the native snapshotter on FreeBSD#4858
Conversation
There was a problem hiding this comment.
The behavior around ECHILD and retries is copied from mount_linux.go. There isn't (yet) a shim on FreeBSD, so I don't know if the logic is really necessary, but I left it in to start. If there's a preference to remove it, I'm happy to do so.
There was a problem hiding this comment.
Similarly, the behavior around EBUSY and retries is copied from mount_linux.go. Again, I don't know if the logic is really necessary, but I left it in to start. If there's a preference to remove it, I'm happy to do so.
8e9280b to
2fb04a0
Compare
There was a problem hiding this comment.
Is there any reason not to use mount(2) syscall directly?
There was a problem hiding this comment.
See the comment on line 37:
// The "syscall" and "golang.org/x/sys/unix" packages do not define a Mount
// function for FreeBSD, so instead we execute mount(8) and trust it to do
// the right thing
We could use syscall.RawSyscall but using mount(8) felt more reliable to me.
There was a problem hiding this comment.
- You haven't used this constant on the PR.
- Would it be
ErrNotImplementedorErrNotImplementedOnPlatform? This might be useful for other non-Unix platforms.
There was a problem hiding this comment.
This constant is pre-existing (was in mount/mount_unix.go) and used elsewhere in the codebase when compiled for FreeBSD (specifically in pkg/os/mount_unix.go). I left the name as-is to avoid touching other places in the codebase.
2fb04a0 to
b667c15
Compare
Rebased on top of the current |
|
Build succeeded.
|
Signed-off-by: Samuel Karp <[email protected]>
Signed-off-by: Samuel Karp <[email protected]>
b667c15 to
b624486
Compare
|
Build succeeded.
|
|
I believe the devicemapper failures are unrelated to my change as the only change on Linux is a reordering of mount options for the native snapshotter. |
This PR adds support for the native snapshotter on FreeBSD using FreeBSD nullfs.
The native snapshotter passes its test suite and is able to unpack an image for the
freebsd/amd64platform: