| 740 | } |
| 741 | |
| 742 | static int cmd_create_bpdt(void) |
| 743 | { |
| 744 | struct buffer buff; |
| 745 | struct buffer wbuff; |
| 746 | |
| 747 | if (allocate_buffer(&buff, &wbuff, "BPDT header")) |
| 748 | return -1; |
| 749 | |
| 750 | ifwi.bpdt_hdr = ifwi.bpdt_ops->create_hdr(); |
| 751 | if (!ifwi.bpdt_hdr) { |
| 752 | ERROR("Failed to create BPDT header!\n"); |
| 753 | return -1; |
| 754 | } |
| 755 | |
| 756 | ifwi.bpdt_ops->update_checksum(ifwi.bpdt_hdr, NULL); |
| 757 | |
| 758 | if (ifwi.bpdt_ops->write_hdr(&wbuff, ifwi.bpdt_hdr)) { |
| 759 | ERROR("Failed to write BPDT header!\n"); |
| 760 | return -1; |
| 761 | } |
| 762 | |
| 763 | buffer_write_file(&buff, params.image_name); |
| 764 | return 0; |
| 765 | } |
| 766 | |
| 767 | static int cmd_add(void) |
| 768 | { |
nothing calls this directly
no test coverage detected