Skip to content

Commit

Permalink
Add supermicro.Unmarshal() to config
Browse files Browse the repository at this point in the history
  • Loading branch information
splaspood committed Jun 3, 2024
1 parent 3db7cec commit 421c7b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type VendorConfigManager interface {

Raw(name, value string, menuPath []string)
Marshal() (string, error)
Unmarshal(cfgData string) (biosConfig *supermicroConfig, err error)
}

func NewVendorConfigManager(configFormat, vendorName string, vendorOptions map[string]string) (VendorConfigManager, error) {
Expand Down
5 changes: 5 additions & 0 deletions config/supermicro.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ func (cm *supermicroVendorConfig) Marshal() (string, error) {
}
}

func (cm *supermicroVendorConfig) Unmarshal(cfgData string) (biosConfig *supermicroConfig, err error) {
err = xml.Unmarshal([]byte(cfgData), biosConfig)
return
}

// Generic config options

func (cm *supermicroVendorConfig) EnableTPM() {
Expand Down

0 comments on commit 421c7b7

Please sign in to comment.