m/n/build: implement new fsspec infrastructure
This makes the node_initramfs and erofs_image use the new common fsspec
infrastructure. It also adds the fsspecs attribute to both which can
later be used to add arbitrary fsspecs.
Change-Id: I384e04712c0a70f82c5c975911cbb1d0d5e6cabc
Reviewed-on: https://review.monogon.dev/c/monogon/+/530
Reviewed-by: Sergiusz Bazanski <serge@monogon.tech>
diff --git a/metropolis/node/build/mkerofs/BUILD.bazel b/metropolis/node/build/mkerofs/BUILD.bazel
index 3cbcbde..43e2f5c 100644
--- a/metropolis/node/build/mkerofs/BUILD.bazel
+++ b/metropolis/node/build/mkerofs/BUILD.bazel
@@ -8,7 +8,6 @@
deps = [
"//metropolis/node/build/fsspec:go_default_library",
"//metropolis/pkg/erofs:go_default_library",
- "@com_github_golang_protobuf//proto:go_default_library",
],
)
diff --git a/metropolis/node/build/mkerofs/main.go b/metropolis/node/build/mkerofs/main.go
index 651096b..0d35eff 100644
--- a/metropolis/node/build/mkerofs/main.go
+++ b/metropolis/node/build/mkerofs/main.go
@@ -28,8 +28,6 @@
"sort"
"strings"
- "github.com/golang/protobuf/proto"
-
"source.monogon.dev/metropolis/node/build/fsspec"
"source.monogon.dev/metropolis/pkg/erofs"
)
@@ -125,20 +123,15 @@
}
var (
- specPath = flag.String("spec", "", "Path to the filesystem specification (spec.FSSpec)")
- outPath = flag.String("out", "", "Output file path")
+ outPath = flag.String("out", "", "Output file path")
)
func main() {
flag.Parse()
- specRaw, err := os.ReadFile(*specPath)
- if err != nil {
- log.Fatalf("failed to open spec: %v", err)
- }
- var spec fsspec.FSSpec
- if err := proto.UnmarshalText(string(specRaw), &spec); err != nil {
- log.Fatalf("failed to parse spec: %v", err)
+ spec, err := fsspec.ReadMergeSpecs(flag.Args())
+ if err != nil {
+ log.Fatalf("failed to load specs: %v", err)
}
var fsRoot = &entrySpec{