'how to get image node offset from a FIT file (or .itb) file?

FIT (flattend image tree) is a kind of dtb (device tree blob) file containing some images node under /. It is used in u-boot program.
For example, a dts (device tree source) for a fit file starts like this.

/dts-v1/;

/ {
    timestamp = <0x61c28ac0>;
    description = "ab21m fpga FIT Image";
    #address-cells = <0x01>;

    images {

        kernel {
            description = "Kernel";
            type = "kernel";
            arch = "arm64";
            os = "linux";
            compression = "none";
            load = <0x80000000>;
            entry = <0x80000000>;

If I have a fit file (sometimes with extension .itb) generated from a dts(or .its), how can I know the offset of a specific image node (for example fdt) in the .itb file (FIT file)? I'm following u-boot program but I'm not sure the offset is correct at some point in processing.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source