| 1776 | } |
| 1777 | |
| 1778 | static int cbfs_copy(void) |
| 1779 | { |
| 1780 | struct cbfs_image src_image; |
| 1781 | struct buffer src_buf; |
| 1782 | |
| 1783 | if (!param.source_region) { |
| 1784 | ERROR("You need to specify -R/--source-region.\n"); |
| 1785 | return 1; |
| 1786 | } |
| 1787 | |
| 1788 | /* Obtain the source region and convert it to a cbfs_image. */ |
| 1789 | if (!partitioned_file_read_region(&src_buf, param.image_file, |
| 1790 | param.source_region)) { |
| 1791 | ERROR("Region not found in image: %s\n", param.source_region); |
| 1792 | return 1; |
| 1793 | } |
| 1794 | |
| 1795 | if (cbfs_image_from_buffer(&src_image, &src_buf, param.headeroffset)) |
| 1796 | return 1; |
| 1797 | |
| 1798 | return cbfs_copy_instance(&src_image, param.image_region); |
| 1799 | } |
| 1800 | |
| 1801 | static int cbfs_compact(void) |
| 1802 | { |
nothing calls this directly
no test coverage detected