mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-26 00:01:48 +02:00
binman: Support templating with multiple images
Allow a template to appear in the top level description when using multiple images. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
f6abd5227a
commit
35f72fb55a
@ -57,8 +57,9 @@ def _ReadImageDesc(binman_node, use_expanded):
|
|||||||
images = OrderedDict()
|
images = OrderedDict()
|
||||||
if 'multiple-images' in binman_node.props:
|
if 'multiple-images' in binman_node.props:
|
||||||
for node in binman_node.subnodes:
|
for node in binman_node.subnodes:
|
||||||
images[node.name] = Image(node.name, node,
|
if 'template' not in node.name:
|
||||||
use_expanded=use_expanded)
|
images[node.name] = Image(node.name, node,
|
||||||
|
use_expanded=use_expanded)
|
||||||
else:
|
else:
|
||||||
images['image'] = Image('image', binman_node, use_expanded=use_expanded)
|
images['image'] = Image('image', binman_node, use_expanded=use_expanded)
|
||||||
return images
|
return images
|
||||||
|
@ -6793,6 +6793,18 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
|
|||||||
second = U_BOOT_DATA + b'#' + VGA_DATA + U_BOOT_DTB_DATA
|
second = U_BOOT_DATA + b'#' + VGA_DATA + U_BOOT_DTB_DATA
|
||||||
self.assertEqual(U_BOOT_IMG_DATA + first + second, data)
|
self.assertEqual(U_BOOT_IMG_DATA + first + second, data)
|
||||||
|
|
||||||
|
def testTemplateBlobMulti(self):
|
||||||
|
"""Test using a template with 'multiple-images' enabled"""
|
||||||
|
TestFunctional._MakeInputFile('my-blob.bin', b'blob')
|
||||||
|
TestFunctional._MakeInputFile('my-blob2.bin', b'other')
|
||||||
|
retcode = self._DoTestFile('287_template_multi.dts')
|
||||||
|
|
||||||
|
self.assertEqual(0, retcode)
|
||||||
|
image = control.images['image']
|
||||||
|
image_fname = tools.get_output_filename('my-image.bin')
|
||||||
|
data = tools.read_file(image_fname)
|
||||||
|
self.assertEqual(b'blob@@@@other', data)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
27
tools/binman/test/287_template_multi.dts
Normal file
27
tools/binman/test/287_template_multi.dts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0+
|
||||||
|
|
||||||
|
/dts-v1/;
|
||||||
|
/ {
|
||||||
|
binman: binman {
|
||||||
|
multiple-images;
|
||||||
|
|
||||||
|
my_template: template {
|
||||||
|
blob-ext@0 {
|
||||||
|
filename = "my-blob.bin";
|
||||||
|
offset = <0>;
|
||||||
|
};
|
||||||
|
blob-ext@8 {
|
||||||
|
offset = <8>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
image {
|
||||||
|
pad-byte = <0x40>;
|
||||||
|
filename = "my-image.bin";
|
||||||
|
insert-template = <&my_template>;
|
||||||
|
blob-ext@8 {
|
||||||
|
filename = "my-blob2.bin";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user