pkg/bootparam: add bootparam pkg
This adds the bootparam package which can marshal and unmarshal the Linux
kernel command line into boot parameters and a rest section passed to
init.
This is a very quirky format, thus there is a fuzz testing harness
against the reference implementation from the kernel included to verify
correctness.
A set of weird edge cases is rejected by Unmarshal instead of parsing
to nonsensical data as the reference implementation does to save on
complexity in the parser.
Change-Id: I6debfa67e69ae8db4e0356f34ecb127ea27d18de
Reviewed-on: https://review.monogon.dev/c/monogon/+/1125
Tested-by: Jenkins CI
Reviewed-by: Serge Bazanski <serge@monogon.tech>
diff --git a/metropolis/pkg/bootparam/ref/BUILD.bazel b/metropolis/pkg/bootparam/ref/BUILD.bazel
new file mode 100644
index 0000000..d22540a
--- /dev/null
+++ b/metropolis/pkg/bootparam/ref/BUILD.bazel
@@ -0,0 +1,11 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+ name = "ref",
+ srcs = ["ref.go"],
+ cgo = True,
+ gc_goopts = ["-d=libfuzzer"],
+ importpath = "source.monogon.dev/metropolis/pkg/bootparam/ref",
+ visibility = ["//visibility:public"],
+ deps = ["//metropolis/pkg/bootparam"],
+)