@@ -21,13 +21,13 @@ package common
2121
2222import (
2323 "encoding/binary"
24+ "fmt"
2425 "log"
2526 "os"
2627 "syscall"
2728
2829 "github.com/facebook/openbmc/tools/flashy/lib/step"
2930 "github.com/facebook/openbmc/tools/flashy/lib/utils"
30- "github.com/pkg/errors"
3131)
3232
3333// From ASPEED AST2400/AST1250 A1 Datasheet – V1.3, p524
@@ -51,7 +51,7 @@ func init() {
5151func ExposeRealFlash0OnSecondaryBoot (stepParams step.StepParams ) step.StepExitError {
5252 machine , err := utils .GetMachine ()
5353 if err != nil {
54- return step.ExitSafeToReboot {Err : errors .Errorf ("Unable to fetch machine: %v " , err )}
54+ return step.ExitSafeToReboot {Err : fmt .Errorf ("Unable to fetch machine: %w " , err )}
5555 }
5656
5757 // Bail if not running on AST2400 (armv5tejl) nor AST2500 (armv6l)
@@ -62,7 +62,7 @@ func ExposeRealFlash0OnSecondaryBoot(stepParams step.StepParams) step.StepExitEr
6262
6363 mem , err := MmapDevMemRw ()
6464 if err != nil {
65- return step.ExitSafeToReboot {Err : errors .Errorf ("Unable to mmap /dev/mem: %v " , err )}
65+ return step.ExitSafeToReboot {Err : fmt .Errorf ("Unable to mmap /dev/mem: %w " , err )}
6666 }
6767 defer Munmap (mem )
6868
@@ -98,7 +98,7 @@ var ResetWDT2StatusReg = func(mem []byte) error {
9898
9999 wdt2_status_reg := ReadWDT2StatusReg (mem )
100100 if wdt2_status_reg & 0b10 == 0b10 {
101- return errors .Errorf ("Unable to clear WDT2 second boot code flag @ 0x%x, current value = 0x%x" , WDT2_STATUS_REG_ADDR , wdt2_status_reg )
101+ return fmt .Errorf ("Unable to clear WDT2 second boot code flag @ 0x%x, current value = 0x%x" , WDT2_STATUS_REG_ADDR , wdt2_status_reg )
102102 }
103103
104104 return nil
0 commit comments