Writes bootcmd
This commit is contained in:
30
clitools/pkg/node/uboot/ab.go
Normal file
30
clitools/pkg/node/uboot/ab.go
Normal 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",
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user