diff --git a/providers/asrockrack/firmware.go b/providers/asrockrack/firmware.go index 8cd56040..54421696 100644 --- a/providers/asrockrack/firmware.go +++ b/providers/asrockrack/firmware.go @@ -76,6 +76,9 @@ func (a *ASRockRack) firmwareInstallBMC(ctx context.Context, reader io.Reader, f return errors.Wrap(err, "failed to get model in step 0/4") } + mybytes, err := io.ReadAll(reader) + fmt.Printf("ReadAll reader afterFRU len:%d\n", len(mybytes)) + // 1. set the device to flash mode - prepares the flash // Beware: this locks some capabilities, e.g. the access to fruAttributes a.log.V(2).WithValues("step", "1/4").Info("set device to flash mode, takes a minute...") @@ -84,6 +87,9 @@ func (a *ASRockRack) firmwareInstallBMC(ctx context.Context, reader io.Reader, f return errors.Wrap(err, "failed in step 1/4 - set device to flash mode") } + mybytes, err = io.ReadAll(reader) + fmt.Printf("ReadAll reader after setFlashMode len:%d\n", len(mybytes)) + // 2. upload firmware image file fwEndpoint := "api/maintenance/firmware" // E3C256D4ID-NL calls a different endpoint for firmware upload @@ -91,7 +97,7 @@ func (a *ASRockRack) firmwareInstallBMC(ctx context.Context, reader io.Reader, f fwEndpoint = "api/maintenance/firmware/firmware" } - mybytes, err := io.ReadAll(reader) + mybytes, err = io.ReadAll(reader) fmt.Printf("ReadAll reader before uploadFW len:%d\n", len(mybytes)) a.log.V(2).WithValues("step", "2/4").Info("upload BMC firmware image to " + fwEndpoint)