Open lapo-luchini opened 2 years ago
There is currently no explicit FreeBSD support, it has been developed exclusively against Linux/ZOL. From a quick look the zfs_cmd
structure is different on FreeBSD, so this will not work without explicit support (even when fixing the type error). Sadly I have absolutely zero experience with low-level BSD development and no way to test this.
Somebody with more knowledge on how this works on FreeBSD would have to contribute support and a test wrapper (i.e. a FreeBSD kernel running in kvmtool) which I can run in CI to make sure it doesn't regress as I have no other way of testing this.
Also the tests are designed to run in a lightweight Linux VM, running go test
standalone is a bit risky for anything else that might be on that system.
…good to know about go test
. Thankfully it didn't work, then!
Linux-only ZOL is no longer, OpenZFS 2.0 is now supporting both Linux and FreeBSD as "tier 1", so I was building it in the hope that it did "just work".
Other than that… while I would be willing to patch it to work on FreeBSD (as I dislike the lack of zfs details on FreeBSD node_exporter), I have zero Go knowledge and to little time on hands, I fear. I will try some quick hack there and there, maybe. :(
I know that OpenZFS supports both, but this shares zero code with it as it is implemented in pure Go. You can run this with only the kernel module and not a single ZFS userspace utility or library. And sadly there are differences in the syscall interfaces between FreeBSD and Linux which would need to be accounted for. I'm open to supporting FreeBSD and a large part of what's in this repo (nvlist implementation and function signatures) are probably portable as-is, but somebody who understands how all this low-level stuff works on FreeBSD needs to contribute it.
Hi! First of all… sorry if I say strange stuff, but I know nothing about Go language; I'm just trying to build it for testing of zfs_exporter.