Skip to content

Commit 80da032

Browse files
kawmarcometa-codesync[bot]
authored andcommitted
Don't run step on LF OpenBMC
Summary: See T250939868 for context, step is currently not compatible with LF OpenBMC as we don't ensure mountpoints targeted at the SPI flash are unmounted as we do with Meta OpenBMC releases Test Plan: Unit tests, run step in a ventura unit, ensure it gets skipped (thanks cjcon90): P2114946883 Deploy flashy to a test morgan800cc device: ``` ~/fbcode/openbmc/openbmc/tools/flashy$ scripts/run_flashy_remote.sh --device mtd:flash0 --imagepath $( (cd $(mktemp -d) && fbpkg fetch openbmc.image.morgan800cc && readlink -f flash-morgan800cc) ) --host fboss329013173-oob.ash7 --dry-run ``` Run step, ensure it runs as expected: ``` root@fboss329013173-oob:~# /run/flashy/checks_and_remediations/common/91_expose_real_flash0_on_secondary_boot_g6 --device mtd:flash0 --ima gepath /dev/null 2026/01/12 03:02:22 Not starting PetWatchdogLoop; BMC Lite 2026/01/12 03:02:22 Starting: checks_and_remediations/common/91_expose_real_flash0_on_secondary_boot_g6 2026/01/12 03:02:23 WDT2 second boot code flag @ 0x1e620064 not active (current value = 0x0), skipping step 2026/01/12 03:02:23 Finished: checks_and_remediations/common/91_expose_real_flash0_on_secondary_boot_g6 ``` Reviewed By: cjcon90 Differential Revision: D90387321 fbshipit-source-id: 96d6de69b95e06bf0eca79d7fedb211433c83a9f
1 parent c031067 commit 80da032

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

tools/flashy/checks_and_remediations/common/91_expose_real_flash0_on_secondary_boot_g6.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ func ExposeRealFlash0OnSecondaryBootG6(stepParams step.StepParams) step.StepExit
5050
return step.ExitSafeToReboot{Err: errors.Errorf("Unable to fetch machine: %v", err)}
5151
}
5252

53+
// T250939868: LF OpenBMC doesn't support this as the overlay partitions are still mounted
54+
if utils.IsLFOpenBMC() {
55+
log.Printf("Skipping step for LF OpenBMC")
56+
return nil
57+
}
58+
5359
// Bail if not running on AST2600
5460
if machine != "armv7l" {
5561
log.Printf("Remediation handles only AST2600")

tools/flashy/checks_and_remediations/common/91_expose_real_flash0_on_secondary_boot_g6_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,33 @@ func TestExposeRealFlash0OnSecondaryBootAstG6(t *testing.T) {
154154

155155
})
156156

157+
t.Run("Should skip if LF OpenBMC", func(t *testing.T) {
158+
var buf bytes.Buffer
159+
log.SetOutput(&buf)
160+
161+
GetMachineOrig := utils.GetMachine
162+
defer func() { utils.GetMachine = GetMachineOrig }()
163+
IsLFOpenBMCOrig := utils.IsLFOpenBMC
164+
defer func() { utils.IsLFOpenBMC = IsLFOpenBMCOrig }()
165+
166+
utils.GetMachine = func() (string, error) { return "armv7l", nil }
167+
utils.IsLFOpenBMC = func() bool { return true }
168+
169+
res := ExposeRealFlash0OnSecondaryBootG6(step.StepParams{})
170+
171+
if res != nil {
172+
t.Errorf("Expected ExposeRealFlash0OnSecondaryBoot() to return nil, got %v", res)
173+
}
174+
175+
re_expected_log_buffer := "" +
176+
"^[^\n]+Skipping step for LF OpenBMC"
177+
178+
if !regexp.MustCompile(re_expected_log_buffer).Match(buf.Bytes()) {
179+
t.Errorf("Unexpected log buffer: %v", buf.String())
180+
}
181+
182+
})
183+
157184
t.Run("Should bail out if not running on AST2600", func(t *testing.T) {
158185
var buf bytes.Buffer
159186
log.SetOutput(&buf)

0 commit comments

Comments
 (0)