| 1419 | } |
| 1420 | |
| 1421 | static enum ifwi_ret ibbp_dir_add(int type) |
| 1422 | { |
| 1423 | #define DUMMY_IBB_SIZE (4 * KiB) |
| 1424 | |
| 1425 | assert(type == IBB_TYPE); |
| 1426 | |
| 1427 | /* |
| 1428 | * Entry # 1 - IBBP.man |
| 1429 | * Contains manifest header and signed pkg info extension. |
| 1430 | */ |
| 1431 | struct buffer manifest; |
| 1432 | size_t size = MANIFEST_HDR_SIZE + SIGNED_PKG_INFO_EXT_SIZE; |
| 1433 | alloc_buffer(&manifest, size, "IBBP.man"); |
| 1434 | |
| 1435 | struct manifest_header *man_hdr = buffer_get(&manifest); |
| 1436 | init_manifest_header(man_hdr, size); |
| 1437 | |
| 1438 | struct signed_pkg_info_ext *ext; |
| 1439 | ext = (struct signed_pkg_info_ext *)(man_hdr + 1); |
| 1440 | |
| 1441 | init_signed_pkg_info_ext(ext, 0, subparts[type].name); |
| 1442 | |
| 1443 | /* Entry # 2 - IBBL */ |
| 1444 | struct buffer ibbl; |
| 1445 | if (buffer_from_file(&ibbl, param.file_name)) |
| 1446 | return COMMAND_ERR; |
| 1447 | |
| 1448 | /* Entry # 3 - IBB */ |
| 1449 | struct buffer ibb; |
| 1450 | alloc_buffer(&ibb, DUMMY_IBB_SIZE, "IBB"); |
| 1451 | memset(buffer_get(&ibb), 0xFF, DUMMY_IBB_SIZE); |
| 1452 | |
| 1453 | /* Create subpartition. */ |
| 1454 | struct buffer *info[] = { |
| 1455 | &manifest, &ibbl, &ibb, |
| 1456 | }; |
| 1457 | create_subpart(&ifwi_image.subpart_buf[type], &info[0], |
| 1458 | ARRAY_SIZE(info), subparts[type].name); |
| 1459 | |
| 1460 | return REPACK_REQUIRED; |
| 1461 | } |
| 1462 | |
| 1463 | static enum ifwi_ret ifwi_raw_add(int type) |
| 1464 | { |
nothing calls this directly
no test coverage detected