Search by Tags

Toradex Easy Installer - Create Image

 

Article updated at 22 Apr 2021
Compare with Revision




Subscribe for this article updates


Remember that you can always refer to the Easy Installer Documentation, there you can find a lot of relevant articles that might help you in the process of load and flashing an image on your module.

Introduction

There are two entirely different situations:

  1. Create a custom image of the OS to be installed on the board - e.g. TorizonCore, Yocto-based image, and possibly other OSs - with the aid of Toradex Easy Installer. You can either:
  2. Create a modified image of Toradex Easy Installer itself, with a modified kernel/device tree or roots. For such a scenario, keep on reading to understand how to do it.

Modify the Toradex Easy Installer Image

To create a modified Toradex Easy Installer image we need the following:

We first extract the current TEZI configuration:

$ dumpimage -l tezi.itb

This should look similar to this:

FIT description: Toradex Easy Installer for Colibri iMX6
Created:         Fri Oct 19 16:14:21 2018
 Image 0 (kernel@1)
  Description:  Linux Kernel 4.1
  Created:      Fri Oct 19 16:14:21 2018
  Type:         Kernel Image
  Compression:  uncompressed
  Data Size:    5097296 Bytes = 4977.83 KiB = 4.86 MiB
  Architecture: ARM
  OS:           Linux
  Load Address: 0x11000000
  Entry Point:  0x11000000
  Hash algo:    md5
  Hash value:   8c6222f12fcc545df9eb6d06ebd488ab
 Image 1 (ramdisk@1)
  Description:  SquashFS RAMdisk
  Created:      Fri Oct 19 16:14:21 2018
  Type:         RAMDisk Image
  Compression:  uncompressed
  Data Size:    15667200 Bytes = 15300.00 KiB = 14.94 MiB
  Architecture: ARM
  OS:           Linux
  Load Address: unavailable
  Entry Point:  unavailable
  Hash algo:    md5
  Hash value:   eba56bc828c9e3c21604c521e968a541
 Image 2 (fdt@1)
  Description:  Colibri iMX6 Device Tree
  Created:      Fri Oct 19 16:14:21 2018
  Type:         Flat Device Tree
  Compression:  uncompressed
  Data Size:    45520 Bytes = 44.45 KiB = 0.04 MiB
  Architecture: ARM
  Hash algo:    md5
  Hash value:   cd0cc8dcbf9082218ffc4498613cc416
 Default Configuration: 'config@1'
 Configuration 0 (config@1)
  Description:  Toradex Easy Installer for Colibri iMX6
  Kernel:       kernel@1
  Init Ramdisk: ramdisk@1
  FDT:          fdt@1

We now have to create a file tezi.its and add the addresses according to what we received from dumpimage:

Warning: Make sure that the "load" and "entry" address values in the section below are enclosed with < >. For example if the load address was 0x11000000, the line would look like: "load = <0x11000000>; " (without quotation marks)

/dts-v1/;
 
/ {
    description = "U-Boot fitImage for Toradex Easy Installer";
    #address-cells = <1>;
 
    images {
        kernel@0 {
            description = "Linux Kernel";
            data = /incbin/("./zImage");
            type = "kernel";
            arch = "arm";
            os = "linux";
            compression = "none";
            load = <replace with address from dumpimage>;
            entry = <replace with address from dumpimage>;
            hash@1 {
                algo = "md5";
            };
        };
        fdt@0 {
            description = "Flattened Device Tree blob";
            data = /incbin/("./system.dtb");
            type = "flat_dt";
            arch = "arm";
            compression = "none";
            hash@1 {
                algo = "md5";
            };
        };
        ramdisk@0 {
            description = "Ramdisk Image";
            data = /incbin/("./ramdisk");
            type = "ramdisk";
            arch = "arm";
            os = "linux";
            compression = "none";
            hash@1 {
                algo = "md5";
            };
        };
    };
    configurations {
        default = "config@1";
        config@1 {
            description = "Boot Linux kernel with FDT blob + ramdisk";
            kernel = "kernel@0";
            fdt = "fdt@0";
            ramdisk = "ramdisk@0";
            hash@1 {
                algo = "md5";
            };
        };
    };
};

We must extract all images that later are required to repack:

$ dumpimage tezi.itb -T flat_dt -p 0 -o zImage
$ dumpimage tezi.itb -T flat_dt -p 1 -o ramdisk
$ dumpimage tezi.itb -T flat_dt -p 2 -o system.dtb

Now that we have all parts of the original image available, we can replace the ones we want to change (e.g. the device tree "system.dtb").

After that we can repack the FIT image with the command:

$ mkimage -f tezi.its tezi_new.itb

The resulting tezi_new.itb can be used as a new Toradex Easy Installer image.