MCPcopy Create free account
hub / github.com/coreboot/coreboot / ifwi_replace

Function ifwi_replace

util/cbfstool/ifwitool.c:1790–1823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1788}
1789
1790static enum ifwi_ret ifwi_replace(void)
1791{
1792 if (!param.file_name) {
1793 ERROR("%s: -f option required\n", __func__);
1794 return COMMAND_ERR;
1795 }
1796
1797 if (!param.subpart_name) {
1798 ERROR("%s: -n option required\n", __func__);
1799 return COMMAND_ERR;
1800 }
1801
1802 int type = find_type_by_name(param.subpart_name);
1803 if (type == -1)
1804 return COMMAND_ERR;
1805
1806 const struct subpart_info *curr_subpart = &subparts[type];
1807
1808 if (curr_subpart->attr & AUTO_GENERATED) {
1809 ERROR("Cannot replace auto-generated sub-partitions.\n");
1810 return COMMAND_ERR;
1811 }
1812
1813 if (buffer_size(&ifwi_image.subpart_buf[type]) == 0) {
1814 ERROR("Image does not contain sub-partition %s(%d).\n",
1815 param.subpart_name, type);
1816 return COMMAND_ERR;
1817 }
1818
1819 if (param.dir_ops)
1820 return ifwi_dir_replace(type);
1821
1822 return ifwi_raw_replace(type);
1823}
1824
1825static enum ifwi_ret ifwi_create(void)
1826{

Callers

nothing calls this directly

Calls 4

find_type_by_nameFunction · 0.85
buffer_sizeFunction · 0.85
ifwi_dir_replaceFunction · 0.85
ifwi_raw_replaceFunction · 0.85

Tested by

no test coverage detected