util/spd_tools: Support comments in mem_parts_used

Allow comments prefixed with '#' in mem_parts_used csv file.

BUG=None
TEST=Run gen_part_id with mem_parts_used file containing comments

Change-Id: Ia9e274d45aa06dea7a3a5f8cd1c8ee2b23398876
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44950
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Rob Barnes
2020-08-31 15:17:38 -06:00
committed by Patrick Georgi
parent eeb4705fff
commit ad1da3a326
9 changed files with 73 additions and 0 deletions

View File

@ -68,6 +68,7 @@ func readParts(memPartsUsedFileName string) ([]usedPart, error) {
r := csv.NewReader(f)
r.FieldsPerRecord = -1 // Allow variable length records
r.TrimLeadingSpace = true
r.Comment = '#'
parts := []usedPart{}