Skip to content

Commit

Permalink
detect meru as a BMC-lite platform
Browse files Browse the repository at this point in the history
Summary: We should automate this with platforms.json somehow but no time right now.

Test Plan:
Build & unit test:

```
0 ~/local/openbmc/tools/flashy $ ./build.sh && ./build_dev.sh && go test ./...
ok      github.com/facebook/openbmc/tools/flashy        (cached)
ok      github.com/facebook/openbmc/tools/flashy/checks_and_remediations/bletchley      (cached)
?       github.com/facebook/openbmc/tools/flashy/flash_procedure        [no test files]
ok      github.com/facebook/openbmc/tools/flashy/checks_and_remediations/common (cached)
ok      github.com/facebook/openbmc/tools/flashy/checks_and_remediations/galaxy100      (cached)
ok      github.com/facebook/openbmc/tools/flashy/checks_and_remediations/wedge100       (cached)
ok      github.com/facebook/openbmc/tools/flashy/checks_and_remediations/yamp   (cached)
?       github.com/facebook/openbmc/tools/flashy/lib/logger     [no test files]
?       github.com/facebook/openbmc/tools/flashy/utilities      [no test files]
?       github.com/facebook/openbmc/tools/flashy/tests  [no test files]
ok      github.com/facebook/openbmc/tools/flashy/install        (cached)
ok      github.com/facebook/openbmc/tools/flashy/lib/fileutils  (cached)
ok      github.com/facebook/openbmc/tools/flashy/lib/flash      (cached)
ok      github.com/facebook/openbmc/tools/flashy/lib/flash/flashcp      (cached)
ok      github.com/facebook/openbmc/tools/flashy/lib/flash/flashutils   (cached)
ok      github.com/facebook/openbmc/tools/flashy/lib/flash/flashutils/devices   (cached)
ok      github.com/facebook/openbmc/tools/flashy/lib/step       (cached)
ok      github.com/facebook/openbmc/tools/flashy/lib/utils      (cached)
ok      github.com/facebook/openbmc/tools/flashy/lib/validate   (cached)
ok      github.com/facebook/openbmc/tools/flashy/lib/validate/image     (cached)
ok      github.com/facebook/openbmc/tools/flashy/lib/validate/partition (cached)
```

Reviewed By: cjcon90

Differential Revision: D51814249

fbshipit-source-id: 45a3f7735178dd8aa5e44f3c5715e317b646d0a7
  • Loading branch information
doranand authored and facebook-github-bot committed Dec 4, 2023
1 parent 2517b18 commit 6a64b36
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/flashy/lib/utils/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,19 @@ var IsLFOpenBMC = func() (bool) {
// IsBMCLite check whether the system is running BMC-lite
// For S368275. Make this beautiful later.
var IsBMCLite = func() (bool) {
const magic = "fbdarwin"
magics := []string{"fbdarwin", "meru"}

issueBuf, err := fileutils.ReadFile(etcIssueFilePath)
if err != nil {
return false
}

return strings.Contains(string(issueBuf), magic)
for _, magic := range magics {
if strings.Contains(string(issueBuf), magic) {
return true;
}
}
return false
}

// CheckOtherFlasherRunning return an error if any other flashers are running.
Expand Down

0 comments on commit 6a64b36

Please sign in to comment.