diff options
author | Reka Norman <rekanorman@google.com> | 2021-09-20 12:19:16 +1000 |
---|---|---|
committer | Furquan Shaikh <furquan@google.com> | 2021-09-23 07:51:22 +0000 |
commit | 8f690dd7623c3a5a455443a1d9398f8deca5fbf3 (patch) | |
tree | c7a208cfdd0afb53a03ec53bb7520067fa45d0b4 /util/spd_tools | |
parent | 273a9eb830daabac8c29819138d18163e817eb03 (diff) |
util/spd_tools: Sort platforms_manifest entries by set number
Ensure that the order of entries in each platform manifest is consistent
every time spd_gen is run.
BUG=b:191776301
TEST=Run spd_gen for lp4x and ddr4, check that the manifests are
unchanged.
Change-Id: I7bfea65c8fc781df80a8725c0cf20c7547c857e8
Signed-off-by: Reka Norman <rekanorman@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57773
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'util/spd_tools')
-rw-r--r-- | util/spd_tools/src/spd_gen/spd_gen.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/util/spd_tools/src/spd_gen/spd_gen.go b/util/spd_tools/src/spd_gen/spd_gen.go index eb37751172..57b428b2b3 100644 --- a/util/spd_tools/src/spd_gen/spd_gen.go +++ b/util/spd_tools/src/spd_gen/spd_gen.go @@ -10,6 +10,7 @@ import ( "path/filepath" "reflect" "regexp" + "sort" "strings" ) @@ -191,9 +192,15 @@ func writeSetMap(setMap map[int][]int, SPDDirName string) { s += getGeneratedString() - for index, arr := range setMap { - for _, item := range arr { - s += fmt.Sprintf("%s,set-%d\n", platformNames[item], index) + var setNumbers []int + for k, _ := range setMap { + setNumbers = append(setNumbers, k) + } + sort.Ints(setNumbers) + + for _, num := range setNumbers { + for _, item := range setMap[num] { + s += fmt.Sprintf("%s,set-%d\n", platformNames[item], num) } } |