m/p/blockdev: add darwin implementation
This adds a minimal blockdev implementation for Darwin/macOS.
Properly implementing Discard() is left for later as it would require
extending x/sys/unix and it is allowed to just return ErrUnsupported
for all calls.
Change-Id: I5f3c85935301857c1f25edd8b8f9acdbe4abf4ad
Reviewed-on: https://review.monogon.dev/c/monogon/+/1977
Tested-by: Jenkins CI
Reviewed-by: Serge Bazanski <serge@monogon.tech>
diff --git a/metropolis/pkg/blockdev/BUILD.bazel b/metropolis/pkg/blockdev/BUILD.bazel
index c0c98d3..4eff0d4 100644
--- a/metropolis/pkg/blockdev/BUILD.bazel
+++ b/metropolis/pkg/blockdev/BUILD.bazel
@@ -4,6 +4,7 @@
name = "blockdev",
srcs = [
"blockdev.go",
+ "blockdev_darwin.go",
"blockdev_linux.go",
"memory.go",
],
@@ -13,6 +14,12 @@
"@io_bazel_rules_go//go/platform:android": [
"@org_golang_x_sys//unix",
],
+ "@io_bazel_rules_go//go/platform:darwin": [
+ "@org_golang_x_sys//unix",
+ ],
+ "@io_bazel_rules_go//go/platform:ios": [
+ "@org_golang_x_sys//unix",
+ ],
"@io_bazel_rules_go//go/platform:linux": [
"@org_golang_x_sys//unix",
],