mirror of
https://github.com/Dasharo/edk2.git
synced 2026-06-13 10:16:24 -07:00
1e7a83cbb6
Currently the FMMT tool supports CRC32 GUID section (Ref. GuidTools.py). But it is found that there are errors for the FV with CRC32 section. For example, the errors are checked on the following commands. --v : Show FV information except for the FV --a : Show "Target Fv not found!!!" when adding an FFS file to the FV --d : Show "Target Ffs not found!!!" when deleting an FFS file in the FV They are caused by the mismatch for CRC32 section data between the FMMT and GenCrc32 tools. The FMMT tool returns CRC32 section data without CRC checksum field (4 bytes). The GenCrc32 tool (with -d option, verify CRC32 value for the input file) requires CRC32 section data including CRC checksum field (4 bytes). Fix the issue through adjusting the section data to include CRC checksum field. Currently DataOffset field for CRC32 GUID section is reported as 0x1C differently (GUID Section header length: 0x18 + Checksum field: 0x4). Instead of DataOffset field that includes CRC checksum field, configure the section data based on the offset from section header length (0x18) that was previously calculated. This update enables GUID sections to use the same offset consistently. Signed-off-by: Phil Noh <Phil.Noh@amd.com>