Asami Doi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34535 )
Change subject: lib: Throw an error when ramdisk is present but initrd.size is 0 ......................................................................
Patch Set 13:
(7 comments)
https://review.coreboot.org/c/coreboot/+/34535/2/src/lib/fit_payload.c File src/lib/fit_payload.c:
https://review.coreboot.org/c/coreboot/+/34535/2/src/lib/fit_payload.c@249 PS2, Line 249: initrd.size > 0
Please make that a separate check, so that you can print out a warning in this case. […]
Done
https://review.coreboot.org/c/coreboot/+/34535/3/src/lib/fit_payload.c File src/lib/fit_payload.c:
https://review.coreboot.org/c/coreboot/+/34535/3/src/lib/fit_payload.c@249 PS3, Line 249: size
Ok, I added new if-statement to throw an error when the initrd size is 0 and updated the description […]
Done
https://review.coreboot.org/c/coreboot/+/34535/5/src/lib/fit_payload.c File src/lib/fit_payload.c:
https://review.coreboot.org/c/coreboot/+/34535/5/src/lib/fit_payload.c@250 PS5, Line 250: printk(BIOS_ERR, "ERROR: The initrd size is 0.\n");
Checking the size in extract() is better. I moved it to extract(). Thanks.
Done
https://review.coreboot.org/c/coreboot/+/34535/7/src/lib/fit_payload.c File src/lib/fit_payload.c:
https://review.coreboot.org/c/coreboot/+/34535/7/src/lib/fit_payload.c@56 PS7, Line 56:
I update to return true when the size is 0 because I believe that an empty kernel/initrd is not our […]
Done
https://review.coreboot.org/c/coreboot/+/34535/10/src/lib/fit_payload.c File src/lib/fit_payload.c:
https://review.coreboot.org/c/coreboot/+/34535/10/src/lib/fit_payload.c@54 PS10, Line 54: region
I replaced with node. […]
Done
https://review.coreboot.org/c/coreboot/+/34535/10/src/lib/fit_payload.c@78 PS10, Line 78: memcpy(dst, node->data, node->size);
I think the situation "region->size < node->size" never happens in the current implementation. […]
Done
https://review.coreboot.org/c/coreboot/+/34535/12/src/lib/fit_payload.c File src/lib/fit_payload.c:
https://review.coreboot.org/c/coreboot/+/34535/12/src/lib/fit_payload.c@255 PS12, Line 255: printk(BIOS_ERR, "ERROR: The initrd size is 0.\n");
This was my mistake happened during rebasing. I deleted them. Thank you.
Done