m/installer/install: move from osbase/build/mkimage/osimage
Move the package osbase/build/mkimage/osimage to
metropolis/installer/install. The package contains "metropolis" in
various strings, so it fits better in //metropolis than in //osbase.
The parent package mkimage no longer exists.
The rename also removes the name clash with osbase/oci/osimage.
Change-Id: Ia228ab94c937f4c7a5b6eb1fcc77993a594d64b6
Reviewed-on: https://review.monogon.dev/c/monogon/+/4296
Tested-by: Jenkins CI
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
diff --git a/cloud/agent/BUILD.bazel b/cloud/agent/BUILD.bazel
index 48e7d20..a25ea38 100644
--- a/cloud/agent/BUILD.bazel
+++ b/cloud/agent/BUILD.bazel
@@ -14,11 +14,11 @@
visibility = ["//visibility:private"],
deps = [
"//cloud/agent/api",
+ "//metropolis/installer/install",
"//metropolis/node/core/devmgr",
"//metropolis/node/core/network",
"//osbase/blockdev",
"//osbase/bringup",
- "//osbase/build/mkimage/osimage",
"//osbase/efivarfs",
"//osbase/net/proto",
"//osbase/nvme",
diff --git a/cloud/agent/install.go b/cloud/agent/install.go
index e212d9a..949a9a7 100644
--- a/cloud/agent/install.go
+++ b/cloud/agent/install.go
@@ -18,10 +18,10 @@
apb "source.monogon.dev/cloud/agent/api"
npb "source.monogon.dev/osbase/net/proto"
+ metropolisInstall "source.monogon.dev/metropolis/installer/install"
"source.monogon.dev/osbase/blockdev"
- "source.monogon.dev/osbase/build/mkimage/osimage"
"source.monogon.dev/osbase/efivarfs"
- ociosimage "source.monogon.dev/osbase/oci/osimage"
+ "source.monogon.dev/osbase/oci/osimage"
"source.monogon.dev/osbase/oci/registry"
"source.monogon.dev/osbase/structfs"
"source.monogon.dev/osbase/supervisor"
@@ -80,7 +80,7 @@
return fmt.Errorf("failed to fetch OS image: %w", err)
}
- osImage, err := ociosimage.Read(image)
+ osImage, err := osimage.Read(image)
if err != nil {
return fmt.Errorf("failed to fetch OS image: %w", err)
}
@@ -106,8 +106,8 @@
return fmt.Errorf("failed to open root device: %w", err)
}
- installParams := osimage.Params{
- PartitionSize: osimage.PartitionSizeInfo{
+ installParams := metropolisInstall.Params{
+ PartitionSize: metropolisInstall.PartitionSizeInfo{
ESP: 384,
System: 4096,
Data: 128,
@@ -120,7 +120,7 @@
Output: rootDev,
}
- be, err := osimage.Write(&installParams)
+ be, err := metropolisInstall.Write(&installParams)
if err != nil {
return err
}
diff --git a/metropolis/cli/metroctl/core/BUILD.bazel b/metropolis/cli/metroctl/core/BUILD.bazel
index d785fad..e9c2117 100644
--- a/metropolis/cli/metroctl/core/BUILD.bazel
+++ b/metropolis/cli/metroctl/core/BUILD.bazel
@@ -13,13 +13,13 @@
visibility = ["//visibility:public"],
deps = [
"//go/logging",
+ "//metropolis/installer/install",
"//metropolis/node",
"//metropolis/node/core/curator/proto/api",
"//metropolis/node/core/rpc",
"//metropolis/node/core/rpc/resolver",
"//metropolis/proto/api",
"//osbase/blockdev",
- "//osbase/build/mkimage/osimage",
"//osbase/fat32",
"//osbase/gpt",
"//osbase/oci",
diff --git a/metropolis/cli/metroctl/core/install.go b/metropolis/cli/metroctl/core/install.go
index 0927ba1..31fe4a0 100644
--- a/metropolis/cli/metroctl/core/install.go
+++ b/metropolis/cli/metroctl/core/install.go
@@ -11,13 +11,13 @@
"google.golang.org/protobuf/proto"
+ "source.monogon.dev/metropolis/installer/install"
"source.monogon.dev/metropolis/proto/api"
"source.monogon.dev/osbase/blockdev"
- "source.monogon.dev/osbase/build/mkimage/osimage"
"source.monogon.dev/osbase/fat32"
"source.monogon.dev/osbase/gpt"
"source.monogon.dev/osbase/oci"
- ociosimage "source.monogon.dev/osbase/oci/osimage"
+ "source.monogon.dev/osbase/oci/osimage"
"source.monogon.dev/osbase/structfs"
)
@@ -43,11 +43,11 @@
return errors.New("installer is mandatory")
}
- osImage, err := ociosimage.Read(args.Image)
+ osImage, err := osimage.Read(args.Image)
if err != nil {
return fmt.Errorf("failed to read OS image: %w", err)
}
- bootPath, err := osimage.EFIBootPath(osImage.Config.ProductInfo.Architecture())
+ bootPath, err := install.EFIBootPath(osImage.Config.ProductInfo.Architecture())
if err != nil {
return err
}
diff --git a/metropolis/cli/takeover/BUILD.bazel b/metropolis/cli/takeover/BUILD.bazel
index 1b8f182..8e51836 100644
--- a/metropolis/cli/takeover/BUILD.bazel
+++ b/metropolis/cli/takeover/BUILD.bazel
@@ -30,12 +30,12 @@
visibility = ["//visibility:private"],
deps = [
"//go/logging",
+ "//metropolis/installer/install",
"//metropolis/node/core/devmgr",
"//metropolis/proto/api",
"//osbase/blockdev",
"//osbase/bootparam",
"//osbase/bringup",
- "//osbase/build/mkimage/osimage",
"//osbase/efivarfs",
"//osbase/kexec",
"//osbase/net/dump",
diff --git a/metropolis/cli/takeover/install.go b/metropolis/cli/takeover/install.go
index 37068ed..4d42269 100644
--- a/metropolis/cli/takeover/install.go
+++ b/metropolis/cli/takeover/install.go
@@ -10,11 +10,11 @@
"path/filepath"
"source.monogon.dev/go/logging"
+ "source.monogon.dev/metropolis/installer/install"
"source.monogon.dev/osbase/blockdev"
- "source.monogon.dev/osbase/build/mkimage/osimage"
"source.monogon.dev/osbase/efivarfs"
"source.monogon.dev/osbase/oci"
- ociosimage "source.monogon.dev/osbase/oci/osimage"
+ "source.monogon.dev/osbase/oci/osimage"
"source.monogon.dev/osbase/structfs"
)
@@ -47,7 +47,7 @@
return err
}
- be, err := osimage.Write(installParams)
+ be, err := install.Write(installParams)
if err != nil {
return fmt.Errorf("failed to apply installation: %w", err)
}
@@ -62,13 +62,13 @@
return nil
}
-func setupOSImageParams(image *oci.Image, metropolisSpecRaw []byte, installTarget string) (*osimage.Params, error) {
+func setupOSImageParams(image *oci.Image, metropolisSpecRaw []byte, installTarget string) (*install.Params, error) {
rootDev, err := blockdev.Open(filepath.Join("/dev", installTarget))
if err != nil {
return nil, fmt.Errorf("failed to open root device: %w", err)
}
- osImage, err := ociosimage.Read(image)
+ osImage, err := osimage.Read(image)
if err != nil {
return nil, fmt.Errorf("failed to read OS image: %w", err)
}
@@ -82,8 +82,8 @@
return nil, fmt.Errorf("cannot open system image in OS image: %w", err)
}
- return &osimage.Params{
- PartitionSize: osimage.PartitionSizeInfo{
+ return &install.Params{
+ PartitionSize: install.PartitionSizeInfo{
ESP: 384,
System: 4096,
Data: 128,
diff --git a/metropolis/cli/takeover/takeover.go b/metropolis/cli/takeover/takeover.go
index cd537a9..805a06d 100644
--- a/metropolis/cli/takeover/takeover.go
+++ b/metropolis/cli/takeover/takeover.go
@@ -18,8 +18,8 @@
apb "source.monogon.dev/metropolis/proto/api"
netapi "source.monogon.dev/osbase/net/proto"
+ "source.monogon.dev/metropolis/installer/install"
"source.monogon.dev/osbase/bootparam"
- "source.monogon.dev/osbase/build/mkimage/osimage"
"source.monogon.dev/osbase/kexec"
netdump "source.monogon.dev/osbase/net/dump"
"source.monogon.dev/osbase/oci"
@@ -136,7 +136,7 @@
}
// Validate that this installation will not fail because of disk issues
- if _, err := osimage.Plan(oParams); err != nil {
+ if _, err := install.Plan(oParams); err != nil {
return nil, fmt.Errorf("failed to plan installation: %w", err)
}
diff --git a/metropolis/installer/BUILD.bazel b/metropolis/installer/BUILD.bazel
index 29eb04c..72fee1a 100644
--- a/metropolis/installer/BUILD.bazel
+++ b/metropolis/installer/BUILD.bazel
@@ -13,9 +13,9 @@
importpath = "source.monogon.dev/metropolis/installer",
visibility = ["//visibility:private"],
deps = [
+ "//metropolis/installer/install",
"//osbase/blockdev",
"//osbase/bringup",
- "//osbase/build/mkimage/osimage",
"//osbase/efivarfs",
"//osbase/oci",
"//osbase/oci/osimage",
diff --git a/osbase/build/mkimage/osimage/BUILD.bazel b/metropolis/installer/install/BUILD.bazel
similarity index 72%
rename from osbase/build/mkimage/osimage/BUILD.bazel
rename to metropolis/installer/install/BUILD.bazel
index f85fa20..1532198 100644
--- a/osbase/build/mkimage/osimage/BUILD.bazel
+++ b/metropolis/installer/install/BUILD.bazel
@@ -1,9 +1,9 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
- name = "osimage",
- srcs = ["osimage.go"],
- importpath = "source.monogon.dev/osbase/build/mkimage/osimage",
+ name = "install",
+ srcs = ["install.go"],
+ importpath = "source.monogon.dev/metropolis/installer/install",
visibility = ["//visibility:public"],
deps = [
"//osbase/blockdev",
diff --git a/osbase/build/mkimage/osimage/osimage.go b/metropolis/installer/install/install.go
similarity index 95%
rename from osbase/build/mkimage/osimage/osimage.go
rename to metropolis/installer/install/install.go
index 5b17e6b..a2b9ff8 100644
--- a/osbase/build/mkimage/osimage/osimage.go
+++ b/metropolis/installer/install/install.go
@@ -1,9 +1,9 @@
// Copyright The Monogon Project Authors.
// SPDX-License-Identifier: Apache-2.0
-// This package provides self-contained implementation used to generate
-// Metropolis disk images.
-package osimage
+// Package install allows planning and executing the installation of Metropolis
+// to a block device.
+package install
import (
"fmt"
@@ -68,10 +68,9 @@
Data int64
}
-// Params contains parameters used by Plan or Write to build a Metropolis OS
-// image.
+// Params contains parameters used by Plan or Write to install Metropolis OS.
type Params struct {
- // Output is the block device to which the OS image is written.
+ // Output is the block device to which the OS is installed.
Output blockdev.BlockDev
// Architecture is the CPU architecture of the OS image.
Architecture string
@@ -242,7 +241,7 @@
const Mi = 1024 * 1024
-// Write writes a Metropolis OS image to a block device.
+// Write installs Metropolis OS to a block device.
func Write(params *Params) (*efivarfs.LoadOption, error) {
p, err := Plan(params)
if err != nil {
diff --git a/metropolis/installer/main.go b/metropolis/installer/main.go
index 20a8240..ac6152f 100644
--- a/metropolis/installer/main.go
+++ b/metropolis/installer/main.go
@@ -18,12 +18,12 @@
"golang.org/x/sys/unix"
+ "source.monogon.dev/metropolis/installer/install"
"source.monogon.dev/osbase/blockdev"
"source.monogon.dev/osbase/bringup"
- "source.monogon.dev/osbase/build/mkimage/osimage"
"source.monogon.dev/osbase/efivarfs"
"source.monogon.dev/osbase/oci"
- ociosimage "source.monogon.dev/osbase/oci/osimage"
+ "source.monogon.dev/osbase/oci/osimage"
"source.monogon.dev/osbase/structfs"
"source.monogon.dev/osbase/supervisor"
"source.monogon.dev/osbase/sysfs"
@@ -159,7 +159,7 @@
if err != nil {
return fmt.Errorf("failed to read OS image from ESP: %w", err)
}
- osImage, err := ociosimage.Read(ociImage)
+ osImage, err := osimage.Read(ociImage)
if err != nil {
return fmt.Errorf("failed to read OS image from ESP: %w", err)
}
@@ -173,16 +173,16 @@
return fmt.Errorf("cannot open system image in OS image: %w", err)
}
- // Build the osimage parameters.
- installParams := osimage.Params{
- PartitionSize: osimage.PartitionSizeInfo{
+ // Build the install parameters.
+ installParams := install.Params{
+ PartitionSize: install.PartitionSizeInfo{
// ESP is the size of the node ESP partition, expressed in mebibytes.
ESP: 384,
// System is the size of the node system partition, expressed in
// mebibytes.
System: 4096,
// Data must be nonzero in order for the data partition to be created.
- // osimage will extend the data partition to fill all the available space
+ // install will extend the data partition to fill all the available space
// whenever it's writing to block devices, such as now.
Data: 128,
},
@@ -207,7 +207,7 @@
}
// Set the first suitable block device found as the installation target.
tgtBlkdevName := blkDevs[0]
- // Update the osimage parameters with a path pointing at the target device.
+ // Update the install parameters with a path pointing at the target device.
tgtBlkdevPath := filepath.Join("/dev", tgtBlkdevName)
tgtBlockDev, err := blockdev.Open(tgtBlkdevPath)
@@ -216,10 +216,10 @@
}
installParams.Output = tgtBlockDev
- // Use osimage to partition the target block device and set up its ESP.
+ // Use install to partition the target block device and set up its ESP.
// Write will return an EFI boot entry on success.
l.Infof("Installing to %s...", tgtBlkdevPath)
- be, err := osimage.Write(&installParams)
+ be, err := install.Write(&installParams)
if err != nil {
return fmt.Errorf("while installing: %w", err)
}
diff --git a/metropolis/installer/test/BUILD.bazel b/metropolis/installer/test/BUILD.bazel
index d68f78a..a5e8973 100644
--- a/metropolis/installer/test/BUILD.bazel
+++ b/metropolis/installer/test/BUILD.bazel
@@ -21,8 +21,8 @@
},
deps = [
"//metropolis/cli/metroctl/core",
+ "//metropolis/installer/install",
"//metropolis/proto/api",
- "//osbase/build/mkimage/osimage",
"//osbase/cmd",
"//osbase/oci",
"//osbase/oci/osimage",
diff --git a/metropolis/installer/test/run_test.go b/metropolis/installer/test/run_test.go
index bba323f..9d9d136 100644
--- a/metropolis/installer/test/run_test.go
+++ b/metropolis/installer/test/run_test.go
@@ -24,10 +24,10 @@
"source.monogon.dev/metropolis/proto/api"
mctl "source.monogon.dev/metropolis/cli/metroctl/core"
- "source.monogon.dev/osbase/build/mkimage/osimage"
+ "source.monogon.dev/metropolis/installer/install"
"source.monogon.dev/osbase/cmd"
"source.monogon.dev/osbase/oci"
- ociosimage "source.monogon.dev/osbase/oci/osimage"
+ "source.monogon.dev/osbase/oci/osimage"
"source.monogon.dev/osbase/structfs"
)
@@ -147,11 +147,11 @@
log.Fatal(err)
}
- osImage, err := ociosimage.Read(image)
+ osImage, err := osimage.Read(image)
if err != nil {
log.Fatal(err)
}
- bootPath, err = osimage.EFIBootPath(osImage.Config.ProductInfo.Architecture())
+ bootPath, err = install.EFIBootPath(osImage.Config.ProductInfo.Architecture())
if err != nil {
log.Fatal(err)
}
@@ -284,22 +284,22 @@
// Check that the first partition is likely to be a valid ESP.
pi := ti.GetPartitions()
esp := (pi[0]).(*gpt.Partition)
- if esp.Name != osimage.ESPLabel || esp.Start == 0 || esp.End == 0 {
+ if esp.Name != install.ESPLabel || esp.Start == 0 || esp.End == 0 {
t.Fatal("The node's ESP GPT entry looks off.")
}
// Verify the system partition's GPT entry.
system := (pi[1]).(*gpt.Partition)
- if system.Name != osimage.SystemALabel || system.Start == 0 || system.End == 0 {
+ if system.Name != install.SystemALabel || system.Start == 0 || system.End == 0 {
t.Fatal("The node's system partition GPT entry looks off.")
}
// Verify the system partition's GPT entry.
systemB := (pi[2]).(*gpt.Partition)
- if systemB.Name != osimage.SystemBLabel || systemB.Start == 0 || systemB.End == 0 {
+ if systemB.Name != install.SystemBLabel || systemB.Start == 0 || systemB.End == 0 {
t.Fatal("The node's system partition GPT entry looks off.")
}
// Verify the data partition's GPT entry.
data := (pi[3]).(*gpt.Partition)
- if data.Name != osimage.DataLabel || data.Start == 0 || data.End == 0 {
+ if data.Name != install.DataLabel || data.Start == 0 || data.End == 0 {
t.Fatalf("The node's data partition GPT entry looks off: %+v", data)
}
// Verify that there are no more partitions.
diff --git a/metropolis/node/core/update/BUILD.bazel b/metropolis/node/core/update/BUILD.bazel
index 0ce75b4..73f6773 100644
--- a/metropolis/node/core/update/BUILD.bazel
+++ b/metropolis/node/core/update/BUILD.bazel
@@ -10,11 +10,11 @@
visibility = ["//visibility:public"],
deps = [
"//go/logging",
+ "//metropolis/installer/install",
"//metropolis/node/abloader/spec",
"//metropolis/node/core/productinfo",
"//metropolis/proto/api",
"//osbase/blockdev",
- "//osbase/build/mkimage/osimage",
"//osbase/efivarfs",
"//osbase/gpt",
"//osbase/kexec",
diff --git a/metropolis/node/core/update/e2e/BUILD.bazel b/metropolis/node/core/update/e2e/BUILD.bazel
index 19738eb..5960e66 100644
--- a/metropolis/node/core/update/e2e/BUILD.bazel
+++ b/metropolis/node/core/update/e2e/BUILD.bazel
@@ -25,8 +25,8 @@
"xAbloaderPath": "$(rlocationpath //metropolis/node/abloader )",
},
deps = [
+ "//metropolis/installer/install",
"//osbase/blockdev",
- "//osbase/build/mkimage/osimage",
"//osbase/oci",
"//osbase/oci/osimage",
"//osbase/oci/registry",
diff --git a/metropolis/node/core/update/e2e/e2e_test.go b/metropolis/node/core/update/e2e/e2e_test.go
index 8bc2bb9..124883e 100644
--- a/metropolis/node/core/update/e2e/e2e_test.go
+++ b/metropolis/node/core/update/e2e/e2e_test.go
@@ -20,10 +20,10 @@
"github.com/bazelbuild/rules_go/go/runfiles"
+ "source.monogon.dev/metropolis/installer/install"
"source.monogon.dev/osbase/blockdev"
- "source.monogon.dev/osbase/build/mkimage/osimage"
"source.monogon.dev/osbase/oci"
- ociosimage "source.monogon.dev/osbase/oci/osimage"
+ "source.monogon.dev/osbase/oci/osimage"
"source.monogon.dev/osbase/oci/registry"
"source.monogon.dev/osbase/structfs"
)
@@ -150,7 +150,7 @@
t.Fatal(err)
}
- osImageY, err := ociosimage.Read(imageY)
+ osImageY, err := osimage.Read(imageY)
if err != nil {
t.Fatal(err)
}
@@ -189,13 +189,13 @@
t.Fatal(err)
}
- if _, err := osimage.Write(&osimage.Params{
+ if _, err := install.Write(&install.Params{
Output: rootDisk,
Architecture: osImageY.Config.ProductInfo.Architecture(),
ABLoader: loader,
EFIPayload: boot,
SystemImage: system,
- PartitionSize: osimage.PartitionSizeInfo{
+ PartitionSize: install.PartitionSizeInfo{
ESP: 128,
System: 256,
Data: 10,
diff --git a/metropolis/node/core/update/e2e/testos/BUILD.bazel b/metropolis/node/core/update/e2e/testos/BUILD.bazel
index 5301b57..a4011ce 100644
--- a/metropolis/node/core/update/e2e/testos/BUILD.bazel
+++ b/metropolis/node/core/update/e2e/testos/BUILD.bazel
@@ -13,12 +13,12 @@
importpath = "source.monogon.dev/metropolis/node/core/update/e2e/testos",
visibility = ["//visibility:private"],
deps = [
+ "//metropolis/installer/install",
"//metropolis/node/core/network",
"//metropolis/node/core/update",
"//metropolis/proto/api",
"//osbase/blockdev",
"//osbase/bringup",
- "//osbase/build/mkimage/osimage",
"//osbase/gpt",
"//osbase/supervisor",
"@org_golang_x_sys//unix",
diff --git a/metropolis/node/core/update/e2e/testos/main.go b/metropolis/node/core/update/e2e/testos/main.go
index 2cafebc..0b40127 100644
--- a/metropolis/node/core/update/e2e/testos/main.go
+++ b/metropolis/node/core/update/e2e/testos/main.go
@@ -11,11 +11,11 @@
"golang.org/x/sys/unix"
+ "source.monogon.dev/metropolis/installer/install"
"source.monogon.dev/metropolis/node/core/network"
"source.monogon.dev/metropolis/node/core/update"
"source.monogon.dev/osbase/blockdev"
"source.monogon.dev/osbase/bringup"
- "source.monogon.dev/osbase/build/mkimage/osimage"
"source.monogon.dev/osbase/gpt"
"source.monogon.dev/osbase/supervisor"
@@ -57,11 +57,11 @@
return fmt.Errorf("unable to mkdir ESP mountpoint: %w", err)
}
updateSvc.ProvideESP("/esp", uint32(pn+1), p)
- case osimage.SystemAType:
+ case install.SystemAType:
if err := unix.Symlink(fmt.Sprintf("/dev/vda%d", pn+1), "/dev/system-a"); err != nil {
return fmt.Errorf("failed to symlink system-a: %w", err)
}
- case osimage.SystemBType:
+ case install.SystemBType:
if err := unix.Symlink(fmt.Sprintf("/dev/vda%d", pn+1), "/dev/system-b"); err != nil {
return fmt.Errorf("failed to symlink system-b: %w", err)
}
diff --git a/metropolis/node/core/update/update.go b/metropolis/node/core/update/update.go
index ee53f90..d37bb38 100644
--- a/metropolis/node/core/update/update.go
+++ b/metropolis/node/core/update/update.go
@@ -26,13 +26,13 @@
"google.golang.org/protobuf/proto"
"source.monogon.dev/go/logging"
+ "source.monogon.dev/metropolis/installer/install"
"source.monogon.dev/metropolis/node/core/productinfo"
"source.monogon.dev/osbase/blockdev"
- "source.monogon.dev/osbase/build/mkimage/osimage"
"source.monogon.dev/osbase/efivarfs"
"source.monogon.dev/osbase/gpt"
"source.monogon.dev/osbase/kexec"
- ociosimage "source.monogon.dev/osbase/oci/osimage"
+ "source.monogon.dev/osbase/oci/osimage"
"source.monogon.dev/osbase/oci/registry"
abloaderpb "source.monogon.dev/metropolis/node/abloader/spec"
@@ -88,9 +88,9 @@
func (s Slot) EFIBootPath() string {
switch s {
case SlotA:
- return osimage.EFIBootAPath
+ return install.EFIBootAPath
case SlotB:
- return osimage.EFIBootBPath
+ return install.EFIBootBPath
default:
return ""
}
@@ -294,7 +294,7 @@
return fmt.Errorf("failed to fetch OS image: %w", err)
}
- osImage, err := ociosimage.Read(image)
+ osImage, err := osimage.Read(image)
if err != nil {
return fmt.Errorf("failed to fetch OS image: %w", err)
}
@@ -428,7 +428,7 @@
var abloader []byte
func (s *Service) fixupPreloader() error {
- efiBootPath, err := osimage.EFIBootPath(productinfo.Get().Info.Architecture())
+ efiBootPath, err := install.EFIBootPath(productinfo.Get().Info.Architecture())
if err != nil {
return err
}
@@ -473,7 +473,7 @@
// fixupEFI checks for the existence and correctness of the EFI boot entry
// repairs/recreates it if needed.
func (s *Service) fixupEFI() error {
- efiBootPath, err := osimage.EFIBootPath(productinfo.Get().Info.Architecture())
+ efiBootPath, err := install.EFIBootPath(productinfo.Get().Info.Architecture())
if err != nil {
return err
}
diff --git a/metropolis/test/launch/BUILD.bazel b/metropolis/test/launch/BUILD.bazel
index bbe3eb9..6c76d5b 100644
--- a/metropolis/test/launch/BUILD.bazel
+++ b/metropolis/test/launch/BUILD.bazel
@@ -44,6 +44,7 @@
deps = [
"//go/logging",
"//metropolis/cli/metroctl/core",
+ "//metropolis/installer/install",
"//metropolis/node",
"//metropolis/node/core/curator/proto/api",
"//metropolis/node/core/rpc",
@@ -51,7 +52,6 @@
"//metropolis/proto/api",
"//metropolis/proto/common",
"//osbase/blockdev",
- "//osbase/build/mkimage/osimage",
"//osbase/logbuffer",
"//osbase/oci",
"//osbase/oci/osimage",
diff --git a/metropolis/test/launch/cluster.go b/metropolis/test/launch/cluster.go
index 1e3f42b..744c0cc 100644
--- a/metropolis/test/launch/cluster.go
+++ b/metropolis/test/launch/cluster.go
@@ -47,13 +47,13 @@
"source.monogon.dev/go/logging"
metroctl "source.monogon.dev/metropolis/cli/metroctl/core"
+ "source.monogon.dev/metropolis/installer/install"
"source.monogon.dev/metropolis/node"
"source.monogon.dev/metropolis/node/core/rpc"
"source.monogon.dev/metropolis/node/core/rpc/resolver"
"source.monogon.dev/osbase/blockdev"
- "source.monogon.dev/osbase/build/mkimage/osimage"
"source.monogon.dev/osbase/oci"
- ociosimage "source.monogon.dev/osbase/oci/osimage"
+ "source.monogon.dev/osbase/oci/osimage"
"source.monogon.dev/osbase/oci/registry"
"source.monogon.dev/osbase/structfs"
"source.monogon.dev/osbase/test/qemu"
@@ -170,7 +170,7 @@
if err != nil {
return nil, fmt.Errorf("failed to read OS image: %w", err)
}
- osImage, err := ociosimage.Read(ociImage)
+ osImage, err := osimage.Read(ociImage)
if err != nil {
return nil, fmt.Errorf("failed to read OS image: %w", err)
}
@@ -198,8 +198,8 @@
}
defer df.Close()
- installParams := &osimage.Params{
- PartitionSize: osimage.PartitionSizeInfo{
+ installParams := &install.Params{
+ PartitionSize: install.PartitionSizeInfo{
ESP: 128,
System: 1024,
Data: 128,
@@ -210,7 +210,8 @@
ABLoader: abloader,
Output: df,
}
- if _, err := osimage.Write(installParams); err != nil {
+
+ if _, err := install.Write(installParams); err != nil {
return nil, fmt.Errorf("while creating node image: %w", err)
}