metropolis/node: generate OCI index
This adds a multi-architecture OCI index target for metropolis. mkoci is
extended to add the platform to the index.json. Product info is extended
to add the PlatformOS field, which mkoci puts into the platform.
The OCI spec requires the os field of the platform to be set. We don't
need this field so we could simply put "unknown" there, but I think
"uefi" is nicer. Registry UIs display the os and architecture fields.
Change-Id: I24acf3c01201b50238abd30cfd86da2eda43c1d9
Reviewed-on: https://review.monogon.dev/c/monogon/+/4477
Tested-by: Jenkins CI
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
diff --git a/osbase/build/genproductinfo/main.go b/osbase/build/genproductinfo/main.go
index e4b566d..87d6e09 100644
--- a/osbase/build/genproductinfo/main.go
+++ b/osbase/build/genproductinfo/main.go
@@ -31,6 +31,7 @@
flagID = flag.String("id", "", "id parameter (see freedesktop spec)")
flagArchitecture = flag.String("architecture", "", "CPU architecture")
flagBuildFlags = flag.String("build_flags", "", "build flags joined by '-'")
+ flagPlatformOS = flag.String("platform_os", "", "platform OS")
)
var (
@@ -117,6 +118,7 @@
CommitHash: statusVars["STABLE_MONOGON_gitCommit"],
CommitDate: statusVars["STABLE_MONOGON_gitCommitDate"],
BuildTreeDirty: statusVars["STABLE_MONOGON_gitTreeState"] == "dirty",
+ PlatformOS: *flagPlatformOS,
Components: components,
}
productInfoBytes, err := json.MarshalIndent(productInfo, "", "\t")