Search by Tags

Toradex Easy Installer - Create Image

 

Article updated at 30 Jul 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.

Changing the default device tree overlay

Starting with Toradex Easy Installer 5.3.0, we started supporting device tree overlays. Inside the root of your Toradex Easy Installer folder, you should have an overlays.txt file that will be read directly when booting up.

The same information available in the BSP is also applicable here. You have more info about device tree overlays and the complete detail on the available device tree overlays here: Device Tree Overlays (Linux)

You can also modify the overlays.txt file for a Toradex Easy Installer loaded in eMMC: You can manually mount /boot to modify overlays.txt like the following example for the Apalis iMX8:

/ # mount -t vfat /dev/mmcblk0p1 /boot/
/ # ls /boot/
Image.gz                           imx8qm-apalis-v1.1-eval.dtb
boot.scr                           imx8qm-apalis-v1.1-ixora-v1.1.dtb
dpfw.bin                           imx8qp-apalis-v1.1-eval.dtb
dtbs                               imx8qp-apalis-v1.1-ixora-v1.1.dtb
hdmitxfw.bin                       overlays
imx8qm-apalis-eval.dtb             overlays.txt
imx8qm-apalis-ixora-v1.1.dtb

Note: The mmcblk drive and partition can change depending on the module and the Toradex Easy Installer version.

All the available overlays from Toradex are included in Toradex Easy Installer FIT image. If you want to add your custom overlay, please follow the above mentioned documentation to create your own device tree overlay for your own custom FIT image.

Warning: Please note that overlays are only supported on eMMC devices, aka. they are not supported on UBIFS (NAND Flash) devices like Colibri iMX7 (256MB and 512MB variants), Colibri iMX6ULL (256MB and 512MB variants), plus Apalis TK1.