Skip to content

Commit

Permalink
bake: add new MAC address range used by Raspberry Pi 4
Browse files Browse the repository at this point in the history
  • Loading branch information
stapelberg committed May 21, 2020
1 parent 197bd5d commit 6bea167
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/bake/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ func testMacAddress() error {
}
time.Sleep(time.Duration(i) * time.Second)
}

if !strings.HasPrefix(string(b), "b8:27:eb:") &&
!strings.HasPrefix(string(b), "dc:a6:32:") &&
!strings.HasPrefix(string(b), "00:0d:b9:") {
return fmt.Errorf("MAC address %q does not start with b8:27:eb: (Raspberry Pi Foundation) or 00:0d:b9: (PC Engines GmbH)", string(b))
return fmt.Errorf("MAC address %q does not start with any of:\n\tb8:27:eb: (Raspberry Pi Foundation)\n\tdc:a6:32: (Raspberry Pi Trading Ltd)\n\t00:0d:b9: (PC Engines GmbH)", string(b))
}
return nil
}
Expand All @@ -37,6 +39,8 @@ func main() {
result = fmt.Sprintf("FAILURE: testMacAddress: %v\n", err)
}

log.Print(result)

// No need to configure the serial port, the serial console is
// already set up.
if err := ioutil.WriteFile("/dev/console", []byte(result), 0644); err != nil {
Expand Down

0 comments on commit 6bea167

Please sign in to comment.