Writes bootcmd

This commit is contained in:
2026-04-04 22:47:51 +08:00
parent b8a5f197f4
commit abc749a4b0
10 changed files with 316 additions and 18 deletions

View File

@@ -0,0 +1,30 @@
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",
})
}