kernel-fitimage: fix build issue w/out dtb by name
kernel-fitimage: fix build issue w/out dtb by name

When FITIMAGE_DTB_BY_NAME = "0", the following build issue happens.

	Log data follows:
	| DEBUG: Executing shell function do_assemble_fitimage
	| none
	| FIT description: U-Boot fitImage for xxx
	| Created:         Wed Jul 26 01:22:34 2017
	|  Image 0 (kernel@1)
	|   Description:  Linux kernel
	|   Created:      Wed Jul 26 01:22:34 2017
	|   Type:         Kernel Image
	|   Compression:  uncompressed
	|   Data Size:    3190040 Bytes = 3115.27 kB = 3.04 MB
	|   Architecture: ARM
	|   OS:           Linux
	|   Load Address: 0x80008000
	|   Entry Point:  0x80008000
	|   Hash algo:    sha1
	|   Hash value:   ff0b619672c456d03ba0b75b4abcf3298ce14864
	|  Image 1 (fdt@1)
	|   Description:  Flattened Device Tree blob
	|   Created:      Wed Jul 26 01:22:34 2017
	|   Type:         Flat Device Tree
	|   Compression:  uncompressed
	|   Data Size:    38327 Bytes = 37.43 kB = 0.04 MB
	|   Architecture: ARM
	|   Hash algo:    sha1
	|   Hash value:   e396711bfbe8ef33f49358f763bebf6345e6a8be
	|  Image 2 (fdt@2)
	|   Description:  Flattened Device Tree blob
	|   Created:      Wed Jul 26 01:22:34 2017
	|   Type:         Flat Device Tree
	|   Compression:  uncompressed
	|   Data Size:    38088 Bytes = 37.20 kB = 0.04 MB
	|   Architecture: ARM
	|   Hash algo:    sha1
	|   Hash value:   f5b9f17f06e46542165a0940ada33d4cfca2e02e
	|  Image 3 (fdt@3)
	|   Description:  Flattened Device Tree blob
	|   Created:      Wed Jul 26 01:22:34 2017
	|   Type:         Flat Device Tree
	|   Compression:  uncompressed
	|   Data Size:    39726 Bytes = 38.79 kB = 0.04 MB
	|   Architecture: ARM
	|   Hash algo:    sha1
	|   Hash value:   755d990706bfa9f203eeacbce0b9b732dfded621
	|  Default Configuration: 'conf@1'
	|  Configuration 0 (conf@1)
	|   Description:  Linux kernel, FDT blob
	|   Kernel:       kernel@1
	|   FDT:          am335x-xxx.dtb
	|  Configuration 1 (conf@2)
	|   Description:  Linux kernel, FDT blob
	|   Kernel:       kernel@1
	|   FDT:          am335x-xxx.dtb
	|  Configuration 2 (conf@3)
	|   Description:  Linux kernel, FDT blob
	|   Kernel:       kernel@1
	|   FDT:          am335x-xxx.dtb
	| uboot-mkimage Can't add hashes to FIT blob
	| Failed to find image 'fdt' in  configuration 'conf@1/signature@1'
	| WARNING: /.../temp/run.do_assemble_fitimage.26832:1 exit 255 from 'uboot-mkimage -D "-I dts -O dtb -p 2000" -F -k "keys" -K "u-boot.dtb" -r arch/arm/boot/${2}'
	| ERROR: Function failed: do_assemble_fitimage (log file is located at .../temp/log.do_assemble_fitimage.26832)
	ERROR: Task (.../meta-ti/recipes-kernel/linux/linux-ti-staging_4.9.bb:do_assemble_fitimage) failed with exit code '1'
	NOTE: Tasks Summary: Attempted 635 tasks of which 634 didn't need to be rerun and 1 failed.

The configuration node is using the dtb file name (i.e. am335x-xxx.dtb)
while the fdt node is named by its id (i.e. fdt@1).

	fdt@1 {
		description = "Flattened Device Tree blob";
		data = /incbin/("arch/arm/boot/dts/am335x-xxx.dtb.sec");
		type = "flat_dt";
		arch = "arm";
		compression = "none";
		...
	};

	...

	conf@1 {
		description = "Linux kernel, FDT blob";
		kernel = "kernel@1";
		fdt = "am335x-xxx.dtb";
		...
	};

This build issue has been introduced by the following commit.

	f23f2876a0 kernel-fitimage, arago.conf: package OPTEE OS image files into FIT

The re-indentation has mis-replaced the fdt line in configuration node.

This patch re-uses the variable ${fdt_line}.

It also applies the fix to the commit following commit.

	5edefbc694 (origin/master, origin/HEAD) kernel-fitimage: add support for packaging OPTEE pager images

Furthermore, the ${fdt_line} variable must to be set inside the for
loop. Otherwise, the fdt property will be the same for each
configurations.

Signed-off-by: Gaël PORTAY <1666f60cfa201a60b0ea694168a0b6932673170a@savoirfairelinux.com>
Signed-off-by: Denys Dmytriyenko <d29de71aea38aad3a87d486929cb0aad173ae612@ti.com>

rcn-ee/meta-arago,rcn-ee/meta-arago,rcn-ee/meta-arago,rcn-ee/meta-arago,rcn-ee/meta-arago