metropolis/node: move misplaced packages out of core
abloader, bios_bootcode and minit don't run as part of the core process,
so it doesn't make sense to have them in //metropolis/node/core.
This changes moves these three to //metropolis/node.
Change-Id: I908efb311a138f07a9f1de8e3c23437ff00131ee
Reviewed-on: https://review.monogon.dev/c/monogon/+/4196
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/node/abloader/spec/BUILD.bazel b/metropolis/node/abloader/spec/BUILD.bazel
new file mode 100644
index 0000000..3190c57
--- /dev/null
+++ b/metropolis/node/abloader/spec/BUILD.bazel
@@ -0,0 +1,44 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
+load("@rules_proto_grpc_buf//:defs.bzl", "buf_proto_lint_test")
+load("@rules_rust_prost//:defs.bzl", "rust_prost_library")
+
+buf_proto_lint_test(
+ name = "abloader_proto_lint_test",
+ except_rules = [
+ "PACKAGE_VERSION_SUFFIX",
+ "ENUM_ZERO_VALUE_SUFFIX",
+ ],
+ protos = [":abloader_proto"],
+ use_rules = [
+ "DEFAULT",
+ "COMMENTS",
+ ],
+)
+
+proto_library(
+ name = "abloader_proto",
+ srcs = ["abloader.proto"],
+ visibility = ["//visibility:public"],
+)
+
+rust_prost_library(
+ name = "abloader_proto_rs",
+ proto = ":abloader_proto",
+ visibility = ["//visibility:public"],
+)
+
+go_proto_library(
+ name = "abloader_go_proto",
+ importpath = "source.monogon.dev/metropolis/node/abloader/spec",
+ proto = ":abloader_proto",
+ visibility = ["//visibility:public"],
+)
+
+go_library(
+ name = "spec",
+ embed = [":abloader_go_proto"],
+ importpath = "source.monogon.dev/metropolis/node/abloader/spec",
+ visibility = ["//visibility:public"],
+)
diff --git a/metropolis/node/abloader/spec/abloader.proto b/metropolis/node/abloader/spec/abloader.proto
new file mode 100644
index 0000000..9704ce6
--- /dev/null
+++ b/metropolis/node/abloader/spec/abloader.proto
@@ -0,0 +1,22 @@
+syntax = "proto3";
+
+package metropolis.node.abloader.spec;
+
+enum Slot {
+ SLOT_NONE = 0;
+ SLOT_A = 1;
+ SLOT_B = 2;
+}
+
+// ABLoaderData contains data the A/B loader needs to chose which slot to boot
+// as well as for auto-rollback functionality.
+message ABLoaderData {
+ // The currently-active slot. This slot will be booted unless next_slot is
+ // set to a non-default value.
+ Slot active_slot = 1;
+ // The slot to boot next, but only once. Once the the slot has been selected
+ // to be booted by the loader, this value is reset before booting into that
+ // slot. If the OS boots successfully, it will update the active_slot to
+ // permanently boot from the new slot.
+ Slot next_slot = 2;
+}
diff --git a/metropolis/node/abloader/spec/gomod-generated-placeholder.go b/metropolis/node/abloader/spec/gomod-generated-placeholder.go
new file mode 100644
index 0000000..ca2145c
--- /dev/null
+++ b/metropolis/node/abloader/spec/gomod-generated-placeholder.go
@@ -0,0 +1,4 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
+package spec