Add support for U-Boot FIT image files

Add support for U-Boot Flattened Image Tree files.

Flattened Image Trees (FIT) are a newer boot image format used by U-Boot. This format allows for multiple kernels, root filesystems, device trees, boot configurations, and checksums to be packaged into one file. It leverages the Flattened Device Tree Blob file format.

Tests have been run locally with and without u-boot-tools installed (verifying they are skipped in this case). The device tree test file was also run with and without u-boot-tools installed to verify that there was no impact to the DTB comparator's functionality. FIT images are generated as part of the test so they do not need to be checked in.

An example of the diffoscope CLI output of the two FIT images used in fit_test.py is shown below

--- test1.itb
+++ test2.itb
├── dumpimage -l {}
│ @@ -5,13 +5,13 @@
│    Created:      Fri Jan  1 00:00:00 2021
│    Type:         RAMDisk Image
│    Compression:  uncompressed
│    Data Size:    1024 Bytes = 1.00 KiB = 0.00 MiB
│    Architecture: ARM
│    OS:           Linux
│    Load Address: 0x00000000
│ -  Entry Point:  0x00001000
│ +  Entry Point:  0x00002000
│   Default Configuration: 'conf-1'
│   Configuration 0 (conf-1)
│    Description:  unavailable
│    Kernel:       unavailable
│    Init Ramdisk: ramdisk-1
├── ramdisk-1
│ ├── file list
│ │ @@ -1,4 +1,4 @@
│ │ -lrwxrwxrwx   1     1000     1000        6 2015-06-24 15:10:12.000000 dir/link -> broken
│ │ +lrwxrwxrwx   1     1000     1000       13 2015-06-24 15:11:35.000000 dir/link -> really-broken
│ │  crw-r--r--   1        0        0    1,  3 2015-06-24 14:47:34.000000 dir/null
│ │ --rw-r--r--   1     1000     1000      446 2015-06-24 15:10:17.000000 dir/text
│ │ -drwxr-xr-x   2     1000     1000        0 2015-06-24 15:10:12.000000 dir
│ │ +-rw-r--r--   1     1000     1000      671 2015-06-24 15:11:38.000000 dir/text
│ │ +drwxr-xr-x   2     1000     1000        0 2015-06-24 15:11:35.000000 dir
│ ├── dir/link
│ │┄ symlink
│ │ @@ -1 +1 @@
│ │ -destination: broken
│ │ +destination: really-broken
│ ├── dir/text
│ │ @@ -1,6 +1,12 @@
│ │ +A common form of lorem ipsum reads:
│ │ +
│ │  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
│ │  incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
│ │  nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
│ │  Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
│ │  fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
│ │  culpa qui officia deserunt mollit anim id est laborum.
│ │ +
│ │ +"Lorem ipsum" text is derived from sections 1.10.32--3 of Cicero's De finibus
│ │ +bonorum et malorum (On the Ends of Goods and Evils, or alternatively [About]
│ │ +The Purposes of Good and Evil).

Let me know if there are any changes I can make to improve maintainability

Merge request reports

Loading