Lines Matching refs:image
56 /** An image partition table entry */
95 the new image format.
124 {"os-image", 0x40000, 0x170000},
151 {"os-image", 0x1f0000, 0x200000},
174 {"os-image", 0x20000, 0x180000},
236 /** Allocates a new image partition */
245 /** Frees an image partition */
330 /** Creates a new image partition with an arbitrary name from a file */
365 Copies a list of image partitions into an image buffer and generates the image partition table while doing so
367 Example image partition table:
370 fwup-ptn os-image base 0x01000 size 0x113b45
377 The firmware image must contain at least the partition-table and support-list partitions
378 to be accepted. There aren't any alignment constraints for the image partitions.
381 from the image partition table are mapped to the corresponding flash partitions during
383 the firmware image.
387 actually start at offset 0x1814 of the image.
389 I think partition-table must be the first partition in the firmware image.
403 error(1, 0, "image partition table overflow?");
415 /** Generates and writes the image MD5 checksum */
427 Generates the firmware image in factory format
434 0004-0013 MD5 hash (hash of a 16 byte salt and the image data starting with byte 0x14)
448 uint8_t *image = malloc(*len);
449 if (!image)
452 put32(image, *len);
455 put32(image+0x14, vendor_len);
456 memcpy(image+0x18, vendor, vendor_len);
457 memset(image+0x18+vendor_len, 0xff, 4092-vendor_len);
459 put_partitions(image + 0x1014, parts);
460 put_md5(image+0x04, image+0x14, *len-0x14);
462 return image;
466 Generates the firmware image in sysupgrade format
468 This makes some assumptions about the provided flash and image partition tables and
483 assert(strcmp(flash_os_image->name, "os-image") == 0);
488 assert(strcmp(image_os_image->name, "os-image") == 0);
494 error(1, 0, "kernel image too big (more than %u bytes)", (unsigned)flash_os_image->size);
496 error(1, 0, "rootfs image too big (more than %u bytes)", (unsigned)flash_file_system->size);
500 uint8_t *image = malloc(*len);
501 if (!image)
504 memset(image, 0xff, *len);
506 memcpy(image, image_os_image->data, image_os_image->size);
507 memcpy(image + flash_soft_version->base - flash_os_image->base, image_soft_version->data, image_soft_version->size);
508 memcpy(image + flash_support_list->base - flash_os_image->base, image_support_list->data, image_support_list->size);
509 memcpy(image + flash_file_system->base - flash_os_image->base, image_file_system->data, image_file_system->size);
511 return image;
521 assert(strcmp(flash_os_image->name, "os-image") == 0);
524 assert(strcmp(image_os_image->name, "os-image") == 0);
528 error(1, 0, "kernel image too big (more than %u bytes)", (unsigned)flash_os_image->size);
530 error(1, 0, "rootfs image too big (more than %u bytes)", (unsigned)flash_file_system->size);
534 uint8_t *image = malloc(*len);
535 if (!image)
538 memset(image, 0xff, *len);
540 memcpy(image, image_os_image->data, image_os_image->size);
541 memcpy(image + flash_file_system->base - flash_os_image->base, image_file_system->data, image_file_system->size);
543 return image;
553 assert(strcmp(flash_os_image->name, "os-image") == 0);
556 assert(strcmp(image_os_image->name, "os-image") == 0);
560 error(1, 0, "kernel image too big (more than %u bytes)", (unsigned)flash_os_image->size);
562 error(1, 0, "rootfs image too big (more than %u bytes)", (unsigned)flash_file_system->size);
566 uint8_t *image = malloc(*len);
567 if (!image)
570 memset(image, 0xff, *len);
572 memcpy(image, image_os_image->data, image_os_image->size);
573 memcpy(image + flash_file_system->base - flash_os_image->base, image_file_system->data, image_file_system->size);
575 return image;
578 /** Generates an image for CPE210/220/510/520 and writes it to a file */
585 parts[3] = read_file("os-image", kernel_image, false);
589 void *image;
591 image = generate_sysupgrade_image(cpe510_partitions, parts, &len);
593 image = generate_factory_image(cpe510_vendor, parts, &len);
599 if (fwrite(image, len, 1, file) != 1)
604 free(image);
611 /** Generates an image for C2600 and writes it to a file */
618 parts[3] = read_file("os-image", kernel_image, false);
622 void *image;
624 image = generate_sysupgrade_image_c2600(c2600_partitions, parts, &len);
626 image = generate_factory_image(c2600_vendor, parts, &len);
632 if (fwrite(image, len, 1, file) != 1)
637 free(image);
644 /** Generates an image for TL1043NDv4 and writes it to a file */
651 parts[3] = read_file("os-image", kernel_image, false);
655 void *image;
657 image = generate_sysupgrade_image_tl1043ndv4(tl1043ndv4_partitions, parts, &len);
659 image = generate_factory_image(tl1043ndv4_vendor, parts, &len);
665 if (fwrite(image, len, 1, file) != 1)
670 free(image);
684 " -B <board> create image for the board specified with <board>\n"
685 " -k <file> read kernel image from the file <file>\n"
686 " -r <file> read rootfs image from the file <file>\n"
690 " -S create sysupgrade instead of factory image\n"
751 error(1, 0, "no kernel image has been specified");
753 error(1, 0, "no rootfs image has been specified");