@@ -3,6 +3,7 @@ package config
3
3
import (
4
4
"bytes"
5
5
"encoding/xml"
6
+ "fmt"
6
7
"strings"
7
8
8
9
"golang.org/x/net/html/charset"
@@ -66,7 +67,7 @@ func NewSupermicroVendorConfigManager(configFormat string, vendorOptions map[str
66
67
func (cm * supermicroVendorConfig ) FindOrCreateSetting (path []string , value string ) * supermicroBiosCfgSetting {
67
68
biosCfg := cm .ConfigData .BiosCfg
68
69
69
- var currentMenus * [] * supermicroBiosCfgMenu = & biosCfg .Menus
70
+ var currentMenus = & biosCfg .Menus
70
71
71
72
for i , part := range path {
72
73
if i == len (path )- 1 {
@@ -98,8 +99,10 @@ func (cm *supermicroVendorConfig) FindOrCreateMenu(menus *[]*supermicroBiosCfgMe
98
99
return (* menus )[i ]
99
100
}
100
101
}
102
+
101
103
newMenu := & supermicroBiosCfgMenu {Name : name }
102
104
* menus = append (* menus , newMenu )
105
+
103
106
return (* menus )[len (* menus )- 1 ]
104
107
}
105
108
@@ -256,14 +259,16 @@ func (cm *supermicroVendorConfig) BootOrder(mode string) error {
256
259
case "LEGACY" :
257
260
cm .Raw ("Legacy Boot Option #1" , "Hard Disk" , []string {"Boot" })
258
261
cm .Raw ("Legacy Boot Option #2" , "Network" , []string {"Boot" })
262
+
259
263
for i := 3 ; i < 8 ; i ++ {
260
- cm .Raw ("Legacy Boot Option #" + string (i ), "Disabled" , []string {"Boot" })
264
+ cm .Raw ("Legacy Boot Option #" + fmt . Sprint (i ), "Disabled" , []string {"Boot" })
261
265
}
262
266
case "UEFI" :
263
267
cm .Raw ("UEFI Boot Option #1" , "UEFI Hard Disk" , []string {"Boot" })
264
268
cm .Raw ("UEFI Boot Option #2" , "UEFI Network" , []string {"Boot" })
269
+
265
270
for i := 3 ; i < 9 ; i ++ {
266
- cm .Raw ("UEFI Boot Option #" + string (i ), "Disabled" , []string {"Boot" })
271
+ cm .Raw ("UEFI Boot Option #" + fmt . Sprint (i ), "Disabled" , []string {"Boot" })
267
272
}
268
273
case "DUAL" :
269
274
// TODO(jwb) Is this just both sets?
@@ -287,11 +292,10 @@ func (cm *supermicroVendorConfig) IntelSGX(mode string) error {
287
292
}
288
293
289
294
func (cm * supermicroVendorConfig ) SecureBoot (enable bool ) error {
290
- if enable {
291
- cm .Raw ("Secure Boot" , "Enabled" , []string {"SMC Secure Boot Configuration" })
292
- // cm.Raw("Secure Boot Mode", "Setup", []string{"SMC Secure Boot Configuration"})
293
- } else {
295
+ if ! enable {
294
296
cm .Raw ("Secure Boot" , "Disabled" , []string {"SMC Secure Boot Configuration" })
297
+ } else {
298
+ cm .Raw ("Secure Boot" , "Enabled" , []string {"SMC Secure Boot Configuration" })
295
299
}
296
300
297
301
return nil
@@ -323,6 +327,5 @@ func (cm *supermicroVendorConfig) SMT(enable bool) error {
323
327
324
328
func (cm * supermicroVendorConfig ) SRIOV (enable bool ) error {
325
329
// TODO(jwb) Need to figure out how we do this on platforms that support it...
326
-
327
330
return nil
328
331
}
0 commit comments