Image replicator intro

From embeddedTS Manuals
Revision as of 19:14, 8 February 2022 by Kris (talk | contribs) (Still WIP)

This platform supports our Image Replicator tool. The Image Replicator tool is intended for use by our end customers as a means to format and load bootable images or filesystems on to a device's media (SD/eMMC/SATA/etc.) as part of their production process. In addition to writing media, the Image Replicator tool is capable of capturing images from a unit. This golden image can then be used to write other units.

The Image Replicator tool is a bootable USB drive based on Busybox with a set of scripts to handle the capture and write processes. This process, however, is flexible and can be used as-is or adapted in to larger production processes to format and load data on to devices. The single USB drive can be used to capture images from a unit, and then can be inserted in to other units to write those same images back to other devices.


Image Capture Process

The image capture process does the following steps. For more detailed information, see the NEED SECTION NAME below.

  1. If no valid images exist on the disk, image capture starts.
  2. For each valid media present on the unit, a bit for bit copy of the source is made.
  3. This image is mounted, sanitized (to remove unneeded files and safely allow copying to other units), and saved as either a disk image or a tarball depending on the partition layout of the source disk
  4. All images and tarballs are compressed, with both the output files having their MD5 hash saved as well as all of the files contained in the root partition having their MD5 hashes saved to a file for later verification.

The images and tarballs are named such that the disk can be immediately used to boot another unit and write the images to its media.

Note that when using this process, the USB drive used must be sized large enough to handle multiple compressed images as well as the uncompressed copy of the media image actively being worked with. If the image capture process runs out of space, the process will indicate a failure.


Image Write Process

The image write process takes the following steps. For more details information see NEED SECTION NAME below.

  1. For each valid media present on the unit, find the first valid source image file for it; either disk image or tarball.
  2. If a source image exists for a media that is not present on the unit, then the process indicates a failure.
  3. If the source image is a tarball, format the target disk with an appropriate filesystem, and unpack it to that disk, verifying all files against the MD5 hash file list after they are written.
  4. If the source image is a disk image, write that to the target disk. If an MD5 file for the disk image exists, read back the written disk and compare it to the hash.