Julius Werner has posted comments on this change. ( https://review.coreboot.org/21608 )
Change subject: util/cbfstool: Add "truncate" command ......................................................................
Patch Set 1:
(3 comments)
https://review.coreboot.org/#/c/21608/1/util/cbfstool/cbfs_image.c File util/cbfstool/cbfs_image.c:
https://review.coreboot.org/#/c/21608/1/util/cbfstool/cbfs_image.c@507 PS1, Line 507: * empty, we still want to keep it or we remove the entire filesystem. I'd say this (removing the entire filesystem) would be the more natural thing to do here. It might make sense in edge cases, e.g. imagine a situation where you have an extra CBFS FMAP section somewhere that may optionally contain something (we actually have that with RW_LEGACY already, although it's not verified). If the build system decides (from config options or whatever) not to add any files, you would still want it truncated so that it doesn't waste bytes on verification.
https://review.coreboot.org/#/c/21608/1/util/cbfstool/cbfs_image.c@509 PS1, Line 509: * If that file is empty, remove it and report its header's offset as nit: Put this comment in front of the next if() so it's clear which comment belongs to what code section.
https://review.coreboot.org/#/c/21608/1/util/cbfstool/cbfs_image.c@519 PS1, Line 519: /* nothing to truncate */ In both of the return 1 cases, should size be adjusted to the actual end of the CBFS? It might be different from buffer_size if the CBFS had already been truncated previously.