penguin/monok8s

k8s image for Mono Gateway Dev Kit

clitools/pkg/node/uboot/ab.go

raw ยท 591 bytes

package uboot

import (
	"context"
	"fmt"
	"os"

	"example.com/monok8s/pkg/node"
)

func ConfigureABBoot(ctx context.Context, nctx *node.NodeContext) error {

	exePath, err := os.Executable()
	if err != nil {
		return fmt.Errorf("get current executable path: %w", err)
	}

	writer := NewFWEnvWriter(HostFWEnvCfgPath, exePath)

	// TODO: configurable from cluster.env
	return writer.EnsureBootEnv(ctx, BootEnvConfig{
		BootSource:      "usb",
		BootPart:        "A",
		BootDisk:        0,
		RootfsAPartNum:  2,
		RootfsBPartNum:  3,
		DataPartNum:     4,
		LinuxRootPrefix: "/dev/sda",
	})
}