Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 committed Nov 25, 2024
1 parent 94de65b commit a07a845
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions cli/boot.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package main

import (
"github.com/metal-stack/go-hal"
"github.com/urfave/cli/v2"
)

var bootCmd = &cli.Command{
Name: "boot",
Usage: "gather and modify boot order",
Flags: flags,
Action: func(ctx *cli.Context) error {
log.Warnw("getting boot order missing")
return nil
},
Subcommands: []*cli.Command{
{
Name: "hdd",
Usage: "boot from hdd",
Flags: flags,
Action: func(ctx *cli.Context) error {
c, err := getHalConnection(log)
if err != nil {
return err
}
err = c.BootFrom(hal.BootTargetDisk)
if err != nil {
return err
}
log.Infow("boot", "set to", hal.BootTargetDisk.String())
return nil
},
},
{
Name: "pxe",
Usage: "boot from pxe",
Flags: flags,
Action: func(ctx *cli.Context) error {
c, err := getHalConnection(log)
if err != nil {
return err
}
err = c.BootFrom(hal.BootTargetPXE)
if err != nil {
return err
}
log.Infow("boot", "set to", hal.BootTargetPXE.String())
return nil
},
},
{
Name: "bios",
Usage: "boot to bios",
Flags: flags,
Action: func(ctx *cli.Context) error {
c, err := getHalConnection(log)
if err != nil {
return err
}
err = c.BootFrom(hal.BootTargetBIOS)
if err != nil {
return err
}
log.Infow("boot", "set to", hal.BootTargetBIOS.String())
return nil
},
},
},
}

0 comments on commit a07a845

Please sign in to comment.