Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Asrockrack e3C256D4ID-NL #366

Merged
merged 2 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions providers/asrockrack/firmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ func (a *ASRockRack) firmwareUpdateStatus(ctx context.Context, component string,

switch installStatus {
case versionStrMatch:
ofaurax marked this conversation as resolved.
Show resolved Hide resolved
if progress == nil {
// TODO: we should pass the force parameter to firmwareUpdateStatus,
// so that we can know if we expect a version change or not
a.log.V(3).Info("Nil progress + no version change -> unknown")
return constants.FirmwareInstallUnknown, nil
}

return constants.FirmwareInstallComplete, nil
case versionStrEmpty:
return constants.FirmwareInstallUnknown, nil
Expand Down
5 changes: 5 additions & 0 deletions providers/asrockrack/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ func (a *ASRockRack) uploadFirmware(ctx context.Context, endpoint string, fwRead
fieldName, fileName := "fwimage", "image"
contentLength := multipartSize(fieldName, fileName) + fileSize

// Before reading the file, rewind to the beginning
if file, ok := fwReader.(*os.File); ok {
_, _ = file.Seek(0, 0)
}

// setup pipe
pipeReader, pipeWriter := io.Pipe()
defer pipeReader.Close()
Expand Down