Image replicator generic

From embeddedTS Manuals
Revision as of 16:34, 17 January 2022 by Lionel (talk | contribs) (Links auto-updated for 2022 re-branding ( https://github.com/embeddedarm/buildroot-ts →‎ https://github.com/embeddedTS/buildroot-ts))

The blast image and scripts require a minimum of 50 MB; this plus any disk images or tarballs used dictate the minimum disk size required. The USB drive must have at least 1 partition, with the first partition being formatted ext2/3 or fat32/vfat.

Note: The ext4 filesystem can be used instead of ext3, but it may require additional options. U-Boot does not support the 64bit addressing added as the default behavior in recent revisions of mkfs.ext4. If using e2fsprogs 1.43 or newer, the options "-O ^64bit,^metadata_csum" must be used with ext4 for proper compatibility. Older versions of e2fsprogs do not need these options passed nor are they needed for ext3.
# This assumes USB drive is /dev/sdc:
sudo mkfs.ext3 /dev/sdc1
sudo mkdir /mnt/usb/
sudo mount /dev/sdc1 /mnt/usb/
sudo tar --numeric-owner -xf /path/to/tsimx6ul_usb_blaster-latest.tar.bz2 -C /mnt/usb/

At this point, disk images or tarballs would be copied to the /mnt/usb/ folder and named as noted below. The latest disk images we provide can be downloaded from our FTP site, see the backup and restore section for links to these files. Note that the script expects images and tarballs to have specific names. When using an ext* filesystem, symlinks can be used.

The formatted USB drive boots into a small Buildroot initramfs environment with filesystem and partitioning tools installed. This can be used to format SD, eMMC, or other disks. The Buildroot environment starts up and calls /blast.sh on the USB device. By default this script is set up to look for a number of of specific files on the USB disk and write these to media on the host device. Upon completion of the script the green or red LEDs will blink to visually indicate a pass or fail of the script. This script can be used without modification to write images from USB with these filenames:

Target device Accepted filenames Description
SD Card
  • sdimage.tar.xz
  • sdimage.tar.bz2
  • sdimage.tar.gz
  • sdimage.tar
Tar of the filesystem. This will repartition the SD card to a single partition and extract this tarball to the filesystem. If present, a file named /md5sums.txt in the tarball will have its contents checked against after the tarball is extracted. This md5sums.txt file is optional and can be omitted, but it must not be blank if present. This file is present in our official images and is created during image capture with the image replicator tool.
  • sdimage.dd.xz
  • sdimage.dd.bz2
  • sdimage.dd.gz
  • sdimage.dd
Disk image of the card. This will be written to the SD card block device directly. If present on the USB drive, a file named sdimage.dd.md5 will be used to verify the data written to the SD card against this checksum. This file is provided with our official images and is created during image capture with the image replicator tool.
eMMC
  • emmcimage.tar.xz
  • emmcimage.tar.bz2
  • emmcimage.tar.gz
  • emmcimage.tar
Tar of the filesystem. This will repartition the eMMC to a single partition and extract this tarball to the filesystem. If present, a file named /md5sums.txt in the tarball will have its contents checked against after the tarball is extracted. This md5sums.txt file is optional and can be omitted, but it must not be blank if present. This file is present in our official images and is created during image capture with the image replicator tool.
  • emmcimage.dd.xz
  • emmcimage.dd.bz2
  • emmcimage.dd.gz
  • emmcimage.dd
Disk image of the card. This will be written to the eMMC block device directly. If present on the USB drive, a file named emmcimage.dd.md5 will be used to verify the data written to the SD card against this checksum. This file is provided with our official images and is created during image capture with the image replicator tool.
SATA
  • sataimage.tar.xz
  • sataimage.tar.bz2
  • sataimage.tar.gz
  • sataimage.tar
Tar of the filesystem. This will repartition the first SATA drive with a single partition and extract this tarball to the filesystem. If present, a file named /md5sums.txt in the tarball will have its contents checked against after the tarball is extracted. This md5sums.txt file is optional and can be omitted, but it must not be blank if present. This file is present in our official images and is created during image capture with the image replicator tool.
  • sataimage.dd.xz
  • sataimage.dd.bz2
  • sataimage.dd.gz
  • sataimage.dd
Disk image of the card. This will be written to the first SATA block device directly. If present on the USB drive, a file named sataimage.dd.md5 will be used to verify the data written to the SD card against this checksum. This file is provided with our official images and is created during image capture with the image replicator tool.

Most users should be able to use the above script without modification. Our buildroot sources are available from our github repo. To build the whole setup and create a USB drive, the following commands can be used. See the repository README for information on the project and how to make modifications.

make tsimx6ul_usbprod_defconfig && make

The resulting output file tsimx6ul-usb-production-rootfs.tar.bz2 can be unpacked to the first partition of the USB drive as outlined above.