Skip to content

Commit

Permalink
Skip bios modification on newer boards (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 authored Mar 14, 2024
1 parent a4e1cfa commit 5f42396
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go 1.21
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: '1.21.x'
go-version: '1.22.x'

- name: Lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
args: -p bugs -p unused

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/metal-stack/go-hal

go 1.21
go 1.22

require (
github.com/avast/retry-go/v4 v4.5.1
Expand All @@ -19,7 +19,7 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/crypto v0.20.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/vmware/goipmi v0.0.0-20181114221114-2333cd82d702 h1:yx587LNBbOpIxzCBHBiI94Wx8ryIAFlu1w0lDwm64cA=
github.com/vmware/goipmi v0.0.0-20181114221114-2333cd82d702/go.mod h1:YiWonbS/PuCtti3wt9jl+FvNEJ7c0nvmjGoEYxdjyk0=
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg=
golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
Expand Down
12 changes: 11 additions & 1 deletion internal/vendors/supermicro/sum.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const (
X11DPU
// N1 Firewall
X11SDD_8C_F
// G1 GPU machine
X13DDW_A
)

var (
Expand All @@ -39,6 +41,8 @@ var (
"X11DPU": X11DPU,
// N1 Firewall
"X11SDD-8C-F": X11SDD_8C_F,
// G1 GPU Machine
"X13DDW-A": X13DDW_A,
}

// SUM does not complain or fail if more boot options are given than actually available
Expand Down Expand Up @@ -256,7 +260,7 @@ func (s *sum) ConfigureBIOS() (bool, error) {
s.log.Infow("firmware", "is", firmware, "board", s.boardModel, "boardname", s.boardName)

// We must not configure the Bios if UEFI is already activated and the board is one of the following.
if firmware == kernel.EFI && (s.boardModel == X11SDV_8C_TP8F || s.boardModel == X11SDD_8C_F) {
if firmware == kernel.EFI && (s.boardModel == X11SDV_8C_TP8F || s.boardModel == X11SDD_8C_F || s.boardModel == X13DDW_A) {
return false, nil
}

Expand Down Expand Up @@ -284,6 +288,10 @@ func (s *sum) ConfigureBIOS() (bool, error) {
// EnsureBootOrder ensures BIOS boot order so that boot from the given allocated OS image is attempted before PXE boot.
func (s *sum) EnsureBootOrder(bootloaderID string) error {
s.bootloaderID = bootloaderID
if s.boardModel == X13DDW_A {
s.log.Infow("GPU board detected, skip bios modification", "board", s.boardName)
return nil
}

err := s.prepare()
if err != nil {
Expand Down Expand Up @@ -419,6 +427,8 @@ func (s *sum) checkBootOptionAt(index int, bootOption string) bool {
if setting.Name != fmt.Sprintf("UEFI Boot Option #%d", index) {
continue
}
case X13DDW_A:
// FIXME
}

return strings.Contains(setting.SelectedOption, bootOption)
Expand Down

0 comments on commit 5f42396

Please sign in to comment.