[coreboot-gerrit] Change in coreboot[master]: google/grunt: extract OEM string from CBFS

Kevin Chiu (Code Review) gerrit at coreboot.org
Wed Oct 3 04:16:05 CEST 2018


Kevin Chiu has uploaded this change for review. ( https://review.coreboot.org/28889


Change subject: google/grunt: extract OEM string from CBFS
......................................................................

google/grunt: extract OEM string from CBFS

In CBFS layout:
oem.bin size is 10 bytes.

In cbfs_boot_load_file, buffer size will need to be larger than decompressed_size,
otherwise CBFS data can not be extracted into buffer.
Then we need to check buffer whether it's empty string separately.

BUG=b:79874904
BRANCH=master
TEST=emerge-grunt coreboot
Change-Id: I4f1bbb690ecca515ac920f5058ee19b5bfd8fa5e
Signed-off-by: Kevin Chiu <Kevin.Chiu at quantatw.com>
---
M src/mainboard/google/kahlee/variants/baseboard/mainboard.c
1 file changed, 4 insertions(+), 3 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/28889/1

diff --git a/src/mainboard/google/kahlee/variants/baseboard/mainboard.c b/src/mainboard/google/kahlee/variants/baseboard/mainboard.c
index d60023f..3e84a7b 100644
--- a/src/mainboard/google/kahlee/variants/baseboard/mainboard.c
+++ b/src/mainboard/google/kahlee/variants/baseboard/mainboard.c
@@ -88,9 +88,10 @@
 	if (manuf)
 		return manuf;
 
-	if (cbfs_boot_load_file("oem.bin", oem_bin_data,
-					    sizeof(oem_bin_data) - 1,
-					    CBFS_TYPE_RAW))
+	cbfs_boot_load_file("oem.bin", oem_bin_data,
+					    sizeof(oem_bin_data),
+					    CBFS_TYPE_RAW);
+	if(oem_bin_data[0] != '\0')
 		manuf = &oem_bin_data[0];
 	else
 		manuf = CONFIG_MAINBOARD_SMBIOS_MANUFACTURER;

-- 
To view, visit https://review.coreboot.org/28889
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f1bbb690ecca515ac920f5058ee19b5bfd8fa5e
Gerrit-Change-Number: 28889
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Chiu <Kevin.Chiu at quantatw.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181003/4aceab8b/attachment-0001.html>


More information about the coreboot-gerrit mailing list