Skip to content

Commit 849f885

Browse files
cjcon90meta-codesync[bot]
authored andcommitted
handle flashy validation for yosemite5a7/AST2700
Summary: Currently any attempt to run oobgrader against a ysoemite5a7 device is failing as it cannot verify the image in flashy checks and remediations Let's add a fix to the whole image for the U-Boot version string (step 40) and adding the a7's 4088 KB manifest offset to the candidate list (step 41) Test Plan: ``` $oobgrader --host rtptest6715-oob.snc8.facebook.com --fbpkg-tag openbmc.image.yosemite5a7:v2026.27.1 --flashy-tag 5d49d87 --wait ``` Created job: https://fburl.com/scuba/openbmc_upgrades/b81b19sc BMC successfully upgraded: ``` $ ssh root@rtptest6715-oob.snc8.facebook.com Last login: Mon Jul 27 12:11:30 2026 from 2401:db00:eef0:1120:3520:0:a804:7c6 root@bmc:~# cat /etc/issue OpenBMC Release yosemite5a7-v2026.27.1 ``` Reviewed By: amithash, ryazwinski, williamspatrick Differential Revision: D112993974 fbshipit-source-id: cba093b85dcef6961ed8bafe4528846e9f27c87f
1 parent 86bde84 commit 849f885

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

tools/flashy/lib/validate/compatibility.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,13 @@ var getNormalizedBuildNameFromVersion = func(ver string) (string, error) {
115115
// WARNING: This relies on the U-Boot version string on the image
116116
// there is no guarantee that this will succeed
117117
var GetOpenBMCVersionFromImageFile = func(imageFilePath string) (string, error) {
118-
// mmap the first 1MB of the image file
119-
imageFileBuf, err := fileutils.MmapFileRange(
120-
imageFilePath, 0, 1024*1024, syscall.PROT_READ, syscall.MAP_SHARED,
118+
// mmap the whole image file. The U-Boot version string is near the start of
119+
// flat images, but for container-packaged images (e.g. AST2700/yosemite5a7,
120+
// where U-Boot lives inside a multi-MB u-boot-fit partition) it sits several
121+
// MB in, past any fixed-size window. The regex scan stops at the first match,
122+
// so only the pages up to the match are faulted in.
123+
imageFileBuf, err := fileutils.MmapFile(
124+
imageFilePath, syscall.PROT_READ, syscall.MAP_SHARED,
121125
)
122126
if err != nil {
123127
return "", fmt.Errorf("Unable to read and mmap image file '%v': %v",

tools/flashy/lib/validate/compatibility_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,11 @@ func TestGetNormalizedBuildNameFromVersion(t *testing.T) {
196196
}
197197

198198
func TestGetOpenBMCVersionFromImageFile(t *testing.T) {
199-
// mock and defer restore MmapFileRO
200-
mmapOrig := fileutils.MmapFileRange
199+
// mock and defer restore MmapFile
200+
mmapOrig := fileutils.MmapFile
201201
munmapOrig := fileutils.Munmap
202202
defer func() {
203-
fileutils.MmapFileRange = mmapOrig
203+
fileutils.MmapFile = mmapOrig
204204
fileutils.Munmap = munmapOrig
205205
}()
206206

@@ -247,7 +247,7 @@ func TestGetOpenBMCVersionFromImageFile(t *testing.T) {
247247
}
248248
for _, tc := range cases {
249249
t.Run(tc.name, func(t *testing.T) {
250-
fileutils.MmapFileRange = func(filename string, offset int64, length, prot, flags int) ([]byte, error) {
250+
fileutils.MmapFile = func(filename string, prot, flags int) ([]byte, error) {
251251
if filename != "x" {
252252
t.Errorf("want filename '%v' got '%v'", "x", filename)
253253
}

tools/flashy/lib/validate/partition/p_lfmeta.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ type LFMetaLocations struct {
1919
//
2020
// https://github.com/openbmc/openbmc/blob/2d43f028cd98e622d53365b83c39cd120cac5cc2/meta-phosphor/classes/image_types_phosphor.bbclass#L58
2121
var lfmetaImageMetaLocations = []LFMetaLocations{
22-
{380 * 1024, 4 * 1024}, // default 32 MB layout
23-
{888 * 1024, 8 * 1024}, // default 64 MB and 128 MB layout
22+
{380 * 1024, 4 * 1024}, // default 32 MB layout
23+
{888 * 1024, 8 * 1024}, // default 64 MB and 128 MB layout
24+
{4088 * 1024, 8 * 1024}, // AST2700 (e.g. yosemite5a7): manifest precedes the 4 MB u-boot region
2425
}
2526

2627
func init() {

0 commit comments

Comments
 (0)